I am creating a script that can control some lights via a local Wifi/RF bridge. I need to create a specific IP packet to send.
If I test in python within linux the following works…
packet = bytearray.fromhex("55 aa 5a a5 7e 19 01 01 00 01 00 33 65 01 00 0a 01 00 01 00 7e")
If I use that within a script in /config/python_script to call direct from HA -it errors.
NameError: name 'bytearray' is not defined
Is the python use for “python_script” not the complete python ? Do I need to include something specific ? ?
This is my 1st python script of any sort so may be obvious but not to me…