[Plugin now available in Beta] Help with Yeelight Bulb

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

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

Post by deennoo » Tuesday 07 February 2017 12:09

ok ! white temp for mono is 4000k
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / ESP8266 / MQTT / BLE
http://domo-attitude.fr

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

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

Post by deennoo » Tuesday 07 February 2017 12:10

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 / ESP8266 / MQTT / BLE
http://domo-attitude.fr

User avatar
LouiS22
Posts: 401
Joined: Friday 27 February 2015 14:21
Target OS: Raspberry Pi
Domoticz version: beta
Location: Budapest, Hungary
Contact:

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

Post by LouiS22 » Tuesday 07 February 2017 12:16

deennoo wrote:ok ! white temp for mono is 4000k
I know that :) But what about RGBW default white?

User avatar
LouiS22
Posts: 401
Joined: Friday 27 February 2015 14:21
Target OS: Raspberry Pi
Domoticz version: beta
Location: Budapest, Hungary
Contact:

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

Post by LouiS22 » Tuesday 07 February 2017 17:16

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: 535
Joined: Tuesday 09 December 2014 18:04
Target OS: Raspberry Pi
Domoticz version: Beta
Location: UK - Glos
Contact:

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

Post by Westcott » Tuesday 07 February 2017 20:15

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 2x FGSD002, FGMS001, Horstmann - 2x HRT4, 2x C-stat-11,
4x ASR-ZW, Aeon Micro Switch, 2x TKB TZ68E
Max-EQ Cube, Valve
RFXtrx433E, RFlink - 1byone driveway, doorbell, Oregon and BangGood temp
Wifi - YeeLight RGB, 3x ESP8266

deennoo
Posts: 900
Joined: Wednesday 10 December 2014 14: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 » Tuesday 07 February 2017 21:20

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 / ESP8266 / MQTT / BLE
http://domo-attitude.fr

bertbigb
Posts: 136
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 » Thursday 09 February 2017 8:21

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 DS1515+ - DSM 6.1
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: 900
Joined: Wednesday 10 December 2014 14:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

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

Post by deennoo » Thursday 09 February 2017 8:38

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 / ESP8266 / MQTT / BLE
http://domo-attitude.fr

User avatar
corbin
Posts: 498
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 » Friday 10 February 2017 11:11

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: 136
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 » Friday 10 February 2017 12:30

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 DS1515+ - DSM 6.1
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: 35
Joined: Thursday 09 February 2017 19:31
Target OS: Raspberry Pi
Domoticz version: v3.8153
Contact:

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

Post by hekm77 » Saturday 11 February 2017 10:40

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: 401
Joined: Friday 27 February 2015 14:21
Target OS: Raspberry Pi
Domoticz version: beta
Location: Budapest, Hungary
Contact:

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

Post by LouiS22 » Saturday 11 February 2017 10:50

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: 35
Joined: Thursday 09 February 2017 19:31
Target OS: Raspberry Pi
Domoticz version: v3.8153
Contact:

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

Post by hekm77 » Saturday 11 February 2017 11:01

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: 900
Joined: Wednesday 10 December 2014 14: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 » Saturday 11 February 2017 14:25

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 / ESP8266 / MQTT / BLE
http://domo-attitude.fr

hekm77
Posts: 35
Joined: Thursday 09 February 2017 19:31
Target OS: Raspberry Pi
Domoticz version: v3.8153
Contact:

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

Post by hekm77 » Saturday 11 February 2017 15:00

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: 900
Joined: Wednesday 10 December 2014 14:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

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

Post by deennoo » Saturday 11 February 2017 15:05

Mine not too
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / ESP8266 / MQTT / BLE
http://domo-attitude.fr

rtenklooster
Posts: 44
Joined: Tuesday 23 December 2014 17:20
Target OS: Linux
Domoticz version:
Contact:

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

Post by rtenklooster » Sunday 19 February 2017 19:01

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: 401
Joined: Friday 27 February 2015 14:21
Target OS: Raspberry Pi
Domoticz version: beta
Location: Budapest, Hungary
Contact:

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

Post by LouiS22 » Sunday 19 February 2017 20:58

Is it possible to control groups (for ex: 4 bulbs simultaneously) with the script posted on domoticz wiki?

bertbigb
Posts: 136
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 » Sunday 19 February 2017 21:10

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 DS1515+ - DSM 6.1
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: 136
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 » Sunday 19 February 2017 21:17

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 DS1515+ - DSM 6.1
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: No registered users and 4 guests