Hi,
I am trying to build an automation for one of the room that have quick motion in/out and I am trying to ensure that there is someone in the room for x min/sec to trigger the automation. triggering based on state on is working great but I do not want to turn everything on if someone just entered and exit the room.
my current config is as following:
Thanks in Advance.
PS: I have searched for a solution for sometime but cannot find it.
- id: turnonglassled
alias: "Turn on Dining Room when there is movement"
trigger:
- entity_id: binary_sensor.glass_room_motion
platform: state
to: 'on'
condition:
condition: and
conditions:
- condition: state
entity_id: switch.glassroom_ac_control
state: 'off'
- condition: template
value_template: '{{ states.sensor.zooz_zse40_4in1_sensor_temperature.state | float > 24 }}'
action:
- service: homeassistant.turn_on
data_template:
entity_id: >
{% if is_state('switch.glassroom_ac_control', 'off') and (states.sun.sun.attributes.elevation < 4) %}
group.glassroom_auto
{% elif is_state('switch.glassroom_ac_control', 'off') and (states.sun.sun.attributes.elevation > 4) %}
switch.glassroom_ac_control
{% endif %}