[Plugin now available in Beta] Help with Yeelight Bulb

Moderator: leecollings

superczar
Posts: 65
Joined: Wednesday 14 January 2015 12:08
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: India
Contact:

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

Post by superczar »

Isn't the value for otherdevices_svalues numeric?
In any case, the code is practically as -is from the wiki
User avatar
corbin
Posts: 463
Joined: Saturday 20 August 2016 22:57
Target OS: Windows
Domoticz version: Beta
Location: Brisbane, Australia
Contact:

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

Post by corbin »

see what value is returning for DomValue with "print(DomValue)":

Code: Select all

commandArray = {}
DomDevice = 'White Temp Yeelight';
IP = '192.168.5.14';
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];   
     print(DomValue)
   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
Question about the Xiaomi Gateway in Domoticz? Please check the Wiki first: https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)
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 »

Perhaps it should be -
DomValue = tonumber(otherdevices_svalues[DomDevice])
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
superczar
Posts: 65
Joined: Wednesday 14 January 2015 12:08
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: India
Contact:

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

Post by superczar »

@westcott - Making the change you suggested eliminated the string vs number error
However the dimmer for white temperature control still doesn't work (as in the dimmer is set at 0% and cannot be moved)

Here is the code from the wiki

Code: Select all

 commandArray = {}
DomDevice = 'nameofyourdummyselectorsetasdimmer';
IP = 'youryeelightip';
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 
(have obviously changed the DomDevice Name and bulb IP)

Any idea what could be wrong
airmarshall
Posts: 19
Joined: Friday 04 August 2017 19:21
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

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

Post by airmarshall »

superczar wrote:@westcott - Making the change you suggested eliminated the string vs number error
However the dimmer for white temperature control still doesn't work (as in the dimmer is set at 0% and cannot be moved)

Here is the code from the wiki

Code: Select all

 commandArray = {}
DomDevice = 'nameofyourdummyselectorsetasdimmer';
IP = 'youryeelightip';
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 
(have obviously changed the DomDevice Name and bulb IP)

Any idea what could be wrong
Domoticz does not support dimming for X10 switches.
Create a switch from the hardware/dummy page, edit this switch, make it a dimmer

This allowed me to add a working dimmer slider, however I'm still having an issue setting the "TempValue", still researching but will post back here if I need my own help (which is likely, as I'm an idiot!)
airmarshall
Posts: 19
Joined: Friday 04 August 2017 19:21
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

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

Post by airmarshall »

If it's of use to anyone I managed to fix my issue, which was eventually everything seemingly working with the wiki scripts yet nothing actually happening on the bulb.

I had to remove 'sudo' from the commands, hence:

Code: Select all

runcommandoff = "echo -ne '{\"id\":1,\"method\":\"set_power\", \"params\":[\"off\", \"smooth\", 500]}\\r\\n' | nc -w1 " ..IP.." " ..PORT.."";;
Probably OS specific, I'm running domoticz through a docker on an unraid server.

IS there anyway I can check/test the polling is working? If I switch the light off with the Temp Slider switch OR the Dimmer Switch, the other switch and the RGB Switch never update to being OFF etc....??
Ariz
Posts: 3
Joined: Wednesday 13 September 2017 5:42
Target OS: OS X
Domoticz version:
Contact:

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

Post by Ariz »

Have you set on the lamp app developer mode?

Inviato da Tapatalk



gclub
chrispazz
Posts: 81
Joined: Friday 08 July 2016 10:38
Target OS: -
Domoticz version:
Contact:

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

Post by chrispazz »

Hello. I am havign status update problems too.
If I switch lamp ON or OFF with domoticz, the status if updated correctly.
If I switch the lamp off using the main power switch on the wall, the domoticz status remain ON.

How can I have the domoticz status to reflect the power status?
madrian
Posts: 231
Joined: Saturday 27 August 2016 1:18
Target OS: -
Domoticz version:
Contact:

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

Post by madrian »

I have same question as chrispazz. It is possible to update bulb state if I do a manual (hardware) power cycle?

Second question is: the script from the Wiki is not working right: this script turn Bulb OFF if you set the dimmer to 0% or click on OFF --> this is not working. Is there a fix for this?
madrian
Posts: 231
Joined: Saturday 27 August 2016 1:18
Target OS: -
Domoticz version:
Contact:

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

Post by madrian »

Running manually OFF command:

$ sudo echo -ne '{\"id\":1,\"method\":\"set_power\", \"params\":[\"off\", \"smooth\", 500]}\\r\\n' | nc -w1 192.168.1.82 55443

does nothing. Maybe the api was changed?
Max5962
Posts: 4
Joined: Monday 18 December 2017 22:20
Target OS: -
Domoticz version:
Contact:

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

Post by Max5962 »

This issues still exist !
There is a githup to report it ?
All we need is to mark the bulb as off if it was power off by the wall switch :) thanks
joys
Posts: 6
Joined: Saturday 23 December 2017 10:16
Target OS: Linux
Domoticz version:
Contact:

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

Post by joys »

Hi, I have the same problem. If I switch off from the electric wall switch, the Domoticz report the yeelight is On. Also, if I first switch off yeelight from Domoticz and some second later I switch off wall switch, after few second Domoticz set yeelight to On state.

I explain my scenario better. On the same line, controlled by a wall switch, I have both normal and yeelight bulbs. Actually the wall switch can also be controlled by Domoticz (I've created a switch dummy that runs on / off scripts when triggered). with blocky I created an event that when the wall switch goes off, the two Yeelight lamps are put in off and then the off wall switch script is executed. I entered a delay of 5 seconds in the off script that turns off the line.
madrian
Posts: 231
Joined: Saturday 27 August 2016 1:18
Target OS: -
Domoticz version:
Contact:

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

Post by madrian »

Anyone?
Max5962
Posts: 4
Joined: Monday 18 December 2017 22:20
Target OS: -
Domoticz version:
Contact:

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

Post by Max5962 »

With that bugs the plugins is almost useless for read-only users : for the moment I using it in order to know if I forgot to power off lights :)
Please if the bulb is offline, set the value to OFF :)
User avatar
corbin
Posts: 463
Joined: Saturday 20 August 2016 22:57
Target OS: Windows
Domoticz version: Beta
Location: Brisbane, Australia
Contact:

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

Post by corbin »

anyone volunteer to make the changes to the code?
Question about the Xiaomi Gateway in Domoticz? Please check the Wiki first: https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)
joys
Posts: 6
Joined: Saturday 23 December 2017 10:16
Target OS: Linux
Domoticz version:
Contact:

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

Post by joys »

I found a workaround for my experience. I have set a sleep time of 120sec to my switch off scrip for wall switch relay. So when I switch off the relay from Domoticz, the blocky events power off Yeelight, Domoticz acquire off status of yeelight (thake about 90sec to do it) and finally the line go off.
Max5962
Posts: 4
Joined: Monday 18 December 2017 22:20
Target OS: -
Domoticz version:
Contact:

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

Post by Max5962 »

Thanks for the workaround, but not usefull for me : "read only" (no wall switch connected to domoticz).
Derik
Posts: 1601
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

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

Post by Derik »

Dear All.

Is there perhaps someone that have the "new" app working from the yeelight bulb?
In the old app new how to set the bulb in developermode..
Only i cannot fin this in the new app...

Hope there is some one smarter then myself:-)

thanks
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
Max5962
Posts: 4
Joined: Monday 18 December 2017 22:20
Target OS: -
Domoticz version:
Contact:

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

Post by Max5962 »

I'm developing a lua script in order to update Yeelight device as OFF if there do not respond to ping twice.

EDIT my script works. but if i power on my yeelight ( with wall switch or by the yeelight app ) the state is not updated in the app :(
any one avec the same issues ?

by the way i'm using docker
Boredcat
Posts: 38
Joined: Friday 17 March 2017 9:31
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.9639
Location: Netherlands
Contact:

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

Post by Boredcat »

Derik wrote: Thursday 04 January 2018 11:53 Dear All.

Is there perhaps someone that have the "new" app working from the yeelight bulb?
In the old app new how to set the bulb in developermode..
Only i cannot fin this in the new app...

Hope there is some one smarter then myself:-)

thanks
How to go developermode in the Yeelight app.

Select the light
In the right down corner (Ios App) there is a triangle with a line below, select that.
The you see LAN Beheer (With be named differently in the English app)
Select that and you can enable/dsiable develop mode
RFXCom(E) - Yeelight Lights - KaKu / Alexa HA Bridge
Windows 2012 / Windows 2012R2 / Xpenology/ Pi 3 / Milight / Home build ESP8266 / Sonoff
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests