Milight Nightmode available in LUA or JSON ?
Moderator: leecollings
- cyberclwn
- Posts: 105
- Joined: Thursday 20 August 2015 22:53
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: The Netherlands
- Contact:
Milight Nightmode available in LUA or JSON ?
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 .. )
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 .. )
3xPi 2B (Domoticz "live", Domoticz "sandbox", PhotoFrame)
RFXCom433(E), KaKu, Oregon Scientific, Keyes 2-relay, Logitech Media Server, MiLight, Smartwares heating controller(2x), IR Send/Receive, Keyes PIR, XH-M131 DuskSensor, DHT22/11
RFXCom433(E), KaKu, Oregon Scientific, Keyes 2-relay, Logitech Media Server, MiLight, Smartwares heating controller(2x), IR Send/Receive, Keyes PIR, XH-M131 DuskSensor, DHT22/11
-
Nautilus
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: Milight Nightmode available in LUA or JSON ?
This works for me:
Found in ../domoticz/www/app/LightsController.js. There should also be the button for this on the "edit" screen of your Milight switch.
Code: Select all
appLampNight = function()
{
$.ajax({
url: "json.htm?type=command¶m=nightlight&idx=" + $.devIdx,
async: false,
dataType: 'json'
});
}- cyberclwn
- Posts: 105
- Joined: Thursday 20 August 2015 22:53
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: The Netherlands
- Contact:
Re: Milight Nightmode available in LUA or JSON ?
Hey,
Thanks, with that JSON call i can do what i want.
Thanks, with that JSON call i can do what i want.
3xPi 2B (Domoticz "live", Domoticz "sandbox", PhotoFrame)
RFXCom433(E), KaKu, Oregon Scientific, Keyes 2-relay, Logitech Media Server, MiLight, Smartwares heating controller(2x), IR Send/Receive, Keyes PIR, XH-M131 DuskSensor, DHT22/11
RFXCom433(E), KaKu, Oregon Scientific, Keyes 2-relay, Logitech Media Server, MiLight, Smartwares heating controller(2x), IR Send/Receive, Keyes PIR, XH-M131 DuskSensor, DHT22/11
- sincze
- Posts: 1302
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Milight Nightmode available in LUA or JSON ?
That i have to see. ThanksNautilus wrote:This works for me:Found in ../domoticz/www/app/LightsController.js. There should also be the button for this on the "edit" screen of your Milight switch.Code: Select all
appLampNight = function() { $.ajax({ url: "json.htm?type=command¶m=nightlight&idx=" + $.devIdx, async: false, dataType: 'json' }); }
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
-
Nautilus
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: Milight Nightmode available in LUA or JSON ?
Just check the file I mentioned (https://github.com/domoticz/domoticz/bl ... troller.js) for anything interesting, like appLampDiscoModeNum, appLampSetKelvin...sincze wrote:
That i have to see. Thanksany more tricks where this one came from???
- sincze
- Posts: 1302
- Joined: Monday 02 June 2014 22:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands / Breda Area
- Contact:
Re: Milight Nightmode available in LUA or JSON ?
Got itNautilus wrote:Just check the file I mentioned (https://github.com/domoticz/domoticz/bl ... troller.js) for anything interesting, like appLampDiscoModeNum, appLampSetKelvin...sincze wrote:
That i have to see. Thanksany more tricks where this one came from???
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
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
-
darkside0506
- Posts: 3
- Joined: Tuesday 18 April 2017 10:58
- Target OS: Windows
- Domoticz version:
- Contact:
Re: Milight Nightmode available in LUA or JSON ?
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?
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?
-
luclodder
- Posts: 1
- Joined: Tuesday 02 January 2018 13:09
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Milight Nightmode available in LUA or JSON ?
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.