Page 1 of 1
Auto turn off lights
Posted: Monday 05 March 2018 19:01
by jerrybboy
Hello People,
Could you guys help me with the following things :
I have a few philips hue lights in my house that can not be turned off without a mobile phone, so when my cleaners comes to my home she is unable to turn on/off or change the brightness of the lights. The only way to turn them on or off is to flip the switch in my kitchen. But this way I can not control the lighting because the light bulb doesn't have any power.
I was wondering if the following things are possible :
1) When the light is turned on by the switch it should switch off the light after lets say 30 minutes.
2) When the switch is flipped 2 times within 10 seconds it should activate 100% brightness
3) When the switch is flipped 3 times within 10 seconds it should activate 50% brightness
Could you guys give me some tips on how to achieve this, the most important one is #1.
Best regards,
Jerry_bboy
Re: Auto turn off lights
Posted: Monday 05 March 2018 20:30
by freijn
Do you have the Philips Hue Bridge ?
You require an interface to the domoticz...
Re: Auto turn off lights
Posted: Monday 05 March 2018 23:18
by jerrybboy
freijn wrote: Monday 05 March 2018 20:30
Do you have the Philips Hue Bridge ?
You require an interface to the domoticz...
Yes I have the philips hue bridge. I can controle it through my Phone with the philips hue app. And I can controle it through domoticz.
Re: Auto turn off lights
Posted: Monday 05 March 2018 23:44
by Amsterdam020
You could use a kaku (klik aan klik uit) remote controle (
https://www.klikaanklikuit.nl/nl/ayct-1 ... ening.html ) if you have a rfxcom
You could create a script where the kaku remote swithces your hue light.
Or more expensive, use a smart wall switch, see
viewtopic.php?f=11&t=19592&p=152379#p152379
Re: Auto turn off lights
Posted: Monday 05 March 2018 23:45
by waaren
If the switch is only controlling the power to the hue light and not known in domoticz, domoticz have no way to control or check the state of the bulb if it is switched off.
In order to do that you would need another switch that can function as a trigger to a scene and/or script
With such a switch defined in domoticz, it is quite simple to implement requirement #1 with a scene or script and requirement #2 and #3 can be done using a dzVents scripts (and probably also with other types of scripts)
Re: Auto turn off lights
Posted: Tuesday 06 March 2018 8:20
by freijn
So.. What you are looking for is only a switch into domoticz and operated by the cleaners. ?
- connect a simple switch to your IO on the raspberry Pi ( need a cable between switch and raspberry

)
- get a NodeMCU Arduino, put a switch on that one and place the switch anywhere you like ( power and Wifi required)
- get a rflink gateway and do it with the "action shop doorbell kaku'
Re: Auto turn off lights
Posted: Tuesday 06 March 2018 15:36
by jerrybboy
freijn wrote: Tuesday 06 March 2018 8:20
So.. What you are looking for is only a switch into domoticz and operated by the cleaners. ?
- connect a simple switch to your IO on the raspberry Pi ( need a cable between switch and raspberry

)
- get a NodeMCU Arduino, put a switch on that one and place the switch anywhere you like ( power and Wifi required)
- get a rflink gateway and do it with the "action shop doorbell kaku'
First I don't have a raspberry Pi, but I run domoticz on my hp microserver so I won't be able to connect a cable to that.
Please tell me if what I was thinking is possible or not,
When I turn on the lights in my kitchen (hue lights) with the app I see in domoticz that the lights are on.
Also when I turn on the lights with the switch (switch is not visible in domoticz) i can see that the light is on
See the picture below it says (aan) to show that the lights are on.
Also I can see that every light is going on in the following picture

So what I thought should be possible is that when the light is turned on/off 2/3 times within a "X" amount that it will trigger a scene.
Also I would like to turn of the light after 30 minutes when it is switched on by a switch or by the hue app or by domoticz .
But maybe i'm wrong and it is not possible .
Re: Auto turn off lights
Posted: Tuesday 13 March 2018 11:43
by jerrybboy
No one that has an idea if this is possible ?
Somebody said to me it might be possible with dzvents ?
Re: Auto turn off lights
Posted: Tuesday 13 March 2018 12:07
by waaren
In this setup and with only the hardware you are describing, I don't know how to make this possible.
Re: Auto turn off lights
Posted: Friday 16 March 2018 10:59
by alanlsmith
To turn off after 30 minutes you could use something like this script
Code: Select all
commandArray = {}
local light = 'YourHueLight'
if(devicechanged[light] == 'On') then
commandArray[#commandArray+1] = {[light] = 'Off AFTER 1800'} -- 30 minutes
end
return commandArray
For setting the level with multiple presses of the switch, if the switch also causes the hue light to go on and off the you could use a script to check the light going on repeatedly within a certain time and set the level accordingly but I feel that it might not be very reliable as it would be largely dependant on how quickly (or slowly) the switch was switched and whether Domoticz could keep up.
I use something similar with my porch light. If you open the door and close it in less then 10 second then the porch light goes on and remains on until you open and close the door again but if you open the door and leave it open the light stays on until you close the door.
Re: Auto turn off lights
Posted: Friday 16 March 2018 11:43
by Ballo50
The problem is indeed how fast Domoticz will detect the light has been turned off and on. The Hue bridge must first detect the light change and then report it to Domoticz.
An option would be to use a motion detector and script the light based on day and time the motion is detected. Of course this would require the cleaners to be around at the same day at around the same time.
An easy solution for this outside Domoticz would be to buy a Hue dimmer switch. You can program that within the Hue app and can place it on any location you like. just instruct the cleaners to use those buttons instead of the current light switch. I had the same problem with a switch in my hallway and solved it this way.