Bytearray?

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…

Yes. It has limitations. You also can not import any modules. IIRC that’s to prevent the users from using code that breaks the whole async-structure that Home Assistant is using. If for example you would to a time.sleep(10) in your script, that would really mess up the core of Home Assistant. Or at least it was like that some time ago.

Thanks. Looks like install python and run as a command line is the way to go for now…

Are you trying to reverse engineer the Skydance Wifi-Relay protocol?
I’ve been working on this for the past month.
The bytes you posted are exactly the same as the ones i’m dealing with.
PM me and we can exchange emails if you’d like to collaborate and see if we can get this working.

1 Like

Yep - its the Skydance range. Well spotted !

I bought a handful of the 2.4G RF units and have been investigating if I can control them. I have the large triac dimmer (S1) a couple of small triac dimmers (S1-B) and the small relay (SB) - and a WiFi Relay.

I have On/Off/Toggle and set the Dim level to 0-255 working from PC to WiFi Relay.

Can’t find a “Dim Up” or “Dim Down” at the moment - and I dont have any RGB modules.

PM Sent :smiley:

2 Likes

FWIW, you should consider creating a custom comopnent. There you can import everything you need and work with all kinds of data.

Please, i’m just dealing with this, without results. s1-b looks like a great device for dimming non smart lights.
Please can you share your results?

between boydg and myself we have made some good progress on how to control them. There are quite a few quirks between the various dimmer/control modules.

I have some hacked together scripts at the moment that I am trying to make a little more robust. Unfortunately my coding really isnt up to a full blown HA component, but a few command line scripts allow HA to control them. Will try and write it up more fully asap.

If you have the details of your modules and a wireshark capture then it would all help see as many varieties as possible.

1 Like

Hi! Googling for “55 aa 5a a5” string I found this thread. I’m also trying to control this funny Wifi-RF relay from Skydance, to operate the S1-B LED dimmer. In my case I’m using Openhab as a home system, but I’m sure the prodecure to work with the wifi relay is similar.
I’m stuck at decoding the right Hex bytes to control the LED and I wonder if you could share with me, and maybe get a little feedback. Can you please let me in your investigation? It would be excellent!

King regards,
Jaume.

Jaume - See here

I am successfully controlling via Node-Red now. Not sure if there is integration with OpenHab. IM if you’re interested…

Hi! thanks a lot. I’m not using NodeRed, but it has an integration with Openhab. I saw that interesting post you mention. Thanks for your great work.

I try to contact privately with you but I don’t find the way to send you a private message through this forum. Can you please send me your mail to ‘obrador at espaiweb.net’ and I’ll contact you?

Thanks in advance!
Jaume.

Hi guys, I have a bunch of skydance controllers, Single Colour, Tunable White, RGB, RGBW, various remotes and wall panels and wifi relay. I would like to be part of this, @DeanoX please PM me :wink:

Hi,
I am interested into your Node-Red for for Skydance.
Can you share it with me ?
Regars,
Vince