LUA and dim Hue light bulbs
Posted: Tuesday 08 August 2017 16:11
Hi,
I have a Domoticz/Philips Hue question.
On the second floor I want to use a Philips Hue (white) light bulb with an KlikAanKlikUit motion sensor. No problems so far (I have this already working on the first floor).
The difference between the first floor and the second floor: on the second floor I want to change the dim level (5% or 75%) depending on the time.
I thought to use this solution:
- Create in the Hue app a scene for the Hue light bulb with 5% dim level [SCENE 1]
- Create in the Hue app a scene for the Hue light bulb with 75% dim level [SCENE 2]
- Between 06.00 and 23.00 hrs I switch on [SCENE 1] after a motion is detected
- Between 23.00 and 06.00 hrs I switch on [SCENE 2] after a motion is detected
You cannot turn off a Hue scene, so in stead of that I turn off the Hue light bulb after 5 minutes (after motion is deteced). This solution is not working. I also tried a lot of other options, but nothing works the way I like it to work.
Is it possible to create a solution to dim a Hue light blub in LUA for my problem with a standard Domoticz installation on a Raspberry Pi 2B?
If not, what should I do? Please tell me when it is neccesary to install additional plugins/programs.
This option isn't also working: turn on a scene with "ON FOR 5"
I am using the new Domoticz version v3.8153.
Thanks in advance for your help!
Regards,
Rob
LUA SCRIPT:
commandArray = {}
l_time = os.date("*t")
if (otherdevices['KAKU MOTION SENSOR 2'] == "On" and otherdevices['LIGHT 2'] == "Off") then
if (l_time.hour >= 23 or l_time.hour < 6) then
commandArray['SCENE 2'] = "On"
elseif (l_time.hour >= 6 and l_time.hour < 23) then
commandArray['SCENE 1'] = "On"
end
commandArray['LIGHT 2'] = "Off AFTER 300"
end
return commandArray
I have a Domoticz/Philips Hue question.
On the second floor I want to use a Philips Hue (white) light bulb with an KlikAanKlikUit motion sensor. No problems so far (I have this already working on the first floor).
The difference between the first floor and the second floor: on the second floor I want to change the dim level (5% or 75%) depending on the time.
I thought to use this solution:
- Create in the Hue app a scene for the Hue light bulb with 5% dim level [SCENE 1]
- Create in the Hue app a scene for the Hue light bulb with 75% dim level [SCENE 2]
- Between 06.00 and 23.00 hrs I switch on [SCENE 1] after a motion is detected
- Between 23.00 and 06.00 hrs I switch on [SCENE 2] after a motion is detected
You cannot turn off a Hue scene, so in stead of that I turn off the Hue light bulb after 5 minutes (after motion is deteced). This solution is not working. I also tried a lot of other options, but nothing works the way I like it to work.
Is it possible to create a solution to dim a Hue light blub in LUA for my problem with a standard Domoticz installation on a Raspberry Pi 2B?
If not, what should I do? Please tell me when it is neccesary to install additional plugins/programs.
This option isn't also working: turn on a scene with "ON FOR 5"
I am using the new Domoticz version v3.8153.
Thanks in advance for your help!
Regards,
Rob
LUA SCRIPT:
commandArray = {}
l_time = os.date("*t")
if (otherdevices['KAKU MOTION SENSOR 2'] == "On" and otherdevices['LIGHT 2'] == "Off") then
if (l_time.hour >= 23 or l_time.hour < 6) then
commandArray['SCENE 2'] = "On"
elseif (l_time.hour >= 6 and l_time.hour < 23) then
commandArray['SCENE 1'] = "On"
end
commandArray['LIGHT 2'] = "Off AFTER 300"
end
return commandArray