Skydance 2.4G RF

Hi obrador,

what is the content of /etc/default/mqtt_client file?

Never mind, I made it working.

Jarek

could you add some more explanation, how you got it working? perhaps show only basic scripts, how to dim/on/off lights, without the daemon and mqtt intagration

OK, I will only point to thing which are not directly explained on obrador page.

  1. Follow obrador instruction for OpenHab integration.

  2. Name of operational script will become root of topic. So if you name it wifirelay.sh the topic will be /wifirelay/XXX/command.

  3. I added to following lines to header of mqtt_client file in /etc/init.d, so I don’t need to create another file /etc/default/mqtt_client file.

    HOST=192.168.0.15 # MQTT host
    LOGFILE="/var/log/mqtt_client.log"
    LOGDATEFORMAT="%Y-%m-%d %H:%M:%S.%3N"
    SCRIPTDIR=/etc/mqtt_client/scripts

Alternatively you can put them into /etc/default/mqtt_client file.

4.Wifi relay preparation was nightmare for me. The trick is connect directly to Wifi Relay and match with your dimmer using SkySmart app. Double check if it work well, ONLY THEN connect WiFi Relay to your home network. Check again it works well with SkySmart app.

  1. Run operational script with get_devices as argument. It will give you Relay code and Device Code for each connected device. it will also ask for name of topic for each device. This name will become second part of topic. I name my dimmer led1 and full topic is/wifirelay/led1/command.

  2. I also change line 73 from:

DIMHEX=$(printf "%02x" $(( "$DIM"*255/100 )))

as HA uses 8 bit encoding, not OpenHAB %. to:

DIMHEX=$(printf "%02x" $(( "$DIM" )))

commands are ON, OFF or X where x is 0-255 value of brightness.

I checked it with MQTT client and it works well with dimming as expected.

The proper definition of dimmable light which works with this scrips if as follow:

light:
  - platform: mqtt
    name: "LED Dimmer test2"
    schema: template
    command_topic: "/wifirelay/led1/command"
    command_on_template: >
      {%- if brightness is defined -%}
      {{ brightness }}
      {%- else -%}
      ON
      {%- endif -%}
    command_off_template: 'OFF'

I manage to made working HA add-on based on @obrador work.

Video of first version of SkyDance addon

The problem is, it requires device file which is generated interactively. I don’t have any idea how to approach this in add-on

Hi @jsiemek , any progress with the add-on? I would like to test

Hello, since I had some free time over the holidays, I made a docker image. It’s based on the code published by @obrador, except I’ve simplified it a bit, as it only works for one controller. However the code is exposed, so it can be easily modified for multiple controllers.
I’ve tested and it works on my ubuntu x64 HTPC. Feel free to test in on your computers, since I’m not skilled programmer and don’t know, if it will work on other systems.
https://hub.docker.com/r/sgaluf/skydance

1 Like

Tried using it on a raspberry pi, manage to download it and start it and it made an folder “/home/pi/docker/skydance” but there was no files in it, and also the container is not running. Any idees?

I have managed to made the entire thing running on node-red. I am running two Tunable white lights as my main lights and several RGB lights, two scenes and two zones. If anybody interested I can post the flow.

I have made sheet with broken down codes.

And the node red flow

Dashboard with lights created

Does it say in the log, why the docker container isn’t running? Also, check the file permissions of /docker/skydance folder

Sure interested in the Node-Red flow!
Just received my Wifi-Relay so the naked PCB is hanging from my laptop’s USB, internal photos taken and components investigated. I configured SSID&key following instructions in the WiFI module’s manual. Just started firing up WireShark when I found all this info you’ve already gathered, brilliant!
I’m running everything in Node-Red, so very much would like the flow for controlling from there.
I wouldn’t mind the receiving part either, if it is supported by the Wifi-Relay device - I have a bunch of those compatible tiny dimmer encoder devices, they would make excellent affordable wireless “analog” control devices for anything.
My current plan is to use an S1 to control the speed of a swimming pool filter pump; full when there is solar power, low for the night to keep the ozonator and some filtering running. There is also a (water) flow meter to be integrated to the (Node-Red) flow for feedback. Would have been easier with an ESP82xx based triac dimmer, but didn’t find a high enough power one.
Can you post the flow here? That should be packaged to a real Node-Red component installable directly from Node-Red.

Here is the full flow. Far from perfect, hope you can figure it out :wink:

BTW they are releasing WT5 LED controller which will work over tuya platform.

[{"id":"60448fcd.9cf37","type":"tab","label":"Skydance Wifi Relay","disabled":false,"info":""},{"id":"d4b8a2c5.55a25","type":"server-state-changed","z":"60448fcd.9cf37","name":"Zone 3 ON/OFF","server":"bc7d368a.7f5138","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.skydance_zone3_power","entityidfiltertype":"exact","outputinitially":false,"state_type":"habool","haltifstate":"true","halt_if_type":"bool","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":160,"y":60,"wires":[["a0635d34.adf23"],["3615c486.65ec9c"]]},{"id":"a0635d34.adf23","type":"function","z":"60448fcd.9cf37","name":"Turn ON Zone 3  packet","func":"nr=Math.floor(Math.random() * 99 + 0);\nmsg.payload=\"55AA5AA57E\"+nr+\"80218012340000\"+\"01\"+\"000A01000\"+\"1\"+\"007E\";\n\nfunction toAscii(str1)\n {\n\tvar hex  = str1.toString();\n\tvar str = '';\n\tfor (var n = 0; n < hex.length; n += 2) {\n\t\tstr += String.fromCharCode(parseInt(hex.substr(n, 2), 16));\n\t}\n\treturn str;\n }\n\nmsg.payload = toAscii(msg.payload);\nmsg.payload = new Buffer(msg.payload, \"ascii\");\n\nreturn msg;\n\n\n\n\n\n","outputs":1,"noerr":0,"x":610,"y":60,"wires":[["45f3dc51.e5ea84"]]},{"id":"3615c486.65ec9c","type":"function","z":"60448fcd.9cf37","name":"Turn OFF Zone 3  packet","func":"nr=Math.floor(Math.random() * 99 + 0);\nmsg.payload=\"55AA5AA57E\"+nr+\"80218012340000\"+\"01\"+\"000A01000\"+\"0\"+\"007E\";\n\nfunction toAscii(str1)\n {\n\tvar hex  = str1.toString();\n\tvar str = '';\n\tfor (var n = 0; n < hex.length; n += 2) {\n\t\tstr += String.fromCharCode(parseInt(hex.substr(n, 2), 16));\n\t}\n\treturn str;\n }\n\nmsg.payload = toAscii(msg.payload);\nmsg.payload = new Buffer(msg.payload, \"ascii\");\n\nreturn msg;\n\n\n\n\n\n","outputs":1,"noerr":0,"x":610,"y":100,"wires":[["45f3dc51.e5ea84"]]},{"id":"863e6021.0b26e","type":"server-state-changed","z":"60448fcd.9cf37","name":"Zone 4 ON/OFF","server":"bc7d368a.7f5138","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.skydance_zone4_power","entityidfiltertype":"exact","outputinitially":false,"state_type":"habool","haltifstate":"true","halt_if_type":"bool","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":160,"y":120,"wires":[["1e5ce75d.cfdaa9"],["ac4dec68.b2005"]]},{"id":"1e5ce75d.cfdaa9","type":"function","z":"60448fcd.9cf37","name":"Turn ON Zone 4  packet","func":"nr=Math.floor(Math.random() * 99 + 0);\nmsg.payload=\"55AA5AA57E\"+nr+\"80318012340000\"+\"02\"+\"000A01000\"+\"1\"+\"007E\";\n\nfunction toAscii(str1)\n {\n\tvar hex  = str1.toString();\n\tvar str = '';\n\tfor (var n = 0; n < hex.length; n += 2) {\n\t\tstr += String.fromCharCode(parseInt(hex.substr(n, 2), 16));\n\t}\n\treturn str;\n }\n\nmsg.payload = toAscii(msg.payload);\nmsg.payload = new Buffer(msg.payload, \"ascii\");\n\nreturn msg;\n\n\n\n\n\n","outputs":1,"noerr":0,"x":590,"y":160,"wires":[["45f3dc51.e5ea84"]]},{"id":"ac4dec68.b2005","type":"function","z":"60448fcd.9cf37","name":"Turn OFF Zone 4  packet","func":"nr=Math.floor(Math.random() * 99 + 0);\nmsg.payload=\"55AA5AA57E\"+nr+\"80318012340000\"+\"02\"+\"000A01000\"+\"0\"+\"007E\";\n\nfunction toAscii(str1)\n {\n\tvar hex  = str1.toString();\n\tvar str = '';\n\tfor (var n = 0; n < hex.length; n += 2) {\n\t\tstr += String.fromCharCode(parseInt(hex.substr(n, 2), 16));\n\t}\n\treturn str;\n }\n\nmsg.payload = toAscii(msg.payload);\nmsg.payload = new Buffer(msg.payload, \"ascii\");\n\nreturn msg;\n\n\n\n\n\n","outputs":1,"noerr":0,"x":590,"y":200,"wires":[["45f3dc51.e5ea84"]]},{"id":"e9f016b7.d89928","type":"server-state-changed","z":"60448fcd.9cf37","name":"Master ON/OFF","server":"bc7d368a.7f5138","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.skydance_power","entityidfiltertype":"exact","outputinitially":false,"state_type":"habool","haltifstate":"true","halt_if_type":"bool","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":160,"y":180,"wires":[["93d1f7ad.448d28"],["6cf5822e.3bc67c"]]},{"id":"93d1f7ad.448d28","type":"function","z":"60448fcd.9cf37","name":"Master ON  packet","func":"nr=Math.floor(Math.random() * 99 + 0);\nmsg.payload=\"55AA5AA57E\"+nr+\"80118012340000\"+\"0FFF0B030000000\"+\"1\"+\"007E\";\n\nfunction toAscii(str1)\n {\n\tvar hex  = str1.toString();\n\tvar str = '';\n\tfor (var n = 0; n < hex.length; n += 2) {\n\t\tstr += String.fromCharCode(parseInt(hex.substr(n, 2), 16));\n\t}\n\treturn str;\n }\n\nmsg.payload = toAscii(msg.payload);\nmsg.payload = new Buffer(msg.payload, \"ascii\");\n\nreturn msg;\n\n\n\n\n\n","outputs":1,"noerr":0,"x":410,"y":260,"wires":[["45f3dc51.e5ea84"]]},{"id":"6cf5822e.3bc67c","type":"function","z":"60448fcd.9cf37","name":"Master OFF  packet","func":"nr=Math.floor(Math.random() * 99 + 0);\nmsg.payload=\"55AA5AA57E\"+nr+\"80118012340000\"+\"0FFF0B030000000\"+\"0\"+\"007E\";\n\nfunction toAscii(str1)\n {\n\tvar hex  = str1.toString();\n\tvar str = '';\n\tfor (var n = 0; n < hex.length; n += 2) {\n\t\tstr += String.fromCharCode(parseInt(hex.substr(n, 2), 16));\n\t}\n\treturn str;\n }\n\nmsg.payload = toAscii(msg.payload);\nmsg.payload = new Buffer(msg.payload, \"ascii\");\n\nreturn msg;\n\n\n\n\n\n","outputs":1,"noerr":0,"x":410,"y":300,"wires":[["45f3dc51.e5ea84"]]},{"id":"1a7449cb.861336","type":"server-state-changed","z":"60448fcd.9cf37","name":"Scene 1","server":"bc7d368a.7f5138","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.skydance_scene_1","entityidfiltertype":"exact","outputinitially":false,"state_type":"habool","haltifstate":"true","halt_if_type":"bool","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":140,"y":400,"wires":[["77124c03.b066f4","2b73b324.26bd4c"],[]]},{"id":"77124c03.b066f4","type":"function","z":"60448fcd.9cf37","name":"Scene 1  packet","func":"nr=Math.floor(Math.random() * 99 + 0);\nmsg.payload=\"55AA5AA57E\"+nr+\"80118012340000\"+\"01\"+\"FF04020001\"+\"01\"+\"007E\";\n\nfunction toAscii(str1)\n {\n\tvar hex  = str1.toString();\n\tvar str = '';\n\tfor (var n = 0; n < hex.length; n += 2) {\n\t\tstr += String.fromCharCode(parseInt(hex.substr(n, 2), 16));\n\t}\n\treturn str;\n }\n\nmsg.payload = toAscii(msg.payload);\nmsg.payload = new Buffer(msg.payload, \"ascii\");\n\nreturn msg;\n\n\n\n\n\n","outputs":1,"noerr":0,"x":400,"y":420,"wires":[["45f3dc51.e5ea84"]]},{"id":"45f3dc51.e5ea84","type":"tcp request","z":"60448fcd.9cf37","server":"192.168.1.49","port":"8899","out":"immed","splitc":" ","name":"To Wifi Relay","x":1030,"y":360,"wires":[[]]},{"id":"d2adedc0.c61bf","type":"function","z":"60448fcd.9cf37","name":"Scene 2 packet","func":"nr=Math.floor(Math.random() * 99 + 0);\nmsg.payload=\"55AA5AA57E\"+nr+\"80118012340000\"+\"01\"+\"FF04020001\"+\"02\"+\"007E\";\n\nfunction toAscii(str1)\n {\n\tvar hex  = str1.toString();\n\tvar str = '';\n\tfor (var n = 0; n < hex.length; n += 2) {\n\t\tstr += String.fromCharCode(parseInt(hex.substr(n, 2), 16));\n\t}\n\treturn str;\n }\n\nmsg.payload = toAscii(msg.payload);\nmsg.payload = new Buffer(msg.payload, \"ascii\");\n\nreturn msg;\n\n\n\n\n\n","outputs":1,"noerr":0,"x":400,"y":516,"wires":[["45f3dc51.e5ea84"]]},{"id":"e846cefe.49231","type":"server-state-changed","z":"60448fcd.9cf37","name":"Scene 2","server":"bc7d368a.7f5138","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.skydance_scene_2","entityidfiltertype":"exact","outputinitially":false,"state_type":"habool","haltifstate":"true","halt_if_type":"bool","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":140,"y":520,"wires":[["d2adedc0.c61bf","5ab9f590.f825ac"],[]]},{"id":"2a7705e8.ca7e6a","type":"function","z":"60448fcd.9cf37","name":"Brightness Zone 3 packet","func":"nr=Math.floor(Math.random() * 99 + 0);\nvar dim = msg.payload;\nvar dimhex = dim.toString(16);\nmsg.payload=\"55AA5AA57E\"+nr+\"80218030710000\"+\"01\"+\"0007020000\"+dimhex+\"007E\";\n\nfunction toAscii(str1)\n {\n\tvar hex  = str1.toString();\n\tvar str = '';\n\tfor (var n = 0; n < hex.length; n += 2) {\n\t\tstr += String.fromCharCode(parseInt(hex.substr(n, 2), 16));\n\t}\n\treturn str;\n }\n\nmsg.payload = toAscii(msg.payload);\nmsg.payload = new Buffer(msg.payload, \"ascii\");\n\nreturn msg;\n\n\n\n\n\n","outputs":1,"noerr":0,"x":590,"y":600,"wires":[["45f3dc51.e5ea84"]]},{"id":"7720e55c.7973bc","type":"server-state-changed","z":"60448fcd.9cf37","name":"Zone 3 Slider","server":"bc7d368a.7f5138","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.slider1","entityidfiltertype":"exact","outputinitially":false,"state_type":"num","haltifstate":"","halt_if_type":"num","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":150,"y":600,"wires":[["c29b9b56.6fc3b8"]]},{"id":"3eade0c8.b5afb","type":"function","z":"60448fcd.9cf37","name":"Brightness Zone 4 packet","func":"nr=Math.floor(Math.random() * 99 + 0);\nvar dim = msg.payload;\nvar dimhex = dim.toString(16);\nmsg.payload=\"55AA5AA57E\"+nr+\"80318030710000\"+\"02\"+\"0007020000\"+dimhex+\"007E\";\n\nfunction toAscii(str1)\n {\n\tvar hex  = str1.toString();\n\tvar str = '';\n\tfor (var n = 0; n < hex.length; n += 2) {\n\t\tstr += String.fromCharCode(parseInt(hex.substr(n, 2), 16));\n\t}\n\treturn str;\n }\n\nmsg.payload = toAscii(msg.payload);\nmsg.payload = new Buffer(msg.payload, \"ascii\");\n\nreturn msg;\n\n\n\n\n\n","outputs":1,"noerr":0,"x":570,"y":660,"wires":[["45f3dc51.e5ea84"]]},{"id":"4a7ec9b.50f3a38","type":"server-state-changed","z":"60448fcd.9cf37","name":"Zone 4 Slider","server":"bc7d368a.7f5138","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.slider2","entityidfiltertype":"exact","outputinitially":false,"state_type":"num","haltifstate":"","halt_if_type":"num","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":150,"y":660,"wires":[["ee27d9a8.6d6a08"]]},{"id":"ee27d9a8.6d6a08","type":"range","z":"60448fcd.9cf37","minin":"1","maxin":"255","minout":"16","maxout":"255","action":"scale","round":true,"property":"payload","name":"Range Converter","x":350,"y":660,"wires":[["3eade0c8.b5afb"]]},{"id":"ff75ec2b.ebe2d","type":"server-state-changed","z":"60448fcd.9cf37","name":"Tunable white slider","server":"bc7d368a.7f5138","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.slider3","entityidfiltertype":"exact","outputinitially":false,"state_type":"num","haltifstate":"","halt_if_type":"num","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":170,"y":720,"wires":[["bef9e15f.98beb"]]},{"id":"bef9e15f.98beb","type":"range","z":"60448fcd.9cf37","minin":"500","maxin":"153","minout":"16","maxout":"255","action":"scale","round":true,"property":"payload","name":"Range Converter","x":390,"y":720,"wires":[["2c4d86dc.5708fa"]]},{"id":"2c4d86dc.5708fa","type":"function","z":"60448fcd.9cf37","name":"Tunable White packet","func":"nr=Math.floor(Math.random() * 99 + 0);\nvar dim = msg.payload;\nvar wifi= 3071;\nvar dimhex = dim.toString(16);\n//msg.payload=\"55AA5AA57E\"+nr+\"80008012340000\"+\"01\"+\"000d020000\"+dimhex+\"007E\";\nmsg.payload=\"55AA5AA57E\"+nr+\"802180\"+wifi+\"0000\"+\"01\"+\"000d020000\"+dimhex+\"007E\";\n                             \n\nfunction toAscii(str1)\n {\n\tvar hex  = str1.toString();\n\tvar str = '';\n\tfor (var n = 0; n < hex.length; n += 2) {\n\t\tstr += String.fromCharCode(parseInt(hex.substr(n, 2), 16));\n\t}\n\treturn str;\n }\n\nmsg.payload = toAscii(msg.payload);\nmsg.payload = new Buffer(msg.payload, \"ascii\");\n\nreturn msg;\n\n\n\n\n\n","outputs":1,"noerr":0,"x":620,"y":720,"wires":[["45f3dc51.e5ea84"]]},{"id":"a9a11c76.80c42","type":"server-state-changed","z":"60448fcd.9cf37","name":"RED slider","server":"bc7d368a.7f5138","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.slider4","entityidfiltertype":"exact","outputinitially":false,"state_type":"num","haltifstate":"","halt_if_type":"num","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":140,"y":800,"wires":[["9f079185.a6325"]]},{"id":"bd47be71.99844","type":"server-state-changed","z":"60448fcd.9cf37","name":"GREEN slider","server":"bc7d368a.7f5138","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.slider5","entityidfiltertype":"exact","outputinitially":false,"state_type":"num","haltifstate":"","halt_if_type":"num","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":150,"y":860,"wires":[["1bfcc6c9.17ee19"]]},{"id":"e0e29de8.2788c","type":"server-state-changed","z":"60448fcd.9cf37","name":"BLUE slider","server":"bc7d368a.7f5138","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.slider6","entityidfiltertype":"exact","outputinitially":false,"state_type":"num","haltifstate":"","halt_if_type":"num","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":150,"y":920,"wires":[["705729e9.e82288"]]},{"id":"9f079185.a6325","type":"range","z":"60448fcd.9cf37","minin":"1","maxin":"255","minout":"16","maxout":"255","action":"scale","round":true,"property":"payload","name":"Range Converter","x":330,"y":800,"wires":[["5c6a72d1.c72f9c"]]},{"id":"1bfcc6c9.17ee19","type":"range","z":"60448fcd.9cf37","minin":"1","maxin":"255","minout":"16","maxout":"255","action":"scale","round":true,"property":"payload","name":"Range Converter","x":330,"y":860,"wires":[["ffa759ce.c3af08"]]},{"id":"705729e9.e82288","type":"range","z":"60448fcd.9cf37","minin":"1","maxin":"255","minout":"16","maxout":"255","action":"scale","round":true,"property":"payload","name":"Range Converter","x":330,"y":920,"wires":[["9572466d.e90708"]]},{"id":"44ac8c5e.ca00d4","type":"function","z":"60448fcd.9cf37","name":"RGB packet","func":"nr=Math.floor(Math.random() * 99 + 0);\nvar red = 0;\nvar green = 0;\nvar blue = 0;\nvar wifi= 3071;\nred = flow.get(\"red\");\ngreen = flow.get(\"green\");\nblue = flow.get(\"blue\");\n//msg.payload=\"55AA5AA57E\"+nr+\"80318012340000\"+\"02\"+\"00010700\"+red+green+blue+\"000000\"+\"007E\";\nmsg.payload=\"55AA5AA57E\"+nr+\"803180\"+wifi+\"0000\"+\"02\"+\"00010700\"+red+green+blue+\"00000000\"+\"007E\";\n\nfunction toAscii(str1)\n {\n\tvar hex  = str1.toString();\n\tvar str = '';\n\tfor (var n = 0; n < hex.length; n += 2) {\n\t\tstr += String.fromCharCode(parseInt(hex.substr(n, 2), 16));\n\t}\n\treturn str;\n }\n\nmsg.payload = toAscii(msg.payload);\nmsg.payload = new Buffer(msg.payload, \"ascii\");\nreturn msg;\n\n\n\n\n\n","outputs":1,"noerr":0,"x":730,"y":860,"wires":[[]]},{"id":"5c6a72d1.c72f9c","type":"function","z":"60448fcd.9cf37","name":"RED var","func":"var red = msg.payload;\nvar redhex = red.toString(16);\nmsg.payload = redhex;\nflow.set(\"red\", redhex);\nreturn msg;","outputs":1,"noerr":0,"x":520,"y":800,"wires":[["44ac8c5e.ca00d4"]]},{"id":"ffa759ce.c3af08","type":"function","z":"60448fcd.9cf37","name":"GREEN var","func":"var green = msg.payload;\nvar greenhex = green.toString(16);\nmsg.payload = greenhex;\nflow.set(\"green\", greenhex);\nreturn msg;","outputs":1,"noerr":0,"x":530,"y":860,"wires":[["44ac8c5e.ca00d4"]]},{"id":"9572466d.e90708","type":"function","z":"60448fcd.9cf37","name":"BLUE var","func":"var blue = msg.payload;\nvar bluehex = blue.toString(16);\nmsg.payload = bluehex;\nflow.set(\"blue\", bluehex);\nreturn msg;","outputs":1,"noerr":0,"x":520,"y":920,"wires":[["44ac8c5e.ca00d4"]]},{"id":"2b73b324.26bd4c","type":"delay","z":"60448fcd.9cf37","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":170,"y":340,"wires":[["b9e36001.32b1"]]},{"id":"b9e36001.32b1","type":"api-call-service","z":"60448fcd.9cf37","name":"","server":"bc7d368a.7f5138","version":1,"debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.skydance_scene_1","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":390,"y":360,"wires":[[]]},{"id":"5ab9f590.f825ac","type":"delay","z":"60448fcd.9cf37","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":170,"y":460,"wires":[["333b75a1.8fe79a"]]},{"id":"333b75a1.8fe79a","type":"api-call-service","z":"60448fcd.9cf37","name":"","server":"bc7d368a.7f5138","version":1,"debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.skydance_scene_2","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":390,"y":460,"wires":[[]]},{"id":"c29b9b56.6fc3b8","type":"range","z":"60448fcd.9cf37","minin":"1","maxin":"255","minout":"16","maxout":"255","action":"scale","round":true,"property":"payload","name":"Range Converter","x":350,"y":600,"wires":[["2a7705e8.ca7e6a"]]},{"id":"9c14dedb.cc7cb","type":"api-current-state","z":"60448fcd.9cf37","name":"RGB Light State","server":"bc7d368a.7f5138","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"light.rgb_lights","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":320,"y":1000,"wires":[["f6110f43.7c1d9"],[]]},{"id":"f6110f43.7c1d9","type":"function","z":"60448fcd.9cf37","name":"To variables","func":"var rgb = msg.data.attributes.rgb_color;\nvar red = rgb[0];\nvar green = rgb[1];\nvar blue = rgb[2];\nvar redhex = red.toString(16);\nvar greenhex = green.toString(16);\nvar bluehex = blue.toString(16);\nflow.set(\"red\", redhex);\nflow.set(\"green\", greenhex);\nflow.set(\"blue\", bluehex);\nreturn msg;","outputs":1,"noerr":0,"x":510,"y":1000,"wires":[["8cc0ad63.4de31"]]},{"id":"8cc0ad63.4de31","type":"function","z":"60448fcd.9cf37","name":"RGB packet","func":"nr=Math.floor(Math.random() * 99 + 0);\nvar red = 0;\nvar green = 0;\nvar blue = 0;\nvar wifi= 3071;\n\nred = flow.get(\"red\");\ngreen = flow.get(\"green\");\nblue = flow.get(\"blue\");\n//msg.payload=\"55AA5AA57E\"+nr+\"80318012340000\"+\"02\"+\"00010700\"+red+green+blue+\"000000\"+\"007E\";\nmsg.payload=\"55AA5AA57E\"+nr+\"803180\"+wifi+\"0000\"+\"02\"+\"00010700\"+red+green+blue+\"00000000\"+\"007E\";\n\nfunction toAscii(str1)\n {\n\tvar hex  = str1.toString();\n\tvar str = '';\n\tfor (var n = 0; n < hex.length; n += 2) {\n\t\tstr += String.fromCharCode(parseInt(hex.substr(n, 2), 16));\n\t}\n\treturn str;\n }\n\nmsg.payload = toAscii(msg.payload);\nmsg.payload = new Buffer(msg.payload, \"ascii\");\nreturn msg;\n\n\n\n\n\n","outputs":1,"noerr":0,"x":670,"y":1000,"wires":[["92056e8.da72b9","f07e516a.6cab3"]]},{"id":"92056e8.da72b9","type":"tcp request","z":"60448fcd.9cf37","server":"192.168.1.49","port":"8899","out":"immed","splitc":" ","name":"To Wifi Relay","x":850,"y":1000,"wires":[[]]},{"id":"833b360e.33e3b8","type":"trigger-state","z":"60448fcd.9cf37","name":"RGB Light","server":"bc7d368a.7f5138","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"light.rgb_lights","entityidfiltertype":"exact","debugenabled":false,"constraints":[],"constraintsmustmatch":"all","outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","x":110,"y":1000,"wires":[["9c14dedb.cc7cb"],[]]},{"id":"f07e516a.6cab3","type":"debug","z":"60448fcd.9cf37","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":870,"y":920,"wires":[]},{"id":"bc7d368a.7f5138","type":"server","z":"","name":"Home Assistant","addon":true}]

I keep getting connection error, like the connection is beeing refused by the WiFi Relay.
Has it happened to anyone else?

@DeanoX Could you share your node red implementation?

Hi all,

first of all, sorry for my english language, i’m spanish and it is not so good.

I have seen your post about s1-b and wifi relay and i want to integrate it in order to use on alexa or google home.

I have no idea about home assistant (im a computer enginering, but i only know little details about home assistant).

I have 7 S1-B installed on my home and i want to control it.

Could you help me and show the correct way to do it?

Thanks you so much.

Regards.

Hi everyone!

Since I also have these at home, I wanted to contribute somehow and created a Python library and a HACS based integration. Currently, it supports only CCT controllers, but it shouldn’t be a big issue to add RGB support, if the integration proves to be useful.

Could you please give it a try, report the issues and possibly request additional features on GitHub?

2 Likes

Thanks for the effort but alas the link is broken, can you fix it ?

Hi guys
I have read this thread and I would like to accomplish actually the opposite way.
Is there a way to use some of the Skydance wall mounted DMX512 master panels (like this one Touch Panel 4 Zone RGB DMX512 Master & RF Remote T13 ) and let Home Assistant read its output? So the wall mounted panel would send DMX512 command to HomeAssistant (directly or with help of Nodered or anyhow) and HA would set the properties of the chosen light appropriately and then HA would control the lights (in a common way depending of the light type). So the Skydance panel would not control any lights directly but it would serve the same purpose as if you would control the color/brightness/etc. of the light in Lovelace.

2 Likes

Hi @drax can you share how to get the values to create your sheet?

It was so long ago…I think I have used HTTP Canary on my phone to capture the TCP traffic, i am sure you can to this with wireshark as well

1 Like

I was thinking of a way of updating the status when the lights are switched on by a switch. My idea is to add an ACS712 (https://s.click.aliexpress.com/e/_DnNCCVJ) and an esp with a wifi module between the controller and the led, so that when it detects a change in voltage it can send an update of the device’s current status.
What are your thoughts on this? Is it possible?