I managed to solve this and created a guide in case anyone is interested.
Here it goes:
I live in Ontario, Canada, and recently bought and installed an Emporia Vue 2.
I successfully integrated in Home Assistant using Magico13’s Emporia (cloud) integration via HACS as I don’t have experience with ESP nor soldering circuit boards.
The people that lives in Ontario knows that our power companies use (mostly, as there also other less used options) Time of Use as billing/tariff methods.
We basically have 3 tiers, On, Off and Mid peaks. The peaks are hourly and type of day values, example, 7pm to 7am is off-peak, but Weekends and Holidays all days are off-peak. On top of that there are Seasons in which the 3 different tiers have different prices, example Off-Peak in Summer cost differently than Off-Peak in Winter.
This is basically a nightmare to configure in Home Assistant, until I found jrfernandes Github with the Ontario Energy Board data for all Power Companies in Ontario.
This integration lets you select your Power Company and will automatically bring the current Peak cost and tons of other Attributes, including all current Peak rates, Season, Active Peak, etc.
With the OEB and the Vue integration I was able to configure the Energy Dashboard, the Dashboard would automatically get the current Peak rate and give you the dollar amount of the kW/h you have been consuming, when the OEB switched the Peak rate (off-peak to on-peak), the Dashboard would just continue to reference the same entity and the consumed kW/h would be calculated with the updated rate.
That solved a lot, but it is not good enough, as it would give you the total dollar value and the total energy consumption, you wouldn’t know how much you consumed during each Peak and how much did each Period costed you.
This is how I managed to do it.
- Template in the config file to extract each peak rate attribute from the OEB entity and convert the attribute to a sensor (I created 3 sensors, one for each peak rate, example below).
sensor:
- platform: template
sensors:
alectra_off_peak_rate:
friendly_name: "Alectra Off Peak Rate"
unit_of_measurement: "CAD/kWh"
value_template: "{{ state_attr('sensor.alectra_utilities_corporation','off_peak_rate') }}"
- Created Utiliy Meter Helpers.
When creating/configuring the Utility Meter I selected the Vue (daily input) as the Input Sensor, my meter reset cycle is 30 days and I created 3 tariffs, On-Peak, Off-Peak and Mid-Peak.
When you finish configuring the Utility Meter, 4 helpers will be created, 3 sensors (one for each peak) and 1 Select helper, my helpers are named Vue_Power_Consumption_on_peak, off_peak, mid_peak and the Select is just Vue_Power_Consumption.
- Automations to tell the Select Helper (Vue_Power_Consumption) what is the current peak based on the OEB Active Peak attribute.
I created 3 Automations, one for each peak, example below:
When Active Peak of Alectra Utilities Corporation changes TO on_peak
Set VUE_Power_Consumption to on-peak
YAML:
alias: Alectra-Vue-Power-Consumption On-Peak
description: ""
trigger:
- platform: state
entity_id:
- sensor.alectra_utilities_corporation_rate_zone_residential_rate
attribute: active_peak
to: on_peak
condition: []
action:
- service: select.select_option
data:
option: on-peak
target:
entity_id: select.vue_power_consumption
mode: single
With the Select Helper knowing what is the current Peak automatically, I solved the problem off managing times of day and type of day rates, it all happens automatically now!
- The last step was configuring the Energy Dashboard.
On the Energy Dashboard configuration page, I added 3 Grid consumptions, basically the 3 utility meter helpers I created on step2.
Consumed Energy: Vue_Power_Consumption_on_peak
and then “Use an Entity with the current price:” (The Peak sensors that I created with the Template on step 1): Alectra On Peak Rate
That’s it! The Energy Dashboard will display the 3 sources, Off, On and Mid Peaks with the Energy consumed in each peak and the cost associated.
You will also get a Grid Total that sums all the sources.
I also added the Vue as a Individual Device to easy monitor the total Energy consumption, it should match the Grid Total value.
Anyway, it took me a couple of days to figure all this out by watching youtube videos and reading forums. I know there are a lot of Ontario folks using HA that were asking similar questions, which is why I built this. Just FYI, I am not monitoring each circuit in my house, I am just monitoring the main phases (in Ontario is split phase, 2 hots).
Additional note: the OEB integration also includes everything that technically comes in the Energy Bill of your company, including tax percentage, delivery price and all other necessary attributes to calculate your electrical bill, I didn’t this in my calculation, I tried to understand how the delivery was calculated but I don’t think I understood it well enough, if someone wants to share below how, feel free.