Python Plugin: GoodWe solar inverter via SEMS API

Python and python framework

Moderator: leecollings

Post Reply
vinjon
Posts: 7
Joined: Tuesday 24 March 2020 9:19
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by vinjon »

it' sworking now, but only for one inverter (i have two in one powerstation)

2021-08-20 11:46:40.623 Error: (GoodWe PV) 'onHeartbeat' failed 'ValueError':'not enough values to unpack (expected 2, got 1)'.
2021-08-20 11:46:40.623 Error: (GoodWe PV) ----> Line 455 in '/home/user/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onHeartbeat
2021-08-20 11:46:40.623 Error: (GoodWe PV) ----> Line 393 in '/home/user/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onHeartbeat
2021-08-20 11:46:40.623 Error: (GoodWe PV) ----> Line 133 in '/home/user/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function startDeviceUpdateV2
2021-08-20 11:46:40.623 Error: (GoodWe PV) ----> Line 164 in '/home/user/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function updateDevices
SolarShed
Posts: 2
Joined: Wednesday 18 August 2021 8:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by SolarShed »

vinjon wrote: Friday 20 August 2021 11:52 it' sworking now, but only for one inverter (i have two in one powerstation)

2021-08-20 11:46:40.623 Error: (GoodWe PV) 'onHeartbeat' failed 'ValueError':'not enough values to unpack (expected 2, got 1)'.
2021-08-20 11:46:40.623 Error: (GoodWe PV) ----> Line 455 in '/home/user/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onHeartbeat
2021-08-20 11:46:40.623 Error: (GoodWe PV) ----> Line 393 in '/home/user/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onHeartbeat
2021-08-20 11:46:40.623 Error: (GoodWe PV) ----> Line 133 in '/home/user/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function startDeviceUpdateV2
2021-08-20 11:46:40.623 Error: (GoodWe PV) ----> Line 164 in '/home/user/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function updateDevices
Hetzelfde bij mij :-) Ik heb maar 1 inverter dus ga voorlopig de errors in de log gewoon negeren ;-)

2021-08-20 13:56:24.859 Error: Inverter: (Inverter) 'onStart' failed 'ValueError':'not enough values to unpack (expected 2, got 1)'.
2021-08-20 13:56:24.859 Error: Inverter: (Inverter) ----> Line 426 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onStart
2021-08-20 13:56:24.859 Error: Inverter: (Inverter) ----> Line 206 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onStart
2021-08-20 13:56:24.859 Error: Inverter: (Inverter) ----> Line 133 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function startDeviceUpdateV2
2021-08-20 13:56:24.859 Error: Inverter: (Inverter) ----> Line 164 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function updateDevices
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 well at least it's working. I'll have a look after my holiday. To get this properly fixed, I do need the complete response of the second call to the Goodwe API, which is too big to fit into the Domoticz loglines (it'll be truncated). This can be retrieved using Postman. If you can send me these response then I can fix it (when I return from holiday....).
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
User avatar
waltervl
Posts: 5149
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 »

OK, this morning my plugin failed too. I updated and put the Plant ID in the mandatory fiel but get errors.
I updated python requests (nothing to update...)

Plugin debug logging giving InvalidURL

Code: Select all

 2021-08-20 19:47:02.068 Goodwe Solar: (Goodwe Solar) startDeviceUpdate, token availability: 'False'
2021-08-20 19:47:02.068 Goodwe Solar: (Goodwe Solar) build tokenRequest with UN: '[email protected]', pwd: 'MyPassword'
2021-08-20 19:47:02.068 Goodwe Solar: (Goodwe Solar) build apiRequestHeaders with token: '{"client": "web", "version": "v3.1", "language": "en-GB"}'
2021-08-20 19:47:02.070 Error: Goodwe Solar: (Goodwe Solar) 'onHeartbeat' failed 'InvalidURL'.
2021-08-20 19:47:02.070 Error: Goodwe Solar: (Goodwe Solar) ----> Line 461 in '/home/udoox86/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py'
2021-08-20 19:47:02.070 Error: Goodwe Solar: (Goodwe Solar) ----> Line 399 in '/home/udoox86/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py'
2021-08-20 19:47:02.070 Error: Goodwe Solar: (Goodwe Solar) ----> Line 129 in '/home/udoox86/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py'
2021-08-20 19:47:02.070 Error: Goodwe Solar: (Goodwe Solar) ----> Line 327 in '/home/udoox86/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py'
2021-08-20 19:47:02.070 Error: Goodwe Solar: (Goodwe Solar) ----> Line 117 in '/usr/local/lib/python3.8/dist-packages/requests/api.py'
2021-08-20 19:47:02.070 Error: Goodwe Solar: (Goodwe Solar) ----> Line 61 in '/usr/local/lib/python3.8/dist-packages/requests/api.py'
2021-08-20 19:47:02.070 Error: Goodwe Solar: (Goodwe Solar) ----> Line 528 in '/usr/local/lib/python3.8/dist-packages/requests/sessions.py'
2021-08-20 19:47:02.070 Error: Goodwe Solar: (Goodwe Solar) ----> Line 456 in '/usr/local/lib/python3.8/dist-packages/requests/sessions.py'
2021-08-20 19:47:02.070 Error: Goodwe Solar: (Goodwe Solar) ----> Line 316 in '/usr/local/lib/python3.8/dist-packages/requests/models.py'
2021-08-20 19:47:02.070 Error: Goodwe Solar: (Goodwe Solar) ----> Line 384 in '/usr/local/lib/python3.8/dist-packages/requests/models.py' 
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
jan54
Posts: 1
Joined: Tuesday 23 January 2018 15:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by jan54 »

The plugin is failing since 17-8-2021.
Already pulled the latest plugin and filled in my serial number, but still no readings.

This are debug messages:
2021-08-20 20:35:24.091 Goodwe: (Goodwe) onHeartbeat called, starting device update.
2021-08-20 20:35:24.091 Goodwe: (Goodwe) startDeviceUpdate, token availability: 'True'
2021-08-20 20:35:24.092 Goodwe: (Goodwe) build stationDataRequest for 1 station, attempt: 1
2021-08-20 20:35:24.092 Goodwe: (Goodwe) build apiRequestHeaders with token: '{"uid": "efcb23f0-9130-43be-bee2-8b3e0ab05a35", "timestamp": 1629483335639, "token": "8a9ed6d8551f6aaffb34bd1d42a5525f", "client": "web", "version": "v3.1", "language": "en-GB"}'
2021-08-20 20:35:24.289 Goodwe: (Goodwe) building station data request on URL: https://eu.semsportal.com/api/v2/PowerS ... rstationId which returned status code: 200 and response length = 414
User avatar
waltervl
Posts: 5149
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 »

waltervl wrote: Friday 20 August 2021 19:49 OK, this morning my plugin failed too. I updated and put the Plant ID in the mandatory fiel but get errors.
I updated python requests (nothing to update...)

Plugin debug logging giving InvalidURL
SOLVED!
I had to do an upgrade of python urllib3:

Code: Select all

sudo pip3 install urllib3 --upgrade
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
pvdgulik
Posts: 21
Joined: Friday 28 December 2018 20:23
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by pvdgulik »

vinjon wrote: Friday 20 August 2021 11:52 it' sworking now, but only for one inverter (i have two in one powerstation)

2021-08-20 11:46:40.623 Error: (GoodWe PV) 'onHeartbeat' failed 'ValueError':'not enough values to unpack (expected 2, got 1)'.
2021-08-20 11:46:40.623 Error: (GoodWe PV) ----> Line 455 in '/home/user/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onHeartbeat
2021-08-20 11:46:40.623 Error: (GoodWe PV) ----> Line 393 in '/home/user/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onHeartbeat
2021-08-20 11:46:40.623 Error: (GoodWe PV) ----> Line 133 in '/home/user/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function startDeviceUpdateV2
2021-08-20 11:46:40.623 Error: (GoodWe PV) ----> Line 164 in '/home/user/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function updateDevices
Hello,

Same problem here, although it's one inverter, two strings. The second string is not working anymore.
I made a issue on https://github.com/JanJaapKo/domoticz-G ... S/issues/4.

Code: Select all

2021-08-21 11:02:26.054 GoodWe GW5000-DT: (GoodWe GW5000-DT) onHeartbeat called, starting device update.
2021-08-21 11:02:26.054 GoodWe GW5000-DT: (GoodWe GW5000-DT) startDeviceUpdate, token availability: 'True'
2021-08-21 11:02:26.054 GoodWe GW5000-DT: (GoodWe GW5000-DT) build stationDataRequest for 1 station, attempt: 1
2021-08-21 11:02:26.054 GoodWe GW5000-DT: (GoodWe GW5000-DT) build apiRequestHeaders with token: '{"uid": "****************************", "timestamp": 1629495111054, "token": "*****************", "client": "web", "version": "v3.1", "language": "en-GB"}'
2021-08-21 11:02:26.265 GoodWe GW5000-DT: (GoodWe GW5000-DT) building station data request on URL: https://eu.semsportal.com/api/v2/PowerStation/GetMonitorDetailByPowerstationId which returned status code: 200 and response length = 28114
2021-08-21 11:02:26.267 GoodWe GW5000-DT: (GoodWe GW5000-DT) create station with id: '***************' and inverters: 1
2021-08-21 11:02:26.267 GoodWe GW5000-DT: (GoodWe GW5000-DT) inverter created: '*************'
2021-08-21 11:02:26.267 GoodWe GW5000-DT: (GoodWe GW5000-DT) PowerStation created: '*****************'
2021-08-21 11:02:26.267 GoodWe GW5000-DT: (GoodWe GW5000-DT) inverter found with SN: '****************'
2021-08-21 11:02:26.267 GoodWe GW5000-DT: (GoodWe GW5000-DT) Status of GoodWe inverter (SN: ****************): '1 generating'
2021-08-21 11:02:26.277 GoodWe GW5000-DT: (GoodWe GW5000-DT) inverter generating, log temp
2021-08-21 11:02:26.285 GoodWe GW5000-DT: (GoodWe GW5000-DT) Update Goodwe solar - Current: nValue 0 - sValue 3.4A - BatteryLevel 255
2021-08-21 11:02:26.293 GoodWe GW5000-DT: (GoodWe GW5000-DT) Update Goodwe solar - Voltage: nValue 0 - sValue 234.7V - BatteryLevel 255
2021-08-21 11:02:26.301 GoodWe GW5000-DT: (GoodWe GW5000-DT) Update Zonnepanelen: nValue 0 - sValue 2397W;11055800.0 - BatteryLevel 255
2021-08-21 11:02:26.308 GoodWe GW5000-DT: (GoodWe GW5000-DT) Update Goodwe solar - string 1 Voltage: nValue 0 - sValue 215V - BatteryLevel 255
2021-08-21 11:02:26.315 GoodWe GW5000-DT: (GoodWe GW5000-DT) Update Goodwe solar - string 1 Current: nValue 0 - sValue 5.8A - BatteryLevel 255
2021-08-21 11:02:26.334 GoodWe GW5000-DT: (GoodWe GW5000-DT) Update Goodwe solar - string 1 Power: nValue 0 - sValue 1247.0;0 - BatteryLevel 255
2021-08-21 11:02:26.335 Error: GoodWe GW5000-DT: (GoodWe GW5000-DT) 'onHeartbeat' failed 'ValueError':'not enough values to unpack (expected 2, got 1)'.
2021-08-21 11:02:26.335 Error: GoodWe GW5000-DT: (GoodWe GW5000-DT) ----> Line 461 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onHeartbeat
2021-08-21 11:02:26.335 Error: GoodWe GW5000-DT: (GoodWe GW5000-DT) ----> Line 399 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onHeartbeat
2021-08-21 11:02:26.335 Error: GoodWe GW5000-DT: (GoodWe GW5000-DT) ----> Line 133 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function startDeviceUpdateV2
2021-08-21 11:02:26.335 Error: GoodWe GW5000-DT: (GoodWe GW5000-DT) ----> Line 164 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function updateDevices
2021-08-21 11:02:36.059 GoodWe GW5000-DT: (GoodWe GW5000-DT) onHeartbeat called, starting device update.
2021-08-21 11:02:36.059 GoodWe GW5000-DT: (GoodWe GW5000-DT) startDeviceUpdate, token availability: 'True'
2021-08-21 11:02:36.059 GoodWe GW5000-DT: (GoodWe GW5000-DT) build stationDataRequest for 1 station, attempt: 1
2021-08-21 11:02:36.059 GoodWe GW5000-DT: (GoodWe GW5000-DT) build apiRequestHeaders with token: '{"uid": "**************************", "timestamp": 1629495111054, "token": "***********************", "client": "web", "version": "v3.1", "language": "en-GB"}'
2021-08-21 11:02:36.286 GoodWe GW5000-DT: (GoodWe GW5000-DT) building station data request on URL: https://eu.semsportal.com/api/v2/PowerStation/GetMonitorDetailByPowerstationId which returned status code: 200 and response length = 28114
2021-08-21 11:02:36.288 GoodWe GW5000-DT: (GoodWe GW5000-DT) create station with id: '************' and inverters: 1
2021-08-21 11:02:36.288 GoodWe GW5000-DT: (GoodWe GW5000-DT) inverter created: '************'
2021-08-21 11:02:36.288 GoodWe GW5000-DT: (GoodWe GW5000-DT) PowerStation created: '***************'
2021-08-21 11:02:36.288 GoodWe GW5000-DT: (GoodWe GW5000-DT) inverter found with SN: '**************'
2021-08-21 11:02:36.288 GoodWe GW5000-DT: (GoodWe GW5000-DT) Status of GoodWe inverter (SN: **************): '1 generating'
2021-08-21 11:02:36.298 GoodWe GW5000-DT: (GoodWe GW5000-DT) inverter generating, log temp
2021-08-21 11:02:36.306 GoodWe GW5000-DT: (GoodWe GW5000-DT) Update Goodwe solar - Current: nValue 0 - sValue 3.4A - BatteryLevel 255
2021-08-21 11:02:36.313 GoodWe GW5000-DT: (GoodWe GW5000-DT) Update Goodwe solar - Voltage: nValue 0 - sValue 234.7V - BatteryLevel 255
2021-08-21 11:02:36.321 GoodWe GW5000-DT: (GoodWe GW5000-DT) Update Zonnepanelen: nValue 0 - sValue 2397W;11055800.0 - BatteryLevel 255
2021-08-21 11:02:36.328 GoodWe GW5000-DT: (GoodWe GW5000-DT) Update Goodwe solar - string 1 Voltage: nValue 0 - sValue 215V - BatteryLevel 255
2021-08-21 11:02:36.336 GoodWe GW5000-DT: (GoodWe GW5000-DT) Update Goodwe solar - string 1 Current: nValue 0 - sValue 5.8A - BatteryLevel 255
2021-08-21 11:02:36.355 GoodWe GW5000-DT: (GoodWe GW5000-DT) Update Goodwe solar - string 1 Power: nValue 0 - sValue 1247.0;0 - BatteryLevel 255
2021-08-21 11:02:36.355 Error: GoodWe GW5000-DT: (GoodWe GW5000-DT) 'onHeartbeat' failed 'ValueError':'not enough values to unpack (expected 2, got 1)'.
2021-08-21 11:02:36.355 Error: GoodWe GW5000-DT: (GoodWe GW5000-DT) ----> Line 461 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onHeartbeat
2021-08-21 11:02:36.355 Error: GoodWe GW5000-DT: (GoodWe GW5000-DT) ----> Line 399 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onHeartbeat
2021-08-21 11:02:36.355 Error: GoodWe GW5000-DT: (GoodWe GW5000-DT) ----> Line 133 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function startDeviceUpdateV2
2021-08-21 11:02:36.355 Error: GoodWe GW5000-DT: (GoodWe GW5000-DT) ----> Line 164 in 
Can you help?

Thanks
User avatar
waltervl
Posts: 5149
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 »

Jan Jaap is on holiday so it will take some time to resolve the remaing issues....
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
HansOtten
Posts: 50
Joined: Saturday 17 April 2021 9:29
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021-1
Location: Mierlo
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by HansOtten »

For those like me not knowing what "Power station ID' is,

- login via a web browser to semsportal.com
- look at the url when the portal is running, something like:

https://www.semsportal.com/powerstation ... /XXXX-xxxx

- the station ID is the number part after powerstatussnmin/ a long numbr

Fill that in in the hardware and things start working, some real info yet, still errors on the log.
So i disabled the plugin waiting for the end of the well deserved vacation of Jan Jaap!

2021-08-25 11:35:24.764 Error: Solar: (Solar) 'onHeartbeat' failed 'ValueError':'not enough values to unpack (expected 2, got 1)'.
2021-08-25 11:35:24.764 Error: Solar: (Solar) ----> Line 461 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onHeartbeat
2021-08-25 11:35:24.764 Error: Solar: (Solar) ----> Line 399 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onHeartbeat
2021-08-25 11:35:24.764 Error: Solar: (Solar) ----> Line 133 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function startDeviceUpdateV2
2021-08-25 11:35:24.764 Error: Solar: (Solar) ----> Line 164 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function updateDevices

Hans
Raspberry Pi 4, SSD, RFlink, P1 Smart Meter. Many Zigbee devices CR2562 USB stick. Bresser via Weather Underground
Switched to Home Assistant!
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 »

All,

I see the errors occur as well when reading in the separate input strings. Output values like power etc work correctly, I assume this is what most people look at daily (at least I do ;) ) so the basic function still works.....

As for the station IID the plugin setup page also describes how to obtain this.

As said, I 'll fix it on return
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
User avatar
HansOtten
Posts: 50
Joined: Saturday 17 April 2021 9:29
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021-1
Location: Mierlo
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by HansOtten »

Indeed the description is on the configuration part!

I was confused by the Power Station ID prompt versus the description 'station ID' as a string of characters, where I saw a string of digits only.
Raspberry Pi 4, SSD, RFlink, P1 Smart Meter. Many Zigbee devices CR2562 USB stick. Bresser via Weather Underground
Switched to Home Assistant!
User avatar
Brutus
Posts: 249
Joined: Friday 26 September 2014 9:33
Target OS: Windows
Domoticz version:
Location: Netherlands
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Brutus »

The timings of the refresh interval are not working the way it needs to be.

When setting the refresh interval to 10 seconds the script pulls every second...
When setting the refresh interval to 30 seconds the script pulls the first time after 30 seconds after that it puls every second...
When setting the refresh interval to 1 minute the script pulls every 10 seconds.
When setting the refresh interval to 5 minutes the script pulls the first time after 5 minutes after that it pulls every 10 seconds...

Greetings
1x Intel NUC8i5BEK (Windows 10 x64) Domoticz on Virtualbox with DietPi.
1x Aeon Labs USB Z-Stick S2
1x P1 Smart Meter USB
28x Fibaro Modules
SMA Solar System
Daikin Airco / Heating
Denon DHT-S716H & DSW-1H
User avatar
waltervl
Posts: 5149
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 »

Brutus wrote: Thursday 26 August 2021 13:56 The timings of the refresh interval are not working the way it needs to be.

When setting the refresh interval to 10 seconds the script pulls every second...
When setting the refresh interval to 30 seconds the script pulls the first time after 30 seconds after that it puls every second...
When setting the refresh interval to 1 minute the script pulls every 10 seconds.
When setting the refresh interval to 5 minutes the script pulls the first time after 5 minutes after that it pulls every 10 seconds...

Greetings
I can confirm, did not notice it yet, was happy that it worked again at last.
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
Brutus
Posts: 249
Joined: Friday 26 September 2014 9:33
Target OS: Windows
Domoticz version:
Location: Netherlands
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Brutus »

Hi,

Im trying to make some scripts but im getting stuck at the output from the GoodWe.

Why is there a W (watt) behind the first number (svalues)?
Knipsel.JPG
Knipsel.JPG (39.47 KiB) Viewed 2514 times
When using this line of code i get an error because I need only numbers. But not there is a number and a letter.

Code: Select all

EnergyImportLow, EnergyImportHigh, EnergyExportLow, EnergyExportHigh, PowerImport, PowerExport = otherdevices_svalues[P1MeterDeviceName]:match("([^;]+);([^;]+);([^;]+);([^;]+);([^;]+);([^;]+)")
Lua doesn't like that. I also think its not needed because the actual sensor adds this on its own.
Knipsel1.JPG
Knipsel1.JPG (20.25 KiB) Viewed 2514 times
Is it possible to remove the W after the number?
Last edited by Brutus on Monday 30 August 2021 12:13, edited 2 times in total.
1x Intel NUC8i5BEK (Windows 10 x64) Domoticz on Virtualbox with DietPi.
1x Aeon Labs USB Z-Stick S2
1x P1 Smart Meter USB
28x Fibaro Modules
SMA Solar System
Daikin Airco / Heating
Denon DHT-S716H & DSW-1H
User avatar
waltervl
Posts: 5149
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 »

Brutus wrote: Monday 30 August 2021 8:52 Why is there a W (watt) behind the first number? When using this line of code i get an error because i need only numbers. But not there is a number and a letter. Lua doesn't like that. I also think its not needed because the actual sensor adds this on its own.

Is it possible to remove the W after the number?
Good questions that @JanJaap can answer but he is on holiday now. So be patient.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Theop
Posts: 2
Joined: Saturday 04 September 2021 13:35
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Theop »

Is er ook ergens een handleiding (stappenplan) te vinden om mijn Goodwe succesvol in Domoticz zichtbaar te krijgen?
rdas
Posts: 12
Joined: Tuesday 13 August 2019 13:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: The Netherlands
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by rdas »

Theop wrote: Saturday 04 September 2021 13:38 Is er ook ergens een handleiding (stappenplan) te vinden om mijn Goodwe succesvol in Domoticz zichtbaar te krijgen?
See https://github.com/janjaapko/domoticz-GoodWeSEMS
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 »

Right so I'm back ;)

I've added a couple of improvements to the plugin, as version 2.0.4 (a restart of Domoticz is required to see the new config description in Domoticz):
- handling the expected exceptions much neater so they do only add 1 logline
- added a fix for the 'unpack' error reported by multiple people which caused the plugin to fail before it would read in data of the second (and 3rd and 4th if available) input strings
- I improved the configuration page of the plugin a bit, so it should be a bit more clear what to do. Still, this requires users not be afraid of computer stuff 8-)

Hope all is fine now again. I will look into dealing with more than 1 inverter later. I will describe how to fetch the API response using postman in the Wiki pages of 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
User avatar
Brutus
Posts: 249
Joined: Friday 26 September 2014 9:33
Target OS: Windows
Domoticz version:
Location: Netherlands
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Brutus »

Hi there,

Hope you had a nice vacation.

What about the things I noticed? The unwanted W in de svalues en de script running not at the given time option?

Greetings
1x Intel NUC8i5BEK (Windows 10 x64) Domoticz on Virtualbox with DietPi.
1x Aeon Labs USB Z-Stick S2
1x P1 Smart Meter USB
28x Fibaro Modules
SMA Solar System
Daikin Airco / Heating
Denon DHT-S716H & DSW-1H
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 »

Right, so the W(att) is not something the plugin does but that comes from how Domoticz deals with these devices, so can't help you there (and I try to avoid lua because python is much nicer). This topic is about the plugin, not about anything you can do with the data in domoticz.

I'll have a look at the updates later, although they look OK on my RPi.
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