Support for GivEnergy #151
Replies: 25 comments 8 replies
-
|
1. My Home Assistant database has corrupt energy data in it, is there an easy way to remove this first before I import new data? It depends on what "corrupt" means in your case. Using the 2. Given the 3 uploads above, what do I need to do next and can anyone help please? 3. What do I do with the python script that I used to grab the data from GivEnergy, is this located in this repository or in my own area elsewhere? The workflow could be:
4. The data from GivEnergy is at varying times and not regular, I have a variable in the python script to only output data when there is any change, is this OK? Does that also apply to historical data because I don't understand the changed part in the context of historical data? I saw for realtime data that there is a HACS integration. You are probably using that one, correct? |
Beta Was this translation helpful? Give feedback.
-
|
Hi and thanks for the quick reply,
Thanks again 😄 |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
I gave it a go and created the script for GivEnergy (see below file). I did not use the
Could you check whether this works for you? @davesmeghead, if this works we could rebuild your script into a script that fetches the json files for a specified period. |
Beta Was this translation helpful? Give feedback.
-
|
I'm just in the middle of testing and it's looking good. I added the following to your GivEnergyDataPrepare to get the battery charge/discharge history I took a copy of my db to work on and followed your instructions, using "Option 1: Use the Sensors.py script (GUI)" and it seemed to work, at least no errors or anything like that. I then remembered that I need to delete all historic data first so I'm just finishing a python script to do the sql, here it is I you get time to take a look and have comments then please let me know, I "sql" delete from the state, statistics and statistics_short_term data tables, is this correct? This seems to work on a copy of the home assistant db So all I need to do is put it all together, take a copy of the db, run my delete script and then follow your process. I can't do it now as I have to go out, I'll have a go later today and let you know. Feel free to use whatever you need from any of the python scripts |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
Could you test the below script? |
Beta Was this translation helpful? Give feedback.
-
|
Hi, I'm just walking through the process now and saw your post. I tried your download script but couldn't get it working: Am I doing it right? I also tried "" like this and it did the same |
Beta Was this translation helpful? Give feedback.
-
|
This is my output based on your parameters. I am getting errors because the API-token is invalid. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
I'm sorry but I should have said, that is not my API Token or my Serial number. If I gave that out to anyone then they would have full access to my system and I'm not going to do that. It was a problem with the date format that seemed to be the error Maybe it's an issue because of the length of the API Token, it's 1476 characters long, I'm on windows 11, how long can a command line be? EDIT: just googles and it should be OK So it might be because the API Token includes punctuation etc |
Beta Was this translation helpful? Give feedback.
-
|
Yeah it must be the API Token I get the same as you like this But when I include the real API Token and Serial it tells me about the invalid date |
Beta Was this translation helpful? Give feedback.
-
|
Sorry for the rapid updates I just tried putting it in to a PowerShell script as testy.ps1 and it's working so I don't know what I did wrong with the command prompt. Whenever I try it using a command prompt though it fails. |
Beta Was this translation helpful? Give feedback.
-
|
The total for GRID and SOLAR is an increasing value so for the elec_battery_feed_in_high_resolution.csv |
Beta Was this translation helpful? Give feedback.
-
|
Things to check for the battery:
|
Beta Was this translation helpful? Give feedback.
-
|
Yeah I:
This is the SQLite that your python created So it all looks correct to me, but as I said it's not really a problem for me personally. EDIT: I also know that it worked because it's replaced my bad data from last year. |
Beta Was this translation helpful? Give feedback.
-
|
Can you have a new look at the updated script? |
Beta Was this translation helpful? Give feedback.
-
|
I'll give that a go now Just to complete what I said earlier, this is what I have in my GivenergyDataPrepare file |
Beta Was this translation helpful? Give feedback.
-
|
Yes your GrabGivEnergyData script works with the api token in a file (again I've replaced my serial number with "MySerial"). |
Beta Was this translation helpful? Give feedback.
-
|
Could you use the below script for the battery data? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
I created the remaining files (README, tests) and have added GivEnergy as a datasource to the repository, |
Beta Was this translation helpful? Give feedback.
-
|
Hi again, |
Beta Was this translation helpful? Give feedback.



Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm asking for help to import GivEnergy data in to Home Assistant. I have written a python script to grab the data from the GivEnergy API and I have it in a csv file of my own format. Note that I have solar panels and a battery, with a single inverter.
This is my python script
grab_givenergy_data.zip
This is an example of my output data in the created csv file (1st Nov 2025 to 7th Nov 2025)
output.zip
GivEnergy only allow data points for a single day to be grabbed at a time through the API. The following file is an example of 1 day of the json format that I get from GivEnergy (as per the intermediate step in my python script where I save it to a file in the temporary directory)
MeterData_2025-11-02 - sanitised.zip
Note that in the "links" and "meta" I have removed all sensitive data of my inverter.
So now on to my questions that I'm hoping you can help with
Any help would be appreciated, thanks
Beta Was this translation helpful? Give feedback.
All reactions