Add or show some more data in the energy dashboard by manipulating HA's SQLite-DB #17
Replies: 6 comments 12 replies
-
Sorry for the late reply... Actually the source of my "knowledge" is first of all the work from @mstuettgen (https://github.com/mstuettgen/homeassistant-addons/tree/main/senecweb2mqtt) - and then based on that I am using the "DevTool" build into the Webbrowers in order to analyse request/response (in the network-tab) while I use mein-senec.de web portal... With the network tab you should see the request/URL's when accessing historic data - this can be used then also in the pysenec_ha ... But I am not aware that there is a documented way, how to get data into the EnergyDashboad of HA... but if you succeed then I would be also interested in your approach... For now I still use a Excel to get the final "valid" data over time (for my personal "I did the right thing" feeling... And when I would finally try to merge the data, then I probably will do that via the additional InfluxDB... |
Beta Was this translation helpful? Give feedback.
-
I got my "valid" Data from here - https://mein-senec.de/endkunde/api/statistischeDaten/download?anlageNummer=0&woche=37&jahr=2023 - and of course altered the URL to get all the... all by hand - not by code - then renamed toe csv's to txt (since this will auto-trigger the excel csv2ecxel function (instead of going the Text2Table function)... But this of course just provide you with daily values... When you use python code - make sue that you use the request lib in order to login to mein-senec.de - aiohttp have currently a bug (that will be fixed in 3.9 - since I provided a PR for that)... |
Beta Was this translation helpful? Give feedback.
-
There are some opportunities manipulating HA's SQLite-DB to add or show some more data in the energy dashboard. First step get some historic data in HA's energy dashboard is to change metadata_ids from old "total"-sensors to new ones. In my case I had to start
Should show something similar.
|
Beta Was this translation helpful? Give feedback.
-
no & yes - the old entities are still in the code - as long as the SENEC will not provide any values in the STATISTICS the integration will not add these "old" sensors... But as soon as the SENEC will provide again STAT-data the Entities will reappear after a HA-restart - so you as user should not have to do anything to get them back - (already implemented) |
Beta Was this translation helpful? Give feedback.
-
Hi, so I tried your script with 2021-08-01 to 2023-11-27 It always "broke" because at: if ($state_isNull -or $sum_isNull) { First I think there should be written "$ts_latest" - $latest is not referenced |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Thanks for your improvements to this integration.
I'm using it in favor of https://github.com/mchwalisz/home-assistant-senec since the software upgrade to v825. Also the API-sensors to replace the missing statistics data are great.
As I started with HA couple of month later than my PV was installed there are some data missing in the energy dashboard.
I took a look on your API implementation and I'm wondering if there is any way to get historical statistics from that API. Do you have any documentation of the API? In which cases do I have to use the "old" endpoints?
Would be glad if you can give me some of your knowledge to maybe get these historical statistics.
UPDATE:
In this discussion we documented two suggestions to add or show some more date in the energy dashboard.
First is to get data from old sensors (before v825). Please read here.
Second is a powershell script to create sql statements with api data from senec for adding that data to your energy dashboard.
You can get the script here.
Beta Was this translation helpful? Give feedback.
All reactions