Skip to content

Instantly share code, notes, and snippets.

@Tugzrida
Created February 18, 2024 04:16
Show Gist options
  • Select an option

  • Save Tugzrida/cfa66c2d3500e9cf827d2a3d4d981a9c to your computer and use it in GitHub Desktop.

Select an option

Save Tugzrida/cfa66c2d3500e9cf827d2a3d4d981a9c to your computer and use it in GitHub Desktop.

Revisions

  1. Tugzrida created this gist Feb 18, 2024.
    16 changes: 16 additions & 0 deletions HA_Ausgrid_EA025.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    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 %}
    14 changes: 14 additions & 0 deletions HA_Ausgrid_EA116.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    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 %}