Page 1 of 1
Milight Nightmode available in LUA or JSON ?
Posted: Thursday 13 April 2017 21:35
by cyberclwn
Hey guys,
Anoyone know if it is possible to turn on nightmodeby a LUA-script or using a JSON call ?
To set a milight to white using a switch, i use thia url for the "on" action:
http://x.x.x.x:x/json.htm?type=command¶m=setcolbrightnessvalue&idx=81&hex=ffffff&brightness=100&iswhite=true
But i can't find how to set the also available nightmode for a rgbw-bulb.
(nightmode is whitelight at about 3%)
Thanks
ps. i searched for nightmode and couldn't find anything about it .. )
Re: Milight Nightmode available in LUA or JSON ?
Posted: Friday 14 April 2017 11:54
by Nautilus
This works for me:
Code: Select all
appLampNight = function()
{
$.ajax({
url: "json.htm?type=command¶m=nightlight&idx=" + $.devIdx,
async: false,
dataType: 'json'
});
}
Found in ../domoticz/www/app/LightsController.js. There should also be the button for this on the "edit" screen of your Milight switch.
Re: Milight Nightmode available in LUA or JSON ?
Posted: Friday 14 April 2017 13:41
by cyberclwn
Hey,
Thanks, with that JSON call i can do what i want.
Re: Milight Nightmode available in LUA or JSON ?
Posted: Saturday 15 April 2017 14:41
by sincze
Nautilus wrote:This works for me:
Code: Select all
appLampNight = function()
{
$.ajax({
url: "json.htm?type=command¶m=nightlight&idx=" + $.devIdx,
async: false,
dataType: 'json'
});
}
Found in ../domoticz/www/app/LightsController.js. There should also be the button for this on the "edit" screen of your Milight switch.
That i have to see. Thanks
any more tricks where this one came from???
Re: Milight Nightmode available in LUA or JSON ?
Posted: Saturday 15 April 2017 20:36
by Nautilus
sincze wrote:
That i have to see. Thanks
any more tricks where this one came from???
Just check the file I mentioned (
https://github.com/domoticz/domoticz/bl ... troller.js) for anything interesting, like appLampDiscoModeNum, appLampSetKelvin...
Re: Milight Nightmode available in LUA or JSON ?
Posted: Saturday 15 April 2017 21:08
by sincze
Got it
, found some nice easter eggs.
Code: Select all
SetColValue = "json.htm?type=command¶m=setcolbrightnessvalue&idx=" + idx + "&hue=" + hue + "&brightness=" + brightness + "&iswhite=" + isWhite
appLampBrightnessUp = "json.htm?type=command¶m=brightnessup&idx=" + $.devIdx
appLampBrightnessDown = "json.htm?type=command¶m=brightnessdown&idx=" + $.devIdx
appLampDiscoUp = "json.htm?type=command¶m=discoup&idx=" + $.devIdx
appLampDiscoDown = "json.htm?type=command¶m=discodown&idx=" + $.devIdx
appLampDiscoMode = "json.htm?type=command¶m=discomode&idx=" + $.devIdx
appLampDiscoModeNum = "json.htm?type=command¶m=discomodenum" + mode + "&idx=" + $.devIdx
appLampSetKelvin = "json.htm?type=command¶m=setkelvinlevel&idx=" + $.devIdx + "&kelvin=" + kelvin
appLampSpeedUp = "json.htm?type=command¶m=speedup&idx=" + $.devIdx
appLampSpeedUpLong = "json.htm?type=command¶m=speeduplong&idx=" + $.devIdx
appLampSpeedDown = "json.htm?type=command¶m=speeddown&idx=" + $.devIdx
appLampSpeedMin = "json.htm?type=command¶m=speedmin&idx=" + $.devIdx
appLampSpeedMax = "json.htm?type=command¶m=speedmax&idx=" + $.devIdx
appLampWarmer = "json.htm?type=command¶m=warmer&idx=" + $.devIdx
appLampFull = "json.htm?type=command¶m=fulllight&idx=" + $.devIdx
appLampWhite = "json.htm?type=command¶m=whitelight&idx=" + $.devIdx
appLampNight = "json.htm?type=command¶m=nightlight&idx=" + $.devIdx
Re: Milight Nightmode available in LUA or JSON ?
Posted: Wednesday 24 May 2017 21:01
by darkside0506
Nice find.
When I use it though, Disco+ slows down the disco mode and disco- speeds it up. I also can't get the discomodenum to send a command to rflink properly. Have you had any success with changing disco mode number?
Re: Milight Nightmode available in LUA or JSON ?
Posted: Tuesday 02 January 2018 13:11
by luclodder
I believe DiscoUP and Down does not change the speed of the disco effect. But it does change to the next (up) or previous (down) discomode.