Page 17 of 18
Re: [Plugin now available in Beta] Help with Yeelight Bulb
Posted: Tuesday 06 June 2017 11:14
by superczar
Isn't the value for otherdevices_svalues numeric?
In any case, the code is practically as -is from the wiki
Re: [Plugin now available in Beta] Help with Yeelight Bulb
Posted: Tuesday 06 June 2017 18:05
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
Re: [Plugin now available in Beta] Help with Yeelight Bulb
Posted: Tuesday 06 June 2017 18:20
by Westcott
Perhaps it should be -
DomValue = tonumber(otherdevices_svalues[DomDevice])
Re: [Plugin now available in Beta] Help with Yeelight Bulb
Posted: Thursday 08 June 2017 9:06
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
Re: [Plugin now available in Beta] Help with Yeelight Bulb
Posted: Friday 04 August 2017 19:26
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!)
Re: [Plugin now available in Beta] Help with Yeelight Bulb
Posted: Saturday 05 August 2017 23:43
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....??
Re: [Plugin now available in Beta] Help with Yeelight Bulb
Posted: Thursday 21 September 2017 6:15
by Ariz
Have you set on the lamp app developer mode?
Inviato da Tapatalk
gclub
Re: [Plugin now available in Beta] Help with Yeelight Bulb
Posted: Sunday 29 October 2017 22:30
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?
Re: [Plugin now available in Beta] Help with Yeelight Bulb
Posted: Wednesday 13 December 2017 0:31
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?
Re: [Plugin now available in Beta] Help with Yeelight Bulb
Posted: Wednesday 13 December 2017 0:35
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?
Re: [Plugin now available in Beta] Help with Yeelight Bulb
Posted: Monday 18 December 2017 22:26
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
Re: [Plugin now available in Beta] Help with Yeelight Bulb
Posted: Saturday 23 December 2017 10:24
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.
Re: [Plugin now available in Beta] Help with Yeelight Bulb
Posted: Saturday 23 December 2017 21:23
by madrian
Anyone?
Re: [Plugin now available in Beta] Help with Yeelight Bulb
Posted: Saturday 23 December 2017 23:31
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
Re: [Plugin now available in Beta] Help with Yeelight Bulb
Posted: Saturday 23 December 2017 23:36
by corbin
anyone volunteer to make the changes to the code?
Re: [Plugin now available in Beta] Help with Yeelight Bulb
Posted: Wednesday 27 December 2017 22:08
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.
Re: [Plugin now available in Beta] Help with Yeelight Bulb
Posted: Thursday 28 December 2017 21:02
by Max5962
Thanks for the workaround, but not usefull for me : "read only" (no wall switch connected to domoticz).
Re: [Plugin now available in Beta] Help with Yeelight Bulb
Posted: Thursday 04 January 2018 11:53
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
Re: [Plugin now available in Beta] Help with Yeelight Bulb
Posted: Friday 05 January 2018 17:38
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
Re: [Plugin now available in Beta] Help with Yeelight Bulb
Posted: Saturday 06 January 2018 9:40
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