kW = POWER live / right now / instantaneous
kWh = ENERGY over time (usually an hour/day)
If I turned on a device that consistently uses 1kW of power and left it running for an hour, it would use 1kWh of energy.
If I used that same device for only 30 mins, it would use 0.5 kWh of energy over 30 mins.
There’s also a fantastic card available in HACS that is based on the HA energy card, so the power view ties in perfectly with the energy view, with heaps of customisation.
Yes it’s very easy indeed.
I’m using 1s data in this view using this add-on but as you mentioned earlier, you need to be very aware of the recording this causes.
I exclude it from the recorder so that I can just use those outputs in real-time views.
Getting a little O.T. but here’s my yaml if you want to cherry pick some of the teaks that I’ve made to it for my house.
Thanks but I just added the hacs integration. I had my sensors and code aligned to yours. Just read all of your posts since and am a tad confused. Figures are not matching again since I could not figure out if I am missing something. Are you able to add detailed instructions please?
As my latest (rest) solution uses a different source of information (net consumption), my template sensors have to calculate the total consumption by adding (production + net), whereas with the native/HACS integrations, the total consumption is already provided as they pull (total) consumption from https://envoy.local/production.json
Oh ok. Think you are being kind. I think I need a what you have in the yaml files inn detail. I am sure I have missed a few things. I also notice you have changed the names of your sensors.
Correct, due to the different (net) consumption information provided by https://envoy.local/ivp/meters/readings, my solution is no longer directly compatible with either the native or HACS integration anymore, hence the simplified sensor names.
I am now running independent of any integrations.
Why am I doing this?
2 reasons:
I can choose the rest sensor update frequency myself.
Here is a good example of the latency differences between the 2 different sources of information.
For this reason, I prefer to just use the rest sensors to extract only the information that I am interested in from the Envoy and then I just rely on the home assistant template sensors to perform the required calculations instead.
I would like to mimic what you have as its served me well. Therefore would be greatfull if you can post your config and settings again if ok. Even have the apexchart thing which is awesome.
matching data in envoy (slight variation due to the lag it takes for envoy update the page at https://envoy.local/home)
In the meantime, I have been working on extracting/calculating the lifetime energy odometers from https://envoy.local/ivp/meters/readings using the same rest sensor as well.
Here is a preview of what I have been working on.
Obviously the envoy rounds up to the nearest .X decimal when viewing via https://envoy.local/home
I will do a complete solution write up for both power sensors (kW) and energy sensors (kWh) soon once I have time. I might even make a whole new topic just to save confusion as reading through 2 years worth of 674 posts is a big ask for anyone.
Power Export (Calculated) (production-consumption)
3281.97
3.28
template sensor calculation
Power Import (Calculated) (consumption-production)
0.00
0.00
Lifetime Energy figures:
Source: /ivp/meters/readings
Energy - Planned sensor naming in Home Assistant
Wh
MWh
value_json[0].actEnergyDlvd
Energy Production
25144588.32
25.14
value_json[1].actEnergyDlvd
Energy Import
11702118.55
11.70
value_json[1].actEnergyRcvd
Energy Export
10227297.59
10.23
template sensor calculation
Energy Net (Calculated) (import-export)
1474820.95
1.47
template sensor calculation
Energy Consumption (Calculated) (production+net)
26619409.28
26.62
I am able to get all this information from 1 single rest call/query every X seconds.
You can choose your own update interval in X seconds to suit your database sizing as updating these sensors more often will increase the database storage space needed to hold the history for graphing if you dont exclude these from the recorder.
My hope in using the lifetime energy odometers is that the energy figures will be more accurate if home assistant goes down for a restart or any similar event that would cause the integration sensors that I previously had in my solution to miss any gaps in recording.
Using the lifetime CT Clamp energy odometers instead will remove the need for the integration sensor and increase accuracy specifically in the energy dashboard.
Thanks @del13r . Your solution with REST works a lot better for me that the built-in integration or HACS integration. Better in that it seems to be more reliable — no more drop-outs at unknown times. Also, as you say, it is more responsive to immediate power changes. I used HA’s Riemann Sum Integral to get the energy, and that is also a lot more reliable compared to the HACS integration. HACS integration was giving me occasionally huge spikes, 10,000’s of kWH for day energy use, and unreliable numbers in the case of power outages.
I’ve got a new and improved solution that doesn’t use Riemann Sum Integral sensors for energy anymore.
Just currently testing that it works perfectly and documenting how I did it in a new topic.
Watch this space.