[Plugin now available in Beta] Help with Yeelight Bulb
Moderator: leecollings
-
- Posts: 34
- Joined: Friday 19 August 2016 5:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
[Plugin now available in Beta] Help with Yeelight Bulb
hi,
i'm barely new here, so bare with me.
can anyone helps with integrating Yeelight bulbs with domoticz.
i can already control the bulb, but i got no idea how to get its status on domoticz.
attached below is the official documentation of the bulbs
https://www.yeelight.com/en_US/developer
thanks
i'm barely new here, so bare with me.
can anyone helps with integrating Yeelight bulbs with domoticz.
i can already control the bulb, but i got no idea how to get its status on domoticz.
attached below is the official documentation of the bulbs
https://www.yeelight.com/en_US/developer
thanks
Last edited by farhanito on Friday 21 October 2016 10:18, edited 1 time in total.
- corbin
- Posts: 463
- Joined: Saturday 20 August 2016 22:57
- Target OS: Windows
- Domoticz version: Beta
- Location: Brisbane, Australia
- Contact:
Re: Help with Yeelight Bulb
Hi, How are you controlling the bulb now, is it through the Yeelight app?
Regards,
Corbin
Regards,
Corbin
Question about the Xiaomi Gateway in Domoticz? Please check the Wiki first: https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: Help with Yeelight Bulb
is this compatible with a supported hardware???? { Order i 1 ]
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
- corbin
- Posts: 463
- Joined: Saturday 20 August 2016 22:57
- Target OS: Windows
- Domoticz version: Beta
- Location: Brisbane, Australia
- Contact:
Re: Help with Yeelight Bulb
Not yet, but they look to be easy to control from the linked pdf.
Question about the Xiaomi Gateway in Domoticz? Please check the Wiki first: https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)
-
- Posts: 34
- Joined: Friday 19 August 2016 5:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Help with Yeelight Bulb
Hi,corbin wrote:Hi, How are you controlling the bulb now, is it through the Yeelight app?
Regards,
Corbin
Currently by sending proper json message using Bash,
Code: Select all
printf "{json message}\r\n" > /dev/tcp/[bulb IP]/[port]
- corbin
- Posts: 463
- Joined: Saturday 20 August 2016 22:57
- Target OS: Windows
- Domoticz version: Beta
- Location: Brisbane, Australia
- Contact:
Re: Help with Yeelight Bulb
Well I've ordered some of these bulbs, and hope to get them working with Domoticz - will update with my findings.
Question about the Xiaomi Gateway in Domoticz? Please check the Wiki first: https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)
- corbin
- Posts: 463
- Joined: Saturday 20 August 2016 22:57
- Target OS: Windows
- Domoticz version: Beta
- Location: Brisbane, Australia
- Contact:
Re: Help with Yeelight Bulb
Hi farhanito,
My lights have arrived, and like you I was able to control them through sending commands.
To get the light status, I have used a lua script to send {"id":1,"method\":"get_prop","params":["power"]}\r\n to the light and then inspect the result. This works ok but only polls once a minute.
Can I ask why you want to get the status? for my setup I can't see a need - the switch on and off is ok.
regards,
Corbin
My lights have arrived, and like you I was able to control them through sending commands.
To get the light status, I have used a lua script to send {"id":1,"method\":"get_prop","params":["power"]}\r\n to the light and then inspect the result. This works ok but only polls once a minute.
Can I ask why you want to get the status? for my setup I can't see a need - the switch on and off is ok.
regards,
Corbin
Question about the Xiaomi Gateway in Domoticz? Please check the Wiki first: https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: Help with Yeelight Bulb
Perhaps some create a wiki... ...
Looks promising...
Looks promising...
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
-
- Posts: 34
- Joined: Friday 19 August 2016 5:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Help with Yeelight Bulb
Well i guess it's the advantage of having a wifi bulb instead of IR/RF controlled switch. We can make sure our commands work, especially when you are not home.corbin wrote:
Can I ask why you want to get the status? for my setup I can't see a need - the switch on and off is ok.
regards,
Corbin
Anyway, according to the spec...
I wonder if we can make domoticz listen to this advertisement, instead of polling the bulb status every minutes.Right after Yeelight smart LED joined the local network, it will announce its presence by
multi-casting a advertisement requests. The purpose of this message is to notify 3rd party
devices that smart LED is online and ready to serve control request. Without this
advertisement message, 3rd party devices would have to probe the network from time to
time in order to achieve PnP (plug and play), which is obviously power-consuming and
inefficient.
- corbin
- Posts: 463
- Joined: Saturday 20 August 2016 22:57
- Target OS: Windows
- Domoticz version: Beta
- Location: Brisbane, Australia
- Contact:
Re: Help with Yeelight Bulb
I see, would be useful in Domoticz, as it is I use the Yeelight app to know the status remotely.farhanito wrote:
Well i guess it's the advantage of having a wifi bulb instead of IR/RF controlled switch. We can make sure our commands work, especially when you are not home.
I think this could be done as a hardware plugin - https://www.domoticz.com/wiki/Developin ... are_plugin which is beyond my abilities at present.farhanito wrote: I wonder if we can make domoticz listen to this advertisement, instead of polling the bulb status every minutes.
Question about the Xiaomi Gateway in Domoticz? Please check the Wiki first: https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)
-
- Posts: 34
- Joined: Friday 19 August 2016 5:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Help with Yeelight Bulb
Yes. The app itself is not bad at all. it even have a tasker plugin built-in.
Great bulb.
Thanks
Great bulb.
Thanks
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: Help with Yeelight Bulb
got the light...
Some have a api / script or something..
Working in Domoticz?
Some have a api / script or something..
Working in Domoticz?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
-
- Posts: 13
- Joined: Friday 09 September 2016 18:29
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Help with Yeelight Bulb
Any progress with this amazing bulb? I mean damn, it is so good! And the api is there.. I wish I had the skill to create a hardware for this in domoticz.
So far I am using it with tasker and that works very well. Only thing that could make it better is well.. It working with Domoticz
So far I am using it with tasker and that works very well. Only thing that could make it better is well.. It working with Domoticz
-
- Posts: 1601
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: Help with Yeelight Bulb
mmm ask yeelight for some help...
Get a answer:
Only i do not ubderstand the ssdp protocol? Working with putty?
Or how do i send the request.
some one understand this..?
Get a answer:
Code: Select all
The API is not HTTP based, which means you can't just send a http request to the bulb and control it.
Basically, the automation procedure includes two parts:
1. Dynamic discover.
2. Control and monitor.
The dynamic discover used a SSDP like protocol. You can send a multi-cast requust to local network and will get response from bulbs. The request and response are encoded in HTTP format but are transferred through UDP.
After discovering the bulb, you can establish a TCP connection to the bulb and control and monitor the bulb through control requests which is encoded in JSON.
This is the search response, the location will tell you the IP and port the bulb is listening, you should establish a TCP socket to this location and then send command through that socket.
HTTP/1.1 200 OK
Cache-Control: max-age=3600
Date:
Ext:
Location: yeelight://192.168.1.239:55443
Server: POSIX UPnP/1.0 YGLC/1
id: 0x000000000015243f
model: color
fw_ver: 18
support: get_prop set_default set_power toggle set_bright start_cf stop_cf set_scene
cron_add cron_get cron_del set_ct_abx set_rgb a
power: on
bright: 100
color_mode: 2
ct: 4000
rgb: 16711680
hue: 100
sat: 35
name: my_bulb
This is the control request encoded in JSON which is used to turn on the bulb.
{"id":1,"method":"set_power","params":["on", "smooth", 500]}
Or how do i send the request.
some one understand this..?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
-
- Posts: 13
- Joined: Friday 09 September 2016 18:29
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Help with Yeelight Bulb
Hello Corbin, how are your bulbs working?corbin wrote:Hi farhanito,
My lights have arrived, and like you I was able to control them through sending commands.
To get the light status, I have used a lua script to send {"id":1,"method\":"get_prop","params":["power"]}\r\n to the light and then inspect the result. This works ok but only polls once a minute.
Can I ask why you want to get the status? for my setup I can't see a need - the switch on and off is ok.
regards,
Corbin
I am very new to all this and understand some of lua. How would I by LUA replicate the "Sunrise" and "Sunset" scene from the app?
{"id":1,"method":"set_scene", "params": ["hsv", 300, 70, 100]} ?
Thanks
- corbin
- Posts: 463
- Joined: Saturday 20 August 2016 22:57
- Target OS: Windows
- Domoticz version: Beta
- Location: Brisbane, Australia
- Contact:
Re: Help with Yeelight Bulb
Hi TwoEasy,TwoEasy wrote:
Hello Corbin, how are your bulbs working?
I am very new to all this and understand some of lua. How would I by LUA replicate the "Sunrise" and "Sunset" scene from the app?
{"id":1,"method":"set_scene", "params": ["hsv", 300, 70, 100]} ?
Thanks
The bulbs are excellent, really impressed with the hardware quality, and the software and API.
To control the bulbs from lua, I used a console application I wrote in C# to send the actual commands (I'm running on Windows). I think you could do it natively in lua if you can use the socket library - viewtopic.php?t=3676
I'm also attempting to write a hardware plugin in C++, so that may be available some time in the future. I've got it to do the UDP broadcast to detect Yeelights on the network at this stage.
Question about the Xiaomi Gateway in Domoticz? Please check the Wiki first: https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)
-
- Posts: 13
- Joined: Friday 09 September 2016 18:29
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Help with Yeelight Bulb
corbin wrote:Hi TwoEasy,TwoEasy wrote:
Hello Corbin, how are your bulbs working?
I am very new to all this and understand some of lua. How would I by LUA replicate the "Sunrise" and "Sunset" scene from the app?
{"id":1,"method":"set_scene", "params": ["hsv", 300, 70, 100]} ?
Thanks
The bulbs are excellent, really impressed with the hardware quality, and the software and API.
To control the bulbs from lua, I used a console application I wrote in C# to send the actual commands (I'm running on Windows). I think you could do it natively in lua if you can use the socket library - viewtopic.php?t=3676
I'm also attempting to write a hardware plugin in C++, so that may be available some time in the future. I've got it to do the UDP broadcast to detect Yeelights on the network at this stage.
Thanks very much for your reply! I dont fully understand what the lua socket is. Would it be possible to send a command from within domoticz by calling a lua script?
- corbin
- Posts: 463
- Joined: Saturday 20 August 2016 22:57
- Target OS: Windows
- Domoticz version: Beta
- Location: Brisbane, Australia
- Contact:
Re: Help with Yeelight Bulb
You need a way to send the commands over TCP, and I don't think that is possible with the lua setup that comes with Domoticz. So you will need to add this capability someway. Once you have that capability, then yes you could initiate the command from a lua script.
I think another way would be to call a bash script as farhanito showed above, using the lua os.execute command. Or using python, there is an example available on the yeelight website.
I think another way would be to call a bash script as farhanito showed above, using the lua os.execute command. Or using python, there is an example available on the yeelight website.
Question about the Xiaomi Gateway in Domoticz? Please check the Wiki first: https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)
- corbin
- Posts: 463
- Joined: Saturday 20 August 2016 22:57
- Target OS: Windows
- Domoticz version: Beta
- Location: Brisbane, Australia
- Contact:
Re: Help with Yeelight Bulb
Are you able to run a command like this?Derik wrote: Only i do not ubderstand the ssdp protocol? Working with putty?
Or how do i send the request.
some one understand this..?
Code: Select all
printf '{"id":1,"method":"toggle","params":[]}\r\n' > /dev/tcp/192.168.0.2/55443
Question about the Xiaomi Gateway in Domoticz? Please check the Wiki first: https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)
-
- Posts: 13
- Joined: Friday 09 September 2016 18:29
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Help with Yeelight Bulb
Thanks for your information, pointing me in the right direction I will see what I can do, I am not at my homeautomation base at the moment to experiment..corbin wrote:You need a way to send the commands over TCP, and I don't think that is possible with the lua setup that comes with Domoticz. So you will need to add this capability someway. Once you have that capability, then yes you could initiate the command from a lua script.
I think another way would be to call a bash script as farhanito showed above, using the lua os.execute command. Or using python, there is an example available on the yeelight website.
Also looking forward to a possible plugin
Who is online
Users browsing this forum: No registered users and 1 guest