Skip to content

Instantly share code, notes, and snippets.

@rfinnie
Created April 15, 2024 15:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rfinnie/42df8b12cbbf0ce39be2a183462baabd to your computer and use it in GitHub Desktop.
Save rfinnie/42df8b12cbbf0ce39be2a183462baabd to your computer and use it in GitHub Desktop.
alias description trigger condition action mode
SCE Tariff (Winter)
platform at variables
time
08:00:00
tariff
superoffpeak
platform at variables
time
16:00:00
tariff
midpeak
platform at variables
time
21:00:00
tariff
offpeak
condition value_template
template
{{ now().month >= 10 or now().month <= 5 }}
service target data
select.select_option
entity_id
select.sce
option
{{ tariff }}
single

alias: SCE Tariff (Summer Weekday) description: "" trigger:

  • platform: time at: "08:00:00" variables: tariff: offpeak
  • platform: time at: "16:00:00" variables: tariff: onpeak
  • platform: time at: "21:00:00" variables: tariff: offpeak condition:
  • condition: template value_template: "{{ now().month >= 6 and now().month <= 9 and now().weekday() < 5 }}" action:
  • service: select.select_option target: entity_id: select.sce data: option: "{{ tariff }}" mode: single

alias: SCE Tariff (Summer Weekend) description: "" trigger:

  • platform: time at: "08:00:00" variables: tariff: offpeak
  • platform: time at: "16:00:00" variables: tariff: midpeak
  • platform: time at: "21:00:00" variables: tariff: offpeak condition:
  • condition: template value_template: "{{ now().month >= 6 and now().month <= 9 and now().weekday() >= 5 }}" action:
  • service: select.select_option target: entity_id: select.sce data: option: "{{ tariff }}" mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment