[Plugin now available in Beta] Help with Yeelight Bulb

Moderator: leecollings

deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: [Plugin now available in Beta] Help with Yeelight Bulb

Post by deennoo »

ok ! white temp for mono is 4000k
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: [Plugin now available in Beta] Help with Yeelight Bulb

Post by deennoo »

Adding a how to run scene for Yeelight Mono/White on the wiki :

https://www.domoticz.com/wiki/Yeelight
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
User avatar
LouiS22
Posts: 433
Joined: Friday 27 February 2015 13:21
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Budapest, Hungary
Contact:

Re: [Plugin now available in Beta] Help with Yeelight Bulb

Post by LouiS22 »

deennoo wrote:ok ! white temp for mono is 4000k
I know that :) But what about RGBW default white?
User avatar
LouiS22
Posts: 433
Joined: Friday 27 February 2015 13:21
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Budapest, Hungary
Contact:

Re: [Plugin now available in Beta] Help with Yeelight Bulb

Post by LouiS22 »

Justinb81 wrote:
LouiS22 wrote:Guys, a quick help needed.

Does anyone know the default color temperature of the RGBW bulb (I mean the one when I first switch it on)? I'd like to compare it with the white only one (which is 4000k). If it's the same, then I could use the white only (cheaper one :D) bulbs in certain places.

Thanks in advance!
You can set your own Default color/temperature that the RGBW bulb uses on startup. It remembers the settings. The White only is really white, and I only use it in hallways ;)
I ordered two of them, will compare it visually. :D At last I could use them in hallways like you did.
User avatar
Westcott
Posts: 423
Joined: Tuesday 09 December 2014 17:04
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: UK - Glos
Contact:

Re: [Plugin now available in Beta] Help with Yeelight Bulb

Post by Westcott »

Hi LouiS22,
I've got 2 RGBs that I use as warning, welcome, and night lights.
They flash different colours depending on the warning.
All controlled from Lua.
Zwave - Sigma Z+ stick, Fibaro, Horstmann, Neo Coolcam, EUROtronic
RFlink - IR detectors and temperatures
Wifi - YeeLights, ESP32s, Anoop sockets
Zigbee - lots with zigbee2mqtt and ZbBridge
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: RE: Re: [Plugin now available in Beta] Help with Yeelight Bulb

Post by deennoo »

Westcott wrote:Hi LouiS22,
I've got 2 RGBs that I use as warning, welcome, and night lights.
They flash different colours depending on the warning.
All controlled from Lua.
Your welcome to update the wiki if you got some cool feature scene with your yeelight rgbw,
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
bertbigb
Posts: 147
Joined: Thursday 13 August 2015 13:36
Target OS: NAS (Synology & others)
Domoticz version: beta
Location: Netherlands
Contact:

Re: Help with Yeelight Bulb

Post by bertbigb »

Derik wrote:dear...
Looks the Yeelight is killing my Domoticz....
When i remove the light in my lan domoticz is crashing....
And it is turning in to a loop of crashes.

Yeelight hardware off, domoticz stable...

I'm still having problems with that. (on Raspberry and Synology) I have my Yeeligght bulbs connected via DHCP. That could mean that they have a different ip every day. I can't bind them over a mac address since my router doesn't support that (max 10 bindings) and I have 12 bulbs and some other stuff what needs a fixed ip. This also means I have new hardware every day when the ip has changed and existing hardware (since the ip is not connected anymore) does no longer exist. This causes every day a system hang up. Is there a possibility to connect to the yeelights with help of the mac address?

Hope you can do something for me. For the rest I like the lights and the interface to Domoticz very much!! Thanks for all the efforts you put in it.
Best regards Bert

Synology DS1517+ - DSM 6.2
Raspberry PI2-B, Raspberry Nano - Raspberry PI3 - model B
Xiaomi Gateway - Philips HUE Lights - Zwave - RFXCom(E) with KaKu and other 433MHz devices - Yeelight Lights - Toon
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: [Plugin now available in Beta] Help with Yeelight Bulb

Post by deennoo »

Juste change your router for a Real one and remove your toy
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
User avatar
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

Post by corbin »

bertbigb wrote:Is there a possibility to connect to the yeelights with help of the mac address?
It was originally coded based on the hardware address of the light, but we changed to storing the IP address as it works better with Domoticz that way. It is better to have static IPs so that scripts can address the lights as well. I think your best solution is to get another router as suggested by deennoo.
Question about the Xiaomi Gateway in Domoticz? Please check the Wiki first: https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)
bertbigb
Posts: 147
Joined: Thursday 13 August 2015 13:36
Target OS: NAS (Synology & others)
Domoticz version: beta
Location: Netherlands
Contact:

Re: Help with Yeelight Bulb

Post by bertbigb »

corbin wrote:
bertbigb wrote:Is there a possibility to connect to the yeelights with help of the mac address?
It was originally coded based on the hardware address of the light, but we changed to storing the IP address as it works better with Domoticz that way. It is better to have static IPs so that scripts can address the lights as well. I think your best solution is to get another router as suggested by deennoo.
Thanks for your answer, I will invest in a new one :-)
Best regards Bert

Synology DS1517+ - DSM 6.2
Raspberry PI2-B, Raspberry Nano - Raspberry PI3 - model B
Xiaomi Gateway - Philips HUE Lights - Zwave - RFXCom(E) with KaKu and other 433MHz devices - Yeelight Lights - Toon
hekm77
Posts: 45
Joined: Thursday 09 February 2017 18:31
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: [Plugin now available in Beta] Help with Yeelight Bulb

Post by hekm77 »

deennoo, thanks for your job.
1. I added dummy selector switch 'Test' and set it as a dimmer on switch page.
2. I created LUA script from the Wikis example.
Spoiler: show

Code: Select all

commandArray = {}
DomDevice = 'Test';
IP = '192.168.0.24';
PORT = '55443'
 
if devicechanged[DomDevice] then
   if(devicechanged[DomDevice]=='Off') then 
     DomValue = 0;
     runcommandoff = "sudo echo -ne '{\"id\":1,\"method\":\"set_power\", \"params\":[\"off\", \"smooth\", 500]}\\r\\n' | nc -w1 " ..IP.." " ..PORT.."";;
     os.execute(runcommandoff);
   else
     DomValue = otherdevices_svalues[DomDevice];   
   CalcValue = ((DomValue-1) * 48)+1700;
   end
   if CalcValue==nil then CalcValue=0 end
     runcommand = " sudo echo -ne '{\"id\":1, \"method\":\"set_scene\",\"params\":[\"ct\"," .. CalcValue .. ", 75]}\\r\\n' | nc -w1 " ..IP.." " ..PORT.."";
   os.execute(runcommand);
   print(runcommand)
   print("Color Temp= "..CalcValue);
end
return commandArray
But I have an error in the log.

Code: Select all

2017-02-11 09:34:03.300  Error: EventSystem: in Test: [string "commandArray = {}..."]:6: attempt to index global 'devicechanged' (a nil value)
Can you help me?
User avatar
LouiS22
Posts: 433
Joined: Friday 27 February 2015 13:21
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Budapest, Hungary
Contact:

Re: [Plugin now available in Beta] Help with Yeelight Bulb

Post by LouiS22 »

hekm77 wrote:deennoo, thanks for your job.
1. I added dummy selector switch 'Test' and set it as a dimmer on switch page.
2. I created LUA script from the Wikis example.
Spoiler: show

Code: Select all

commandArray = {}
DomDevice = 'Test';
IP = '192.168.0.24';
PORT = '55443'
 
if devicechanged[DomDevice] then
   if(devicechanged[DomDevice]=='Off') then 
     DomValue = 0;
     runcommandoff = "sudo echo -ne '{\"id\":1,\"method\":\"set_power\", \"params\":[\"off\", \"smooth\", 500]}\\r\\n' | nc -w1 " ..IP.." " ..PORT.."";;
     os.execute(runcommandoff);
   else
     DomValue = otherdevices_svalues[DomDevice];   
   CalcValue = ((DomValue-1) * 48)+1700;
   end
   if CalcValue==nil then CalcValue=0 end
     runcommand = " sudo echo -ne '{\"id\":1, \"method\":\"set_scene\",\"params\":[\"ct\"," .. CalcValue .. ", 75]}\\r\\n' | nc -w1 " ..IP.." " ..PORT.."";
   os.execute(runcommand);
   print(runcommand)
   print("Color Temp= "..CalcValue);
end
return commandArray
But I have an error in the log.

Code: Select all

2017-02-11 09:34:03.300  Error: EventSystem: in Test: [string "commandArray = {}..."]:6: attempt to index global 'devicechanged' (a nil value)
Can you help me?
Have you changed the ip and the port to yours?
hekm77
Posts: 45
Joined: Thursday 09 February 2017 18:31
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: [Plugin now available in Beta] Help with Yeelight Bulb

Post by hekm77 »

LouiS22 wrote:Have you changed the ip and the port to yours?
Yes, of course. In the script my IP and Port.
I can change the White Teperature, but have an error in the log.
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: RE: Re: [Plugin now available in Beta] Help with Yeelight Bulb

Post by deennoo »

hekm77 wrote:deennoo, thanks for your job.
1. I added dummy selector switch 'Test' and set it as a dimmer on switch page.
2. I created LUA script from the Wikis example.
Spoiler: show

Code: Select all

commandArray = {}
DomDevice = 'Test';
IP = '192.168.0.24';
PORT = '55443'
 
if devicechanged[DomDevice] then
   if(devicechanged[DomDevice]=='Off') then 
     DomValue = 0;
     runcommandoff = "sudo echo -ne '{\"id\":1,\"method\":\"set_power\", \"params\":[\"off\", \"smooth\", 500]}\\r\\n' | nc -w1 " ..IP.." " ..PORT.."";;
     os.execute(runcommandoff);
   else
     DomValue = otherdevices_svalues[DomDevice];   
   CalcValue = ((DomValue-1) * 48)+1700;
   end
   if CalcValue==nil then CalcValue=0 end
     runcommand = " sudo echo -ne '{\"id\":1, \"method\":\"set_scene\",\"params\":[\"ct\"," .. CalcValue .. ", 75]}\\r\\n' | nc -w1 " ..IP.." " ..PORT.."";
   os.execute(runcommand);
   print(runcommand)
   print("Color Temp= "..CalcValue);
end
return commandArray
But I have an error in the log.

Code: Select all

2017-02-11 09:34:03.300  Error: EventSystem: in Test: [string "commandArray = {}..."]:6: attempt to index global 'devicechanged' (a nil value)
Can you help me?
yes i can help, you didn't read all the wiki...

Have you change the lua script Type to "device" from "all" ?
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
hekm77
Posts: 45
Joined: Thursday 09 February 2017 18:31
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: RE: Re: [Plugin now available in Beta] Help with Yeelight Bulb

Post by hekm77 »

deennoo wrote: Have you change the lua script Type to "device" from "all" ?
You're a magician. Thank you.
Sorry, English is not my language.
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: [Plugin now available in Beta] Help with Yeelight Bulb

Post by deennoo »

Mine not too
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
rtenklooster
Posts: 36
Joined: Tuesday 23 December 2014 16:20
Target OS: Linux
Domoticz version:
Contact:

Re: [Plugin now available in Beta] Help with Yeelight Bulb

Post by rtenklooster »

Hi,
I've enabled the yeelight controller. The log files shows:

Code: Select all

2017-02-19 17:57:12.198 YeeLight: New Light Found (192.168.10.7/YeeLight LED (Color))
For some reason the led light is not listed under my devices.

I've added a bulb manually, but that's not listed under devices aswell.
I've removed the controller, added it again.. still the same problem.

Updated to the latest beta, still not listed under devices. Am i missing something?
User avatar
LouiS22
Posts: 433
Joined: Friday 27 February 2015 13:21
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Budapest, Hungary
Contact:

Re: [Plugin now available in Beta] Help with Yeelight Bulb

Post by LouiS22 »

Is it possible to control groups (for ex: 4 bulbs simultaneously) with the script posted on domoticz wiki?
bertbigb
Posts: 147
Joined: Thursday 13 August 2015 13:36
Target OS: NAS (Synology & others)
Domoticz version: beta
Location: Netherlands
Contact:

Re: [Plugin now available in Beta] Help with Yeelight Bulb

Post by bertbigb »

rtenklooster wrote:Hi,
I've enabled the yeelight controller. The log files shows:

Code: Select all

2017-02-19 17:57:12.198 YeeLight: New Light Found (192.168.10.7/YeeLight LED (Color))
For some reason the led light is not listed under my devices.

I've added a bulb manually, but that's not listed under devices aswell.
I've removed the controller, added it again.. still the same problem.

Updated to the latest beta, still not listed under devices. Am i missing something?
I struggled with the same in the begining. The solution was simple as the wiki stated: You first need to enable developer mode on your bulbs through the Yeelight Android or iOS App
Best regards Bert

Synology DS1517+ - DSM 6.2
Raspberry PI2-B, Raspberry Nano - Raspberry PI3 - model B
Xiaomi Gateway - Philips HUE Lights - Zwave - RFXCom(E) with KaKu and other 433MHz devices - Yeelight Lights - Toon
bertbigb
Posts: 147
Joined: Thursday 13 August 2015 13:36
Target OS: NAS (Synology & others)
Domoticz version: beta
Location: Netherlands
Contact:

Re: [Plugin now available in Beta] Help with Yeelight Bulb

Post by bertbigb »

LouiS22 wrote:Is it possible to control groups (for ex: 4 bulbs simultaneously) with the script posted on domoticz wiki?
I do that with something like:

Code: Select all

--YEELIGHT
    -- port number for the yeelights
    PORT = '55443'
    --IP adresses of the bulbs involved, 
    local IPs = {'192.168.2.80', '192.168.2.81', '192.168.2.82', '192.168.2.83', '192.168.2.84', '192.168.2.85'}
    
	function YeelightOff()
		--command Yeelight Off
		for n,IP in pairs(IPs) do
			runcommandYeelight = "sudo echo -ne '{\"id\":"..n..",\"method\":\"set_power\", \"params\":[\"off\", \"smooth\", 500]}\\r\\n' | /opt/bin/nc -w1 " ..IP.." " ..PORT.."";
			os.execute(runcommandYeelight)
		end
    end	
    
    
	function YeelightTemperature(WhiteYee, DimYee, DurationYee)
		--Yeelight part
		for n,IP in pairs(IPs) do
		    --runcommandYeelight = "sudo echo -ne '{\"id\":1,\"method\":\"set_scene\",\"params\":[\"ct\", " .. WhiteYee .. "," .. DimYee .. "]}\\r\\n' | nc -w1 " ..IP.." " ..PORT.."";
			--runcommandYeelight = "sudo echo -ne '{\"id\":1,\"method\":\"set_ct_abx\",\"params\":[" .. WhiteYee .. ",\"smooth\","..DurationYee.."]}\\r\\n' | nc -w1 " ..IP.." " ..PORT.."";
			runcommandYeelight ="sudo echo -ne '{\"id\":"..n..",\"method\":\"start_cf\",\"params\":[1,1,\"" ..DurationYee..",2,"..WhiteYee..","..DimYee.."\"]}\\r\\n' | /opt/bin/nc -w1 " ..IP.." " ..PORT.."";
			if debug then print(runcommandYeelight) end
			os.execute(runcommandYeelight)
		end
	end	
Then you call such a function like:
YeelightOff() or something like YeelightTemperature(WhiteYeeValue, DimYeeValue, DurationYeeValue)

The function will run for all IP's in the list IPs
Hope this helps you.
If you want i can share the complete scripts if that is more helpful
Best regards Bert

Synology DS1517+ - DSM 6.2
Raspberry PI2-B, Raspberry Nano - Raspberry PI3 - model B
Xiaomi Gateway - Philips HUE Lights - Zwave - RFXCom(E) with KaKu and other 433MHz devices - Yeelight Lights - Toon
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest