what about something like
off top of head
Well this start as and idea
I have just set this up in office and it WORKS
but each time the binary_sensor.office_motion state goes on we also flick the
input_boolean.someone_in_room_1 on then off
then if the input_boolean been in the off state for 10 mins do something
binarysensor:
- platform: mqtt
name: "Office motion"
state_topic: "stat/SONOFF-FAN/POWER3"
payload_on: "ON"
payload_off: "OFF"
device_class: motion
input_boolean:
someone_in_room_1:
name: "Someone in Office"
initial: off
the automation would look something
- id: 'montion gone off office'
alias: 'montion gone off office'
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.office_motion
to: 'on'
action:
- data:
entity_id: input_boolean.someone_in_room_1
service: input_boolean.turn_on
- delay: 00:00:01
- data:
entity_id: input_boolean.someone_in_room_1
service: input_boolean.turn_off
now let do someting if input_boolean.someone_in_room_1 been in a Off state for mins
- id: 'montion on for x min'
alias: 'montion on for x min'
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.someone_in_room_1
to: 'off'
for:
minutes: 10
action:
- data:
entity_id: switch.that_thing
service: switch.turn_off
Now just change the minutes to your liking
This is base on this
have taken out the Node-red
bit all in HA