I have a sensor in the hallway and lights in an adjoining room. The idea is that when you come down stairs in the morning or through the front door after dark into the hall, the sensor will detect you and turn the adjoining room lights on.
The problem I have had is when you turn the lights off and walk into the hall to go upstairs at the end of the night, they turn on again. I would like to have an automation rule that basically ignores the sensor activation for five minutes after the lights have been turned off to give you enough time to get upstairs.
What I have come up with is:
- alias: "Movement hall"
trigger:
platform: state
entity_id: sensor.fibaro_burglar_7_10
state: '8'
condition:
condition: and
conditions:
- condition: state
entity_id: sun.sun
state: below_horizon
- condition: state
entitiy_id: group.Dining_Room
state: off
for:
minutes: 5
action:
service: light.turn_on
entity_id: group.Dining_Room
but I am getting the following error:
16-10-30 06:00:46 homeassistant.bootstrap: The following platforms contain invalid configuration: automation (please check your configuration)extra keys not allowed @ data['condition'][0]['conditions'][1]['entitiy_id']. Got None
extra keys not allowed @ data['condition'][0]['conditions'][1]['for']. Got None
extra keys not allowed @ data['condition'][0]['conditions'][1]['state']. Got None
not a valid value for dictionary value @ data['condition'][0]['conditions'][1]['condition']. Got None
required key not provided @ data['condition'][0]['conditions'][1]['entity_id']. Got None. Please check the docs at https://home-assistant.io/components/automation/
I am sure it is something simple but I have reached that stage where I am just confusing myself!
Can you have the hallway light on and then lights turned off when motion has not been detected for 5 mins or does this interfere with your other automations?
Otherwise, you could use a boolean switch to do what you want I think.
Have a look at this example perhaps. You could borrow a fair bit of that to make a goodnight boolean to use as a condition I reckon.
So What I am hoping to see is:
Movement in the hall > dining room lights turn on.
Dining room lights switched off by me > timer starts disabling the hall sensor for 10 minutes
It seems to work most of the time, but occasionally the boolean switch seems to fail to stop the lights coming back on (may be something to do with the fibaro sensor and the way it detects movement - if there is a second movement detected in close proximity to the first I don’t always get an activation)
I have also had a problem where the hue lights in the dining room turn on but to the lowest possible setting. I can’t work out why this is happening or replicate it on demand… it just happens from time to time which is really frustrating when I am trying to sell the benefits of home automation to the Mrs!
Does the order that things are in the automation.yaml script matter?
(PS, yes I know I have called it five minutes delay but put ten minutes in the timer… deliberate of course… )