Python Plugin: GoodWe solar inverter via SEMS API

Python and python framework

Moderator: leecollings

User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by waltervl »

Still a lot of errors. Also seems to be crashing my domoticz sometimes

Code: Select all

 Error: Goodwe Solar: RequestException: HTTPSConnectionPool(host='eu.semsportal.com', port=443): Read timed out. (read timeout=5)
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Arnoud
Posts: 6
Joined: Thursday 10 November 2016 21:37
Target OS: Linux
Domoticz version: 2022.1
Location: The Netherlands
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Arnoud »

Plenty of error here as well, and if I look at my graph of the past 24 hours, it looks like the Goodwe servers are overloaded from 10:00 CET to roughly 17:30. I get decent updates during the evening, night, but during the day a large part of the requests are timing out.

2022-08-19_181401.png
2022-08-19_181401.png (32.79 KiB) Viewed 2741 times
jslegers
Posts: 34
Joined: Tuesday 23 February 2016 9:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9700
Location: NL
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by jslegers »

I moved away from the plugin due to the errors I got lately.
User sincze has a great script for reading out the SEMS Portal :

https://github.com/sincze/Domoticz/blob ... Goodwe.php

I have used this script for a week now and it is running fine.
To keep my history of the plugin I replaced the device with the new one that needs to be created.

Don't forget to make a backup first of the database just to be safe ;)
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by waltervl »

jslegers wrote: Tuesday 23 August 2022 9:04 I moved away from the plugin due to the errors I got lately.
User sincze has a great script for reading out the SEMS Portal :

https://github.com/sincze/Domoticz/blob ... Goodwe.php

I have used this script for a week now and it is running fine.
To keep my history of the plugin I replaced the device with the new one that needs to be created.

Don't forget to make a backup first of the database just to be safe ;)
This would mean it is solvable also in Python plugin. Something changed at API side that hampers somehow.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
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 »

waltervl wrote: Tuesday 23 August 2022 11:18
jslegers wrote: Tuesday 23 August 2022 9:04 I moved away from the plugin due to the errors I got lately.
User sincze has a great script for reading out the SEMS Portal :

https://github.com/sincze/Domoticz/blob ... Goodwe.php

I have used this script for a week now and it is running fine.
To keep my history of the plugin I replaced the device with the new one that needs to be created.

Don't forget to make a backup first of the database just to be safe ;)
This would mean it is solvable also in Python plugin. Something changed at API side that hampers somehow.
It is indeed, but don't have the time to do it.
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
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by waltervl »

I made an issue in the plugin GitHub. Hopefully JanJaap can fix this....
https://github.com/JanJaapKo/domoticz-G ... /issues/17
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
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 »

Good idea indeed.
It will require the necessary changes.
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.
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 »

Hey guys,

On a quick glance I see indeed that you're accessing some different URL (CheckClientIpIsVN), I'll have a look into that. I also noticed the increase in time-outs. Odd though, you'd expect something to work or not, but not something half as this.... Anyway, I'll dig in.
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
Arnoud
Posts: 6
Joined: Thursday 10 November 2016 21:37
Target OS: Linux
Domoticz version: 2022.1
Location: The Netherlands
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Arnoud »

I am pretty sure it is an overloading of the GoodWe servers that is causing this.

This morning was better than most other recent days, but this afternoon the timeouts started to increase again.
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 »

Hey Arnoud. This sounds plausible. The php script of sincze does not implement time-outs. When running it from terminal, it takes quite some time, so it might trigger time-outs as well. In Domoticz it is undesired to block all operations on waiting for a webserver response, hence the time-outs. I'm checking out his script anyway since he's using other endpoints which is interesting.....
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
Arnoud
Posts: 6
Joined: Thursday 10 November 2016 21:37
Target OS: Linux
Domoticz version: 2022.1
Location: The Netherlands
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Arnoud »

By the way, I noticed today that the yellow warning LED on my inverter was blinking. Turned out to be "WiFi server error" (i.e. cloud server connection error). After a few minutes it turned solid yellow again. Hadn't seen that before.

Direct readout might become more attractive if GoodWe doesn't fix this.
niceandeasy
Posts: 102
Joined: Thursday 28 January 2016 22:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: NL
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by niceandeasy »

Hi, y'all,

My housing corp deployed solar panels with GoodWE inverters, with 4G modules instead of WiFi. That's why I'm here. I cannot communicate with the GoodWE directly, so I have to use the SEMS API.
I implemented JanJaap's plug-in. Seems to work okay. But I'm dreading the fact that my Domoticz will be unstable or freezing, just because GoodWE fails to operate a reliable web site.
Anyway, I'm happy to find a user community here. You guys helped me a lot already. I made the mistakes: using the non-functional plug-in that comes with Domoticz. Installing JanJaap's product. Then, finding out that I need to remove the Domoticz one and add JanJaap's version. Add the requests. Fixing my pip. Setting Python3 as the default.
Anyways, it's working, now. I'm using 5 minutes update interval. The default.

I also implemented "Power consumption device script - SunnyBoy 20180523", found on the Domoticz WiKi. It calculates how much power my house is using, from the smart meter usage data and the solar inverter output data.
This script have me an error, because one of the svalues of the inverter power output had a "W" at the end. Cannot calculate with "W", so I added a line in the script that strips the W.
solar_p, solar_e = otherdevices_svalues[solarmeter]:match("([^;]+);([^;]+)")
solar_p = string.gsub(solar_p,"W","") --added for removing the W

I think there should not be a W.
For the rest: no issues.
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,

Glad you like the plugin. I'll try to get the not-working hardware 'web API' removed, as it isn't working anymore.

I've built in time outs (don't worry, you'll see some in your log) to avoid Domoticz hanging on a not responsive API call. The energy data is then update on next successful call (the power data obviously not). Works quite well.

I've heard other people talk about that 'W' but I thought this just came from Domoticz?
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
gregoinc
Posts: 18
Joined: Sunday 08 November 2020 8:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by gregoinc »

Hello... new to GoodWe Inverters and this plugin. Followed the installation instructions, but it doesn't appear to work? Here's what my log is showing...

Code: Select all

2022-12-17 22:01:32.017 Status: WebServer(HTTP) started on address: :: with port 8080
2022-12-17 22:01:32.067 Status: WebServer(SSL) started on address: :: with port 443
2022-12-17 22:01:32.081 Status: TCPServer: shared server started...
2022-12-17 22:01:32.082 Status: RxQueue: queue worker started...
2022-12-17 22:01:34.086 Status: EventSystem: reset all events...
2022-12-17 22:01:34.090 Status: NotificationSystem: thread started...
2022-12-17 22:01:34.090 Status: GoodWe Inverter: Worker started, using server URL https://au.goodwe-power.com/...
2022-12-17 22:01:34.091 Status: EventSystem: reset all device statuses...
2022-12-17 22:01:34.096 Status: EventSystem - Python: Failed dynamic library load, install the latest libpython3.x library that is available for your platform.
2022-12-17 22:01:34.099 Status: EventSystem: Queue thread started...
2022-12-17 22:01:34.100 Status: EventSystem: Started
2022-12-17 22:07:04.129 Status: GoodWe Inverter: Worker stopped...
2022-12-17 22:07:04.138 Status: GoodWe Inverter: Worker started, using server URL https://hk.goodwe-power.com/...
2022-12-17 22:07:59.786 Status: GoodWe Inverter: Worker stopped...
2022-12-17 22:07:59.790 Status: GoodWe Inverter: Worker started, using server URL https://hk.goodwe-power.com/...
2022-12-17 22:08:01.865 Status: GoodWe Inverter: Worker started, using server URL https://hk.goodwe-power.com/...
2022-12-17 22:08:08.483 Status: GoodWe Inverter: Worker stopped...
Any suggestions appreciated.

Figured out the error was due to Python not installed. And now I see...

Code: Select all

2022-12-17 22:25:53.575 Status: Domoticz V2022.2 (c)2012-2022 GizMoCuz
2022-12-17 22:25:53.580 Status: Build Hash: eea9db734, Date: 2022-11-05 23:05:35
2022-12-17 22:25:53.581 Status: Startup Path: /home/grego/domoticz/
2022-12-17 22:25:54.419 Status: PluginSystem: Started, Python version '3.9.2', 2 plugin definitions loaded.
2022-12-17 22:25:54.470 Status: WebServer(HTTP) started on address: :: with port 8080
2022-12-17 22:25:54.518 Status: WebServer(SSL) started on address: :: with port 443
2022-12-17 22:25:54.533 Status: TCPServer: shared server started...
2022-12-17 22:25:54.533 Status: RxQueue: queue worker started...
2022-12-17 22:25:56.537 Status: EventSystem: reset all events...
2022-12-17 22:25:56.541 Status: EventSystem: reset all device statuses...
2022-12-17 22:25:56.542 Status: NotificationSystem: thread started...
2022-12-17 22:25:56.543 Status: GoodWe Inverter: Worker started, using server URL https://hk.goodwe-power.com/...
2022-12-17 22:25:56.875 Status: Python EventSystem: Initializing event module.
2022-12-17 22:25:56.878 Status: EventSystem: Started
2022-12-17 22:25:56.878 Status: EventSystem: Queue thread started...
2022-12-17 22:28:10.251 Status: GoodWe Inverter: Worker stopped...
2022-12-17 22:28:10.255 Status: GoodWe Inverter: Worker started, using server URL https://au.goodwe-power.com/...
2022-12-17 22:28:31.649 Status: GoodWe Inverter: Worker stopped...
2022-12-17 22:28:31.652 Status: GoodWe Inverter: Worker started, using server URL https://au.goodwe-power.com/...
2022-12-17 22:28:38.383 Status: GoodWe Inverter: Worker stopped...
2022-12-17 22:28:38.386 Status: GoodWe Inverter: Worker started, using server URL https://au.goodwe-power.com/...
But still no data?? I must be doing something else 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 »

Looks like you're using the Web app version, not the sems app version. Please check carefully which one you selected
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
gregoinc
Posts: 18
Joined: Sunday 08 November 2020 8:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by gregoinc »

Hi JanJaap,

I wasn't aware there were two types? I have a Raspberry Pi running raspian, with Domoticz running on it. So which version should I use to be able to retrieve the data from my SEMS account?

This is the guide I followed... https://github.com/dylian94/domoticz-GoodWeSEMS

Thanks, Mark
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 »

OK, so Dylian stopped maintaining that plugin a couple of years ago (it is set to archived for that). So first thing to do is remove the old version and then you need to follow instructions and pull from here: JanJaapKo - GoodweSEMS. Then secondly, make sure to select the right one in the hardware page:
Somoticz GoodweSEMS.PNG
Somoticz GoodweSEMS.PNG (4.48 KiB) Viewed 2309 times
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
gregoinc
Posts: 18
Joined: Sunday 08 November 2020 8:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by gregoinc »

JanJaap wrote: Sunday 18 December 2022 14:14 OK, so Dylian stopped maintaining that plugin a couple of years ago (it is set to archived for that). So first thing to do is remove the old version and then you need to follow instructions and pull from here: JanJaapKo - GoodweSEMS. Then secondly, make sure to select the right one in the hardware page:
Somoticz GoodweSEMS.PNG
Thank you for the guidance. I followed the steps for the API, and everything worked really well. Much appreciated.
provedance
Posts: 6
Joined: Wednesday 28 February 2018 15:23
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by provedance »

Hi,
With this plugin i get 2 outputs in WATT's form my solar with a slightly difference (lower). Why are there 2 ?
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 »

I can't really answer that without showing which ones you exactly mean.......
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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest