I recently got a Shelly EM and I’ve been working on setting up the Energy Dashboard.
I’m really happy with the Shelly EM, so far (5 days) it is reading only 0.57% high compared to the Toronto Hydro Power Lens tool. Given more data, I may attempt to adjust it.
First question, Ontario Energy Board (OEB) rates are Time-of-Use on weekdays, AND Off-peak rates on weekends or holidays. I have worked out how to do this with a sensor:
tou_label:
friendly_name: 'TOU Label'
value_template: >
{% set is_holiday = states('calendar.oeb_tou_holidays') == 0 %}
{% set is_weekend = now().strftime("%w") == 0 or now().strftime("%w") == 6 %}
{% set is_summer = now().month >= 5 and now().month < 11 %}
{% if is_holiday or is_weekend %}
{{ "Off-peak" }}
{% elif is_weekend %}
{{ "Off-peak" }}
{% elif is_summer %}
{% if now().hour >= 7 and now().hour <= 10 %}
{{ "Mid-peak" }}
{% elif now().hour >= 11 and now().hour <= 16 %}
{{ "On-peak" }}
{% elif now().hour >= 17 and now().hour <= 18 %}
{{ "Mid-peak" }}
{% elif now().hour >= 19 or now().hour <= 6 %}
{{ "Off-peak" }}
{% endif %}
{% else %}
{% if now().hour >= 7 and now().hour <= 10 %}
{{ "On-peak" }}
{% elif now().hour >= 11 and now().hour <= 16 %}
{{ "Mid-peak" }}
{% elif now().hour >= 17 and now().hour <= 18 %}
{{ "On-peak" }}
{% elif now().hour >= 19 or now().hour <= 6 %}
{{ "Off-peak" }}
{% endif %}
{% endif %}
The Utility Meter Helper works with an automation:
automation:
trigger:
- platform: time
at: "09:00:00"
variables:
tariff: "peak"
- platform: time
at: "21:00:00"
variables:
tariff: "offpeak"
action:
- service: select.select_option
target:
entity_id: select.daily_energy
data:
option: "{{ tariff }}"
- service: select.select_option
target:
entity_id: select.monthly_energy
data:
option: "{{ tariff }}"
Has anyone figured out how to set the tariff with a sensor instead of an automation? I’d like to use my existing solution.
Finally, I found current rate info in XML form here:
https://www.oeb.ca/_html/calculator/data/BillData.xml
Can anyone point me towards how I would scrape my rate from this category?
<BillDataRow>
<Dist>Toronto Hydro-Electric System Limited</Dist>
<Class>RESIDENTIAL</Class>
For example, I would want to pull the data from:
<RPPOffP>0.082</RPPOffP>
<RPPMidP>0.113</RPPMidP>
<RPPOnP>0.17</RPPOnP>
This would automate updating the costs when the rates change.
If anyone is interested, I’ve also figured out the billing formula for Toronto Hydro from these rates.