wifi370 / wifi320 rgb led controller. Anybody?

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
Edgar
Posts: 24
Joined: Saturday 13 September 2014 23:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands, -6 NAP
Contact:

wifi370 / wifi320 rgb led controller. Anybody?

Post by Edgar »

Has anybody succesfully included wifi370 controllers in Domoticz yet? I would like to control them from within domoticz app; use the color picker, dim levels, etc.

I'm talking about these:

Image

I've got the rgb and also the 2 channel single color versions here. As far as I've looked; only android and iOs apps exist, and some info can be found on internet how to control these devices.

They're controlled like the applampled devices; except for differences in port number, control sequences / command codes. I've combined all info about how to manage these devices and have working scripts for standalone use (set modes / colors, get status (model, modes, colors).

But now I'm stuck at integrating with Domoticz. Anybody any help?

ps: I can provide all relevant commands / script if needed.
Only Robinson Crusoe had everything done by Friday
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: wifi370 / wifi320 rgb led controller. Anybody?

Post by ThinkPad »

Edgar wrote: [...]
ps: I can provide all relevant commands / script if needed.
That's always a good idea to start off with, might be useful for someone else.
I am not active on this forum anymore.
Edgar
Posts: 24
Joined: Saturday 13 September 2014 23:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands, -6 NAP
Contact:

Re: wifi370 / wifi320 rgb led controller. Anybody?

Post by Edgar »

Ok, after a short break here are my results:

hexcodes for switching device on /off (both 370 and 320)

cc2333 for on
cc2433 for off

for instance: echo -ne '\xcc\x23\x33' | nc -w 3 -n <ipaddress> 5577

hexcodes for color levels (wifi370, 3ch)

56101010aa for each color at level 10(hex)
56ffffffaa for each color at level ff(hex)
56ff0000aa for max red
5600ff00aa for max green
540000ffaa for max blue

for instance: echo -ne '\x56\x10\x00\x00\xaa' | nc -w 3 -n <ipaddress> 5577

hexcodes for warm/cool levels (wifi320, 2ch)

56ff00aa for warm color led at level ff(hex)
5600ffaa for very cold color at level ff(hex)

for instance: echo -ne '\x56\x00\x80\xaa' | nc -w 3 -n <ipaddress> 5577

Status codes (wifi370 and 320):

ef0177

after sending this, the unit will report back with a string containing:
A - if it is on
B - if it's running an internal program for led animation or just user input levels
C - if internal program is running or stopped
D - if running internal program, which speed
E - 3 (wifi370) or 2 (wifi320) led channel values
F - which type it is (3 or 2 channel)

* I tested this on OS X, and I didn't get an answer back. This has something to do with the way nc (netcat) works on OS X. I did 'borrow' some functions out of a php script which opens a socket connection to the device. See:
https://www.symcon.de/forum/threads/238 ... t=led+wifi


A typical answer would be:

6601234120118080800199

Let's break this down:
6601 discard, no use
23 -> unit is on, 24 is off (A)
41 -> use user input levels, any other value is a preset mode (B)
20 -> run preset mode = off, 21 = on (not used if B is 41) (C)
11 -> speed to run preset mode at (not used if B is 41) (D)
808080 -> individual channel levels (with 2 channel devices last two digits are always 0, so 808000 f.i.) (E)
01 -> device type RGB, 00 is 2channel (F)
99 discard, no use

To me it looks like this is everything needed to operate these from within Domoticz. It would be nice if I could use the color picker or see the device status without external scripting.
Only Robinson Crusoe had everything done by Friday
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: wifi370 / wifi320 rgb led controller. Anybody?

Post by ThinkPad »

Hi Edgar,

Did you got any further with this? I bought a H801 WiFi dimmer (based on ESP8266) which seems to use the same kind of controlling by hex: http://domoticz.com/forum/download/file.php?id=4099
See my topic: http://domoticz.com/forum/viewtopic.php?f=38&t=7957

I can now basically control it with 'sendip' on a Raspberry. I will try nc or telnet this afternoon. I already did yesterday, but my syntax wasn't correct, compared to yours (i didn't use the forward slashes like you do) so it didn't work.
How do you control this dimmer through Domoticz?

In this topic: http://domoticz.com/forum/viewtopic.php ... hex#p51727 they control the Hue with a Bash script to set the Hue to a predefined color setting. The script is being activated by a Scene in Domoticz. However, as our controllers understand a HEX-colorcode, i thought it shouldn't be that hard to use a colorpicker.... If there was only a way to grab the hex value from a colorpicker in Domoticz through a Lua script.... A colorpicker is already available if you have Philips Hue / Milight/Limitless added in Domoticz.
I am not active on this forum anymore.
Edgar
Posts: 24
Joined: Saturday 13 September 2014 23:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands, -6 NAP
Contact:

Re: wifi370 / wifi320 rgb led controller. Anybody?

Post by Edgar »

Hi Thinkpad,

After my july post I haven't done anything with it. I was hoping someone has already picked this up and would chime in but alas!

I'm very busy with other things right now, but occasionaly I have some tinker time or am going over some ideas I still have.

Basically these are my options / ideas:

1) make a request to the domoticz programmers to add this in domoticz. As it's nothing more than some applamp/milight 'dialect' this woudn't be especially difficult I guess. And I saw your topic and findings and it seems yours are likewise and could be easily integrated as well when you figured out everything.
2) try to make a driver myself (no chance, I don't have the time)
3) make a framework of some scripting and a litte database to control these lights and a couple of Hue lamps I have. This way I can not only switch individual lights or group of lights, but capture colors and levels of selected lights to be put in a set (or scene if you want). These presets would be coupled to buttons in domoticz to recall them. But this is at this moment not at my top of the list of things to do :-)

At this moment I use a few crude commands and shell scripts to control them and get running info from them. If I'm to put this together to control them from domoticz in a decent way I'm halfway in point 3 above. So for now, only some basic testing has been done but I really like them except for their always on custom wifi network. I can PM you the PHP code I use for getting status info back. Maybe it's of use to you if you adapt it.
Only Robinson Crusoe had everything done by Friday
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: wifi370 / wifi320 rgb led controller. Anybody?

Post by ThinkPad »

Thanks for your reaction!

I'm actually already quite far, i can send a color to the unit by commandline ('netcat') or with a PHP-script.
Unfortunately i haven't yet managed to make it dynamically. The color sent is now just a static string.

Maybe you can have a look at my PHP-script: http://domoticz.com/forum/viewtopic.php ... 957#p54379 ?
Sending a static HEX-string works, but i would like to pop in a color through a GET-variable. And that is where the script breaks. I think the script breaks because it tries to put in a string (from the 'substr' function) into the hex line, which the dimmer doesn't accept.
I am not active on this forum anymore.
Edgar
Posts: 24
Joined: Saturday 13 September 2014 23:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands, -6 NAP
Contact:

Re: wifi370 / wifi320 rgb led controller. Anybody?

Post by Edgar »

Maybe call script with separate parameters (script.php param1 param2 etc) and use $argv[1] $argv[2] and so on?

PM send
Only Robinson Crusoe had everything done by Friday
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: wifi370 / wifi320 rgb led controller. Anybody?

Post by ThinkPad »

I managed to get it working with a PHP-script and a HTML-page with a JS colorpicker on it.
See my topic, maybe you can use it.
I am not active on this forum anymore.
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: wifi370 / wifi320 rgb led controller. Anybody?

Post by deennoo »

If there is an esp inside and header can be pût,

Try this firmware i post on h801 device.

This firmware transforme it as a milight bridge+ledstrip contrôler (all in one).
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest