Skip to content

Instantly share code, notes, and snippets.

@bessarabov
Created July 8, 2020 14:04
Show Gist options
  • Save bessarabov/da16562a69abbe101219f4d5d562891c to your computer and use it in GitHub Desktop.
Save bessarabov/da16562a69abbe101219f4d5d562891c to your computer and use it in GitHub Desktop.
automation:
- id: turn_towel_rail_on
alias: Turn towel rail on
trigger:
- platform: state
entity_id: binary_sensor.somebody_at_dacha
to: 'on'
- platform: time_pattern
minutes: "/6"
condition:
- condition: state
entity_id: binary_sensor.somebody_at_dacha
state: 'on'
- condition: state
entity_id: switch.bw_shp6_towel_rail_relay
state: 'off'
action:
- service: switch.turn_on
entity_id: switch.bw_shp6_towel_rail_relay
- id: turn_towel_rail_off
alias: Turn towel rail off
trigger:
- platform: state
entity_id: binary_sensor.somebody_at_dacha
to: 'off'
- platform: time_pattern
minutes: "/6"
condition:
- condition: state
entity_id: binary_sensor.somebody_at_dacha
state: 'off'
- condition: state
entity_id: switch.bw_shp6_towel_rail_relay
state: 'on'
action:
- service: switch.turn_off
entity_id: switch.bw_shp6_towel_rail_relay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment