Update Energy Package
This commit is contained in:
@@ -447,6 +447,36 @@ template:
|
|||||||
+ states('sensor.emporia_d937d0_1min')|float
|
+ states('sensor.emporia_d937d0_1min')|float
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
# TOU Schedules
|
||||||
|
- name: TOU Season
|
||||||
|
state: "{{ ['Winter', 'Summer'][now().month >= 6 and now().month < 10] }}"
|
||||||
|
icon: mdi:weather-cloudy-clock
|
||||||
|
|
||||||
|
- name: TOU Period
|
||||||
|
icon: mdi:calendar-clock
|
||||||
|
state: >
|
||||||
|
{% set is_weekend = now().strftime("%w") == 0 or now().strftime("%w") == 6 %}
|
||||||
|
{% if states('sensor.tou_season') == "Summer" %}
|
||||||
|
{% if now().hour >= 16 and now().hour < 21 %}
|
||||||
|
{% if is_weekend %}
|
||||||
|
{{ "Mid-Peak" }}
|
||||||
|
{% else %}
|
||||||
|
{{ "On-Peak" }}
|
||||||
|
{% endif %}
|
||||||
|
{% else %}
|
||||||
|
{{ "Off-Peak" }}
|
||||||
|
{% endif %}
|
||||||
|
{% else %}
|
||||||
|
{% if now().hour >= 16 and now().hour < 21 %}
|
||||||
|
{{ "Mid-Peak" }}
|
||||||
|
{% elif now().hour >= 21 or now().hour < 8 %}
|
||||||
|
{{ "Off-Peak" }}
|
||||||
|
{% else %}
|
||||||
|
{{ "Super Off-Peak" }}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# Utility Meters
|
# Utility Meters
|
||||||
utility_meter:
|
utility_meter:
|
||||||
@@ -459,4 +489,20 @@ utility_meter:
|
|||||||
- Off-Peak
|
- Off-Peak
|
||||||
- Mid-Peak
|
- Mid-Peak
|
||||||
- On-Peak
|
- On-Peak
|
||||||
- Surplus
|
|
||||||
|
|
||||||
|
automation:
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
# Utility Meter Automations
|
||||||
|
- alias: Set Utility Meter TOU Tariff
|
||||||
|
trigger:
|
||||||
|
- platform: state
|
||||||
|
entity_id: sensor.tou_period
|
||||||
|
- platform: homeassistant
|
||||||
|
event: start
|
||||||
|
action:
|
||||||
|
- service: select.select_option
|
||||||
|
target:
|
||||||
|
entity_id: select.daily_energy
|
||||||
|
data:
|
||||||
|
option: "{{ sensor.tou_period }}"
|
||||||
|
|||||||
@@ -98,6 +98,36 @@ template:
|
|||||||
+ states('sensor.emporia_d937d0_1min')|float
|
+ states('sensor.emporia_d937d0_1min')|float
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
# TOU Schedules
|
||||||
|
- name: TOU Season
|
||||||
|
state: "{{ ['Winter', 'Summer'][now().month >= 6 and now().month < 10] }}"
|
||||||
|
icon: mdi:weather-cloudy-clock
|
||||||
|
|
||||||
|
- name: TOU Period
|
||||||
|
icon: mdi:calendar-clock
|
||||||
|
state: >
|
||||||
|
{% set is_weekend = now().strftime("%w") == 0 or now().strftime("%w") == 6 %}
|
||||||
|
{% if states('sensor.tou_season') == "Summer" %}
|
||||||
|
{% if now().hour >= 16 and now().hour < 21 %}
|
||||||
|
{% if is_weekend %}
|
||||||
|
{{ "Mid-Peak" }}
|
||||||
|
{% else %}
|
||||||
|
{{ "On-Peak" }}
|
||||||
|
{% endif %}
|
||||||
|
{% else %}
|
||||||
|
{{ "Off-Peak" }}
|
||||||
|
{% endif %}
|
||||||
|
{% else %}
|
||||||
|
{% if now().hour >= 16 and now().hour < 21 %}
|
||||||
|
{{ "Mid-Peak" }}
|
||||||
|
{% elif now().hour >= 21 or now().hour < 8 %}
|
||||||
|
{{ "Off-Peak" }}
|
||||||
|
{% else %}
|
||||||
|
{{ "Super Off-Peak" }}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# Utility Meters
|
# Utility Meters
|
||||||
utility_meter:
|
utility_meter:
|
||||||
@@ -110,5 +140,21 @@ utility_meter:
|
|||||||
- Off-Peak
|
- Off-Peak
|
||||||
- Mid-Peak
|
- Mid-Peak
|
||||||
- On-Peak
|
- On-Peak
|
||||||
- Surplus
|
|
||||||
|
|
||||||
|
automation:
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
# Utility Meter Automations
|
||||||
|
- alias: Set Utility Meter TOU Tariff
|
||||||
|
trigger:
|
||||||
|
- platform: state
|
||||||
|
entity_id: sensor.tou_period
|
||||||
|
- platform: homeassistant
|
||||||
|
event: start
|
||||||
|
action:
|
||||||
|
- service: select.select_option
|
||||||
|
target:
|
||||||
|
entity_id: select.daily_energy
|
||||||
|
data:
|
||||||
|
option: "{{ sensor.tou_period }}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user