[Plugin now available in Beta] Help with Yeelight Bulb

superczar
Posts: 90
Joined: Wednesday 14 January 2015 13:08
Target OS: Raspberry Pi
Domoticz version:
Location: India
Contact:

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

Post by superczar » Tuesday 06 June 2017 11:14

Isn't the value for otherdevices_svalues numeric?
In any case, the code is practically as -is from the wiki

User avatar
corbin
Posts: 513
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 » Tuesday 06 June 2017 18:05

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: 548
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 06 June 2017 18:20

Perhaps it should be -
DomValue = tonumber(otherdevices_svalues[DomDevice])
Zwave - Sigma Z+ stick, Fibaro 2x FGSD002, FGMS001
Horstmann - 2x HRT4, 2x C-stat-11, 4x ASR-ZW, TKB 2x TZ56, 2x TZ68E
Max-EQ Cube, Valve, Neo 2x door
RFXtrx433E, RFlink - 1byone driveway, doorbell, Oregon and BangGood temp
Wifi - YeeLight RGB, 3x ESP8266

superczar
Posts: 90
Joined: Wednesday 14 January 2015 13:08
Target OS: Raspberry Pi
Domoticz version:
Location: India
Contact:

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

Post by superczar » Thursday 08 June 2017 9:06

@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: 17
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 » Friday 04 August 2017 19:26

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: 17
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 » Saturday 05 August 2017 23:43

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 » Thursday 21 September 2017 6:15

Have you set on the lamp app developer mode?

Inviato da Tapatalk



gclub

chrispazz
Posts: 62
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 » Sunday 29 October 2017 23:30

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: 239
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 » Wednesday 13 December 2017 1:31

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: 239
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 » Wednesday 13 December 2017 1:35

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 23:20
Target OS: -
Domoticz version:
Contact:

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

Post by Max5962 » Monday 18 December 2017 23:26

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: 5
Joined: Saturday 23 December 2017 11:16
Target OS: Raspberry Pi
Domoticz version:
Contact:

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

Post by joys » Saturday 23 December 2017 11:24

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: 239
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 » Saturday 23 December 2017 22:23

Anyone?

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

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

Post by Max5962 » Sunday 24 December 2017 0:31

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: 513
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 » Sunday 24 December 2017 0:36

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: 5
Joined: Saturday 23 December 2017 11:16
Target OS: Raspberry Pi
Domoticz version:
Contact:

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

Post by joys » Wednesday 27 December 2017 23:08

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 23:20
Target OS: -
Domoticz version:
Contact:

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

Post by Max5962 » Thursday 28 December 2017 22:02

Thanks for the workaround, but not usefull for me : "read only" (no wall switch connected to domoticz).

User avatar
Derik
Posts: 2115
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

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

Post by Derik » Thursday 04 January 2018 12: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
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 23:20
Target OS: -
Domoticz version:
Contact:

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

Post by Max5962 » Friday 05 January 2018 18:38

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: 30
Joined: Friday 17 March 2017 10:31
Target OS: Raspberry Pi
Domoticz version: 3.9639
Location: Netherlands
Contact:

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

Post by Boredcat » Saturday 06 January 2018 10:40

Derik wrote:
Thursday 04 January 2018 12: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 2 guests