Using code for uniconrn Phat from "inside" homebridge

Hi there I wonder if someone has any ideas why I get this error

I´m trying some code for my unicorn Phat but get the following error, I want to be able to use the uniconr from “inside” homebridge

#!/bin/bash -e

Create script as “script.py”

cat >script.py <<‘END_SCRIPT’
print(“TESTPRINT”)
import unicornhat as uh
uh.set_layout(uh.PHAT)
uh.brightness(0.5)

blinks all leds green

import time

while True:
for x in range(8):
for y in range(4):
uh.set_pixel(x, y, 0, 255, 0)
uh.show()
time.sleep(0.25)
uh.clear()
uh.show()
time.sleep(0.25)

print(“endendend”)
END_SCRIPT

Run script.py

python script.py

rm script.py

Here is the error returned

Can’t open /dev/mem: Permission denied
Traceback (most recent call last):
File “script.py”, line 2, in
import unicornhat as uh
File “/usr/local/lib/python2.7/dist-packages/unicornhat.py”, line 35, in
ws2812.begin()
File “/usr/local/lib/python2.7/dist-packages/rpi_ws281x/rpi_ws281x.py”, line 130, in begin
raise RuntimeError(‘ws2811_init failed with code {0} ({1})’.format(resp, str_resp))
RuntimeError: ws2811_init failed with code -5 (mmap() failed)

       Thank you