Help with smart switching
Posted: Wednesday 03 May 2017 13:15
Hi all,
I currently have my lights in the dressing room being switched with Blocky, but it is somehow a little limited and not really 'smart'. I hope someone can help me writing this logic in LUA.
Setup: door open sensor, pir in room, manual switch in wall on 433 MHz, switched light, IsDark sensor, 30 minute timer after waking up. I use this last timer/switch because my curtains are closed in the dressing room while I sleep and when I wake up this timer stays on for 30 minutes so I have 30 minutes to get dressed and open the curtains.
I basically want this light to be switched ON for 1 minute when the door is open, or there is activity in the room while it is dark or 30 minutes after waking up. When there is no movement detected anymore the light can go out after 1 minute.
But I also have a manual switch placed in the wall (where the old light-switch was originally). I want this switch to toggle the light. So if the light is on because of logics I can turn it off with this switch. But if the light is off because none of the logics is true, I want to turn the light on with this switch.
I hope someone is willing to help me with this.
I currently have my lights in the dressing room being switched with Blocky, but it is somehow a little limited and not really 'smart'. I hope someone can help me writing this logic in LUA.
Setup: door open sensor, pir in room, manual switch in wall on 433 MHz, switched light, IsDark sensor, 30 minute timer after waking up. I use this last timer/switch because my curtains are closed in the dressing room while I sleep and when I wake up this timer stays on for 30 minutes so I have 30 minutes to get dressed and open the curtains.
I basically want this light to be switched ON for 1 minute when the door is open, or there is activity in the room while it is dark or 30 minutes after waking up. When there is no movement detected anymore the light can go out after 1 minute.
But I also have a manual switch placed in the wall (where the old light-switch was originally). I want this switch to toggle the light. So if the light is on because of logics I can turn it off with this switch. But if the light is off because none of the logics is true, I want to turn the light on with this switch.
I hope someone is willing to help me with this.