This was just launched yesterday. I haven’t had time to play with it yet, but let’s start talking about it:
For anyone wondering what we’re talking about:
Energy Management in Home Assistant - Home Assistant
I set this up but unfortunately it doesn’t currently align with the sensors from the Sense integration (if you have solar).
It wants “Grid consumption” and “Return to grid” as seen in your screenshot, but Sense provides “Total consumption” and nothing for “Return to grid”.
It’s just a matter of some basic math to get these things so there might be a way with some additional scripting in HA. Maybe the Sense integration will be updated to plug it in easily.
Of course, in the end I don’t think it adds much value beyond what Sense already provides. It’s more of a DIY alternative. I think the only difference is it supports estimated solar production. The biggest benefit I can see is having all the historical data available locally.
That and the graphing. I do like how they graph solar usage and how it gets returned to the grid using negative bars:
I’m still having trouble getting the current power from sense into it myself. I can only see entities for daily and monthly. I haven’t had much time to test it yet, that was just a glance I took the other day.
I’m hoping to have more time with it this weekend.
Oh, that’s not my screenshot, it’s from their blog. I only have solar configured because usage wasn’t correct.
@dannyterhaar and for anyone else here’s some quick and easy instructions.
If you have already setup the energy monitor and want to edit it you can do so at: Configuration → Energy
If you haven’t configured it then just click on the lightning bolt in the left menu.
If you have Sense connected to HA then do the following:
- Add consumption
- Pick sensor.daily_usage
- Add Production
- Pick sensor.daily_production
That’s it. The graph should populate just fine thereafter.
Now here’s the thing. This energy monitor was developed to connect each individual device, not a monitor per se (at least from my take on it). By connecting Sense you are reporting your total power to the graph and therefore connecting additional devices/entities will make the number incorrect as you’ll be duplicating consumption for many devices.
For Sense owners the biggest thing I can see that you’ll get out of this is a fancy little dashboard widget.
When I click on Add consumption I get “You don’t have any statistics” How can I get the Sense addon installed correctly?
I have solved the problem by adding Sense with:
Glad you have it up and working
I’d also like to add here: when adding Consumption, I’d type “daily_” and would get several options. You want to chose the one that starts with Sense_xxxx and is dark gray, vs light grey entries that are (I assume?) inactive placeholders.
The greyed out ones are probably copies of the integration/monitor. You should be able to delete the extra monitor device or delete the integration and add it again.
As an added note, the 2024-11 update of HA now supports adding individual devices from Sense to the Energy dashboard
The bug where HA shows no data from sense from 12am-1am has existed forever and is very annoying…
Maybe I’ll take a look at the HA sense integration and throw some AI at the issue in an attempt to solve it since it’s open source and no one in the community tried to tackle this in years
For other users of this, if you use the yearly total instead of daily you won’t get a gap at midnight.
Sense adds the hourly total at the end of the hour so HA always adds it at the next hour. Long term solution would be to have HA insert it into the previous hour, but that’s a bit more complicated to implement
The values are still incorrect based on the time reported in HA. Even with it set to yearly, 12am will be recorded at 1am. In addition, on Jan 1 of the new year you’ll have a HUGE negative energy value when Sense resets the values.
The only way to have true values corresponding with the correct time of day, and also avoid the annual reset, is to use a template sensor (helper) that uses a trapezoidal rule to convert a W based sensor such as sensor.energy_usage to kWh. If you have solar then you would also need to create another helper prior to the conversion to accurately calculate the true consumption in the case of sell back. (i.e. {{ states(‘sensor.energy_usage’) | float - states(‘sensor.lux_power_to_grid_live’) | float }}).
Below you can see when my EV charges starting at 12am, and it’s reflected correctly.
Lastly, this is not a bug with HA. If anything it’s a bug with Sense. Sense reports the data at 11:59:59pm and then again seconds after 1am. HA is only recording what it’s being fed from Sense. Sense never reports usage from 12AM-1AM because of the daily reset. This is why using a W based sensor from sense that reports every few seconds is the only accurate way to get that data during the correct time of day.
It’s nice to hear from you again, @DevOpsTodd , I’ve missed your input. I am not an HA user (yet), but based on your description, I would like to suggest what might be a simpler solution. Instead of a trapezoidal rule, you might get all the data on the same baseline if you subtract a couple seconds from all the time stamps.
Hey Jeff,
The trapezoidal rule is to convert a unit of power to a unit of energy. You can’t use a watt based sensor on it’s own to display energy consumption.
As for time stamps, I looked into this extensively back when I was trying to solve this issue and unfortunately HA only displays and records data in real time. Per multiple discussions on the HA forums this is not possible. The only solutions found involved exporting from the energy source to CSV, modifying the data and then importing the data to HA. That’s not very feasible for the data from Sense imo.
Creating a helper to handle the conversation isn’t 100% accurate since it’s partially assumption based, but my testing shows that it’s very close and far more accurate than having energy reported on the wrong day especially when you have high loads around midnight, such as EV charging.
Another issue it solves is when you have data from multiple sources. I feed data from Sense and my inverter. If my inverter is reporting in 10 second increments battery, solar and consumption stats but Sense only reports once an hour things don’t align at all. To get these in alignment sampling a sensor from Sense that reports frequently is the only solution that I’ve found.