QUOTE(yfyap69 @ Sep 4 2020, 10:01 AM)
I hv the following code on my auto off automation file :
- id: '1599010718004'
alias: Auto off Bathroom4
trigger:
- entity_id: binary_sensor.pir_down_bathroom,binary_sensor.bathroom_4_door_sensor
for: 0:10:00
platform: state
to: 'off'
action:
- entity_id: switch.sonoff_10008d8ef2_2
service: switch.turn_off
mode: single
Question is the automation will off the switch when both trigger is in off state for 10 min or any one trigger is in off state for 10 min? If it is the later, how to do it for both trigger?
in my scenario, only when you go in to toilet light turn on with motion sensor, door open or close not important
entity_controller:
motion_toilet: # serves as a name
sensor: binary_sensor.toilet_motion_sensor_occupancy # [motion sensors]
sensor_type: duration # sensor type (can ignore this if your sensor is instant)
entity: light.toilet # [light switch]
override: binary_sensor.toilet_door_invert # door is closed (door sensor) over rides timer
delay: 60 #overwrites default delay of 180s
start_time: sunset - 00:15:00 # optional
end_time: sunrise + 00:15:00 # optional
end_time_action: "off" # will turn off all control entities if they are on.
sometimes you go in wash hands only no need wait so long to turn of light. however if u do number 2 or shower and dont close door the light might turn off
then setup automation to turn off the toliet light when door is open after waiting for say 10 seconds.
works great for me.