Python Plugin: GoodWe solar inverter via SEMS API

Python and python framework

Moderator: leecollings

Post Reply
dylian
Posts: 1
Joined: Saturday 10 August 2019 2:09
Target OS: Linux
Domoticz version: 4.11077
Location: The Netherlands
Contact:

Python Plugin: GoodWe solar inverter via SEMS API

Post by dylian »

Seeing as the current default Domoticz implementation does not work anymore I decided to try and develop my own plugin for GoodWe inverters. Following the requests made by their website (http://semsportal.com) and reading trough the API documentation I conjured up the following Python Plugin:


EDIT: As dylian94 does not maintain this plugin anymore please use the maintained copy/fork mention below Check the instructions on that repository
https://github.com/JanJaapKo/domoticz-GoodWeSEMS


.
User avatar
sincze
Posts: 1299
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by sincze »

Thanks for sharing! Let me give it a SPIN :D
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
User avatar
sincze
Posts: 1299
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by sincze »

Works like a charm.
Goodwe.JPG
Goodwe.JPG (46.33 KiB) Viewed 15675 times
And already added to official plugins page! (https://www.domoticz.com/wiki/Plugins)
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
henkwel
Posts: 1
Joined: Monday 19 August 2019 17:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by henkwel »

Hi,

Thanks for you work. However I cant seem to it running here on V4.11214.

When trying to add the hardware I get an error saying problem adding hardware. Do you have any idea what might be wrong?
Wiljums
Posts: 28
Joined: Sunday 11 February 2018 21:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Wiljums »

Hi, does it read the data per string? Ideally I would like to read all the data fields you can export manually through semsportal:
Time
WorkMode
Vpv1(V)
Vpv2(V)
Ipv1(A)
Ipv2(A)
Vac1(V)
Vac2(V)
Vac3(V)
Iac1(A)
Iac2(A)
Iac3(A)
Fac1(Hz)
Fac2(Hz)
Fac3(Hz)
Pac(W)
Temperature(℃)
Daily Generation(kWh)
Total Generation(kWh)
HTotal(Hrs)
RSSI(%)
Wiljums
Posts: 28
Joined: Sunday 11 February 2018 21:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Wiljums »

Is it possible to send the data to InfluxDB with this plugin?
User avatar
sincze
Posts: 1299
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by sincze »

Wiljums wrote: Friday 30 August 2019 11:23 Is it possible to send the data to InfluxDB with this plugin?
At the moment I guess not, however if the devices are included in Domoticz you could use the influxDB push functionality of domoticz itself to create nice dataflow and (grafana) graphs.
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
Koploper
Posts: 2
Joined: Sunday 14 October 2018 17:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9700
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Koploper »

Works for me too, thanks!
frandevelop
Posts: 2
Joined: Friday 28 July 2017 12:48
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by frandevelop »

dylian wrote: Saturday 10 August 2019 2:36 goodwe-domoticz-1.png
Hi

Where is this configuration?
In hardware only shows:
Location:
UserName:

Not new devices found and logs show this error:
Error: GoodweAPI: Error getting http user data!

Thanks
ricvee
Posts: 24
Joined: Wednesday 13 May 2015 9:05
Target OS: Linux
Domoticz version: latest
Location: Netherlands
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by ricvee »

Hi,

I can only select: Goodwe solar inverter via Web API
not the GoodWe inverter (via SEMS portal)
What went wrong?
JanJaap
Posts: 191
Joined: Thursday 12 October 2017 20:46
Target OS: Raspberry Pi / ODroid
Domoticz version: Dev
Location: the Netherlands
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by JanJaap »

Hi,

Nice plugin, works great once I worked around a limitation:
password doesn't work for special characters (I had %, &, @ in the pwd). Will see if I can find a fix for that.
RPi 3, Domoticz dev version, Aeon ZWave stick (with a whole bunch of slaves), Zigbee using Zigbee2MQTT, Nest thermo, P1 smart meter on RPi Zero
Nodri
Posts: 16
Joined: Saturday 03 November 2018 21:29
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Nodri »

ricvee wrote: Tuesday 15 October 2019 21:11 Hi,

I can only select: Goodwe solar inverter via Web API
not the GoodWe inverter (via SEMS portal)
What went wrong?
Same here, also i don't get the watt "tile" so can't see how much we're making.
What am i doing wrong??
ricvee
Posts: 24
Joined: Wednesday 13 May 2015 9:05
Target OS: Linux
Domoticz version: latest
Location: Netherlands
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by ricvee »

Hi Nodri,

I fixed this by updating python:
sudo apt-get install python3.4 libpython3.4 python3.4-dev
Now it is working fine!
Hcroij
Posts: 24
Joined: Sunday 27 November 2016 16:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Hcroij »

Just implemented it this morning and looks fine, however the log shows errors.

2019-10-31 11:30:04.504 Error: (Zonnepanelen): Async Secure Read Exception: 1, stream truncated

This happens every few minutes anyone an idea where this is coming from?

Regards
Henk
Hcroij
Posts: 24
Joined: Sunday 27 November 2016 16:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Hcroij »

After some "Googling" found out it has prob to do with "HTTPS://", maybe this helps to solve the problem.


Added later...
Looks that i have solved the problem.
Reinstalled your plugin and it worked without the error.
So I tried to find out what was the difference with the first time.
I do not know if this is the cause or the solution, but think I need to mention it.

During the hardware install the question comes "Global, Europe, or ....." I installed it the first time with "Global"and ofcourse my credentials.
After saving, it did not work oke, so I went back and changed it "Global"to "Europe" (saved again, and the error occurred.

The second time I installed it, I directly set the hardware to "Europe" and I did not get an error message anymore.
I do not know if the above helps but you never know.

Regards
Henk.
Last edited by Hcroij on Friday 01 November 2019 13:29, edited 2 times in total.
Hcroij
Posts: 24
Joined: Sunday 27 November 2016 16:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Hcroij »

Tried to figure out myself but (ofcourse) could not find the solution.

Although the "Devices" (Apparaten) tab shows the total generation of my panels over the years (12475.100kWh) the representation of it shows only the daily generation.
Hope the pictures explain.

I tried to play around with the line :
Devices[self.baseDeviceIndex + 4].Update(nValue=0, sValue=str(inverter["output_power"]) + ";" + str(inverter["etotal"] * 1000))
In the python script, but (I cleared cache in the browser) this did not work for me.
I did some logging on it and found the following line in the log:

2019-11-01 12:27:47.073 (Totaal gegenereerd Paneel) Updating device from 0:'382W;12475200.0' to have values 0:'392W;12475300.0'.

So looking at this, the update is correct but the "Domotics switch" shows only the first value (382W) and disregarding the second value (12475300)


With regards
Henk
Attachments
totaal switch.JPG
totaal switch.JPG (51.66 KiB) Viewed 14509 times
totaal 2.JPG
totaal 2.JPG (25.11 KiB) Viewed 14509 times
JanJaap
Posts: 191
Joined: Thursday 12 October 2017 20:46
Target OS: Raspberry Pi / ODroid
Domoticz version: Dev
Location: the Netherlands
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by JanJaap »

Hi Henk,

The domoticz plug shows you the actual power (in Watt) not the total. You will see totals when you click the 'log' button. The control will show the sum of the day only indeed. If you want a cumulative, you can export the data in the log section.

I'm working on an update of the plugin, can see if I can fit a total in as well (data does not seem to be reported via the SEMS API so may need to do some adding in the plugin.
RPi 3, Domoticz dev version, Aeon ZWave stick (with a whole bunch of slaves), Zigbee using Zigbee2MQTT, Nest thermo, P1 smart meter on RPi Zero
Hcroij
Posts: 24
Joined: Sunday 27 November 2016 16:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Hcroij »

Hallo JanJaap

Would be terriffic if this would work.
My knowledge is not enough to extrat the value from the log.
My max is to fiddel around in a script and change something through trial en error.
So would be great if you could accomplisch this.
uermend
Posts: 5
Joined: Monday 11 February 2019 11:10
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10055
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by uermend »

hi,

You probably need to upgrade to get the screen listed below. I have it running on the lates beta version V4.11468.

regards
Hcroij
Posts: 24
Joined: Sunday 27 November 2016 16:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Hcroij »

Wich screen?
By the way, did an ./updatebeta so I am on version 4.11474.
Even after browser refresh and clearing cache the problem stays.
String has 2 valeus but only representing one.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest