Skip to content

Instantly share code, notes, and snippets.

@Didgeridrew
Last active April 24, 2023 03:23
Show Gist options
  • Select an option

  • Save Didgeridrew/ecab0fafb49c6f8cb4c4e4377af58ff0 to your computer and use it in GitHub Desktop.

Select an option

Save Didgeridrew/ecab0fafb49c6f8cb4c4e4377af58ff0 to your computer and use it in GitHub Desktop.
trigger:
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.pump
condition:
action:
- variables:
on_time: "00:15:00"
off_time: "00:30:00"
next_interval: >
{{ on_time if is_state('switch.pump','off') else off_time }}
- service: switch.toggle
target:
entity_id: switch.pump
- service: timer.start
data:
duration: "{{ next_interval }}"
target:
entity_id: timer.pump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment