Created
February 18, 2024 04:16
-
-
Save Tugzrida/cfa66c2d3500e9cf827d2a3d4d981a9c to your computer and use it in GitHub Desktop.
Ausgrid tariff definitions for Home Assistant
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template: | |
- sensor: | |
- name: "Current power tariff" | |
unique_id: sensor.current_power_tariff | |
state: > | |
{% if now().weekday() not in (5, 6) and ( | |
(now().month in (11, 12, 1, 2, 3) and 14 <= now().hour <= 19) | |
or | |
(now().month in (6, 7, 8) and 17 <= now().hour <= 20) | |
)-%} | |
Peak | |
{%- elif 7 <= now().hour <= 21 -%} | |
Shoulder | |
{%- else -%} | |
Off-peak | |
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template: | |
- sensor: | |
- name: "Current power tariff" | |
unique_id: sensor.current_power_tariff | |
state: > | |
{% if now().weekday() not in (5, 6) and ( | |
(now().month in (9, 10, 11, 12, 1, 2, 3, 4, 5) and 14 <= now().hour <= 19) | |
or | |
(now().month in (6, 7, 8) and 17 <= now().hour <= 20) | |
)-%} | |
Peak | |
{%- else -%} | |
Off-peak | |
{%- endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment