Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- automation:
- #lights out when no activity and noone is showering or after 5 min of inactivity
- - alias: bad - lys av inaktivitet
- trigger:
- - platform: state
- entity_id: binary_sensor.bad_pir_occupancy
- to: 'off'
- for: '00:05:00'
- - platform: event
- event_type: timer.finished
- event_data:
- entity_id: timer.dusjtimer
- condition: "{{states('timer.dusjtimer') == 'idle' and states('binary_sensor.bad_pir_occupancy') == 'off'}}"
- action:
- - service: light.turn_off
- entity_id: light.bad
- # start timer when the trend sensor triggers from rising humidity
- - alias: bad lys på når noen dusjer
- trigger:
- platform: state
- entity_id: binary_sensor.bad_noen_dusjer
- to: 'on'
- action:
- - service: timer.start
- entity_id: timer.dusjtimer
- mode: single
- max_exceeded: silent
- binary_sensor:
- - platform: trend
- sensors:
- bad_noen_dusjer:
- max_samples: 3
- entity_id: sensor.bad_klima_humidity
- min_gradient: 0.025 # (3/(60*2))% meaning rising 3% in 2 minutes
- timer:
- dusjtimer:
- duration: '00:20:00'
- restore: true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement