Page 14 of 18

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

Posted: Tuesday 07 February 2017 11:09
by deennoo
ok ! white temp for mono is 4000k

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

Posted: Tuesday 07 February 2017 11:10
by deennoo
Adding a how to run scene for Yeelight Mono/White on the wiki :

https://www.domoticz.com/wiki/Yeelight

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

Posted: Tuesday 07 February 2017 11:16
by LouiS22
deennoo wrote:ok ! white temp for mono is 4000k
I know that :) But what about RGBW default white?

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

Posted: Tuesday 07 February 2017 16:16
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.

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

Posted: Tuesday 07 February 2017 19:15
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.

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

Posted: Tuesday 07 February 2017 20:20
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,

Re: Help with Yeelight Bulb

Posted: Thursday 09 February 2017 7:21
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.

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

Posted: Thursday 09 February 2017 7:38
by deennoo
Juste change your router for a Real one and remove your toy

Re: Help with Yeelight Bulb

Posted: Friday 10 February 2017 10:11
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.

Re: Help with Yeelight Bulb

Posted: Friday 10 February 2017 11:30
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 :-)

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

Posted: Saturday 11 February 2017 9:40
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?

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

Posted: Saturday 11 February 2017 9:50
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?

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

Posted: Saturday 11 February 2017 10:01
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.

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

Posted: Saturday 11 February 2017 13:25
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" ?

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

Posted: Saturday 11 February 2017 14:00
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.

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

Posted: Saturday 11 February 2017 14:05
by deennoo
Mine not too

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

Posted: Sunday 19 February 2017 18:01
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?

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

Posted: Sunday 19 February 2017 19:58
by LouiS22
Is it possible to control groups (for ex: 4 bulbs simultaneously) with the script posted on domoticz wiki?

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

Posted: Sunday 19 February 2017 20:10
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

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

Posted: Sunday 19 February 2017 20:17
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