borft / py-goodwe

Python lib to query Goodwe inverters
GNU General Public License v3.0
15 stars 2 forks source link

Influxdb Support? #1

Closed gruselglatz closed 3 years ago

gruselglatz commented 3 years ago

Hey! Thanks for this great tool, I will try it out as soon as my PV goes online. But do you mind adding support for InfluxDB? When you don't want to add it, i will read into your code and try to implement it on my own, but I got little free time atm. So it could take a while :)

Because for ppl which use InfluxDB and Grafana we can keep our setup as minimal as possible.

I will happily contribute a Grafana Dashboard, as soon as i can try it out. :)

borft commented 3 years ago

Sounds like a good idea. Quite busy this week, ,but when I have some spare time, I'll have a look at what I can do. I haven't used influxDB before, but judging from the Python API, it doesn't look too hard to make it work.

gruselglatz commented 3 years ago

I've got mine today, I will try some magic with jq and post the data with curl. When it works I can share it. But the python version would be more sophisticated i think. :)

gruselglatz commented 3 years ago

Sadly the script seems not to work with the ET series.

I changed the message to this:

msg = bytes(b'\xaa\x55\xc0\x7f\x01\x02\x00\x02\x41') #AA55C07F0102000241

Then i get this:

(b'\xaaU\x7f\xc0\x01\x82L0404=GW10K-ET  \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x009010KETU209W0162\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1e02041-13-S0=\x0c\xb3', ('192.168.1.211', 8899))

It seems like there is already an implementation ( https://github.com/mletenay/home-assistant-goodwe-inverter/blob/master/custom_components/goodwe/goodwe_inverter.py ), but I dont get it quite right how to handle it. Your script seems pretty lightweight and i dont want to setup Hass.io only for this sensor. Do you have some spare time to help me? Thanks in advance

gruselglatz commented 3 years ago

OK I've got it to work with the other implementation. I rebuilt the testscript to only output the data in the correct way for influxdb. and send it to influx via curl.

borft commented 3 years ago

ok, works for me ;) Hadn;t tested it on other GW inverters.