I love the new energy management feature as it is very similar to what I am already using (though significantly easier). As I use some features in existing dashboards I was wondering how I could use the values in existing dashboards without the need to use the energy cards themselves. Would it be possible to extract those values from the database or something?
See below an example which basically shows the energy consumption since midnight.
As my similar FR has rcently been closed I wat to add, what I have written there, bcause I would like to see this FR more generic than only having daily. So if someone from the developers will eventually go in this direction, it would be great to cover is in a very flexible way:
If I want to have an own dashboard with the e.g. energy consumption of several sensors for today or this month, I have to create utility_meter sensors. Same for graphs, etc, e.g.distribution today.
So from a sensor
sensor.foobar_energy_counter
with
state_class: total_increasing
unit_of_measurement: Wh
device_class: energy
I have already four sensors for daily, weekly, monthly and yearly.
energy_counter_foobar_aktor_daily:
source: sensor.foobar_energy_counter
cycle: daily
etc.
But HA can select and display it without such utility_meter sensors.
As this integrations is already number one in loading time and I have already >150 of them (growing) and can only have fix time-ranges with this, I wonder, if it would not be more than beneficial to have direct access to such data, e.g. in a kind of virtual entities, like.
Can someone please explain if it is possible to retrieve the values produced by the Energy Panel on a monthly/weekly/daily basis and use in other home assistant applications ?
If that is the case, how to do it ?
SQL sensors seems to be too complicated and probably not that robust.
The Dashboard does calculate the daily, weekly, monthly usage information directly from the raw data in the database.
So it is not directly possible to use these information in Automations or wherever.
If it is for displaying - you can add specific cards from the Energy Dashboard on other Dashboards, but these cards will just display what you already have in your energy dashboard.
Since you do need to include the source sensors into your energy dashboard, the system is already writing statistics for it - so in my opinion, the best approach should be to use utility meters.
They are basically sum up the states from your source sensors on a specific cycle and then reset.
for example: you do have a sensor for your “total energy consumption” - and this sensor is just continuesly increasing:
Then, create Utility Meters (helpers) - with this sensor as Source - and you could create them with daily, weekly, monthly, quaterly and yearly reset cycles…
You should be able to create utility meters nearly with every sensor that does count something.
Hm, didn’t get this What you are describing is the status quo and the “work-around” and need of creating a lot and more and more utility meters. I cannot count mine anymore and it is delaying the restarts of the system, etc.
And all this, where the dashboards, energy cockpit is able to calculate the same stuff on the fly and without utility meters. Of course, the basis is always the data in the db.
with on the fly calculation (as in the cards and dashboards) and without the need of utility meters, would be very helpfull and the idea of the improvement here.
I am using my MagicMirror to display the state of my home. I would love to be able to simply “query” the energy data directly from entities (as this is how the MagicMirror module works).
In my (non-coder) opinion, this shouldn’t be too complicated, as this data is already being calculated for the dashboard.