Python Plugin: GoodWe solar inverter via SEMS API

Python and python framework

Moderator: leecollings

MikeyMan
Posts: 237
Joined: Wednesday 17 October 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by MikeyMan »

I'm getting the same error now:

Code: Select all

Goodwe SEMS: TokenRequestException: HTTPSConnectionPool(host='www.semsportal.com', port=443): Read timed out. (read timeout=10)
Any known 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 »

The read time outs in general are a known issue, see the Github page. The server did not respond for a configurable (which I set to 10 seconds) amount of time. I made the plugin such that it will retry 3 times and if it did not succeed, then it will throw an error like 'too many retries'. After which it will try again at the next polling interval. So nothing to worry about. And nothing I can fix either.
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
MikeyMan
Posts: 237
Joined: Wednesday 17 October 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by MikeyMan »

Ok, no worries... In general it's working fine!
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'll check it our ASAP. Can you create an issue in Github and add log file with debug logging enabled? Probably the information received from SEMS Portal does not fit the expected format anymore
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
erpi1962
Posts: 3
Joined: Sunday 26 November 2023 17:17
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by erpi1962 »

Hi JanJaap,

Installed your latest (V4) plugin on Domoticz 2023 running in Docker. Hardware created without error, but no Devices appear.
Looking at the log the message is: Error: Zonnepanelen: KeyError: '95000.........9'
Any idea what I am doing wrong? The key is correct and I can log in to the portal and get data with the username/password/ID
Thanks, Erwin
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 »

Why is it when i install the Goodwe sems api pugin an other plugin (CRONBEE) is not working anymore and this plugin complains that there is no requests library ? and i should pip install or pip3 install requests again. (this gives an error also)
When i deinstall the SEMS API plugin the other one is working 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 »

@erpi, did you follow the upgrade instructions to exchange the old key with the serial number of the inverter? Please post some loglines....

@provedance it is hard to say. Normally, these plugins are quite well separated from each other by the plugin framework. Normally, also the dependencies (the libraries you have to install) should not bite each other. Also for you: hard to say anything without logging. Btw normally it is pip3 install.
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
Zeil
Posts: 7
Joined: Sunday 03 December 2023 15:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Zeil »

Hallo,

I'am a new user to Domoticz and the whole Pi scene. I managed to put up a pi with Domoticz and Zigbee2MQTT.
Now i'm trying to add my Goodwe 2500-ns to Domoticz. I've installed your plugin and get the following errors;

2023-12-03 15:59:30,485 Error: Zonnepanelen: Call to function 'onHeartbeat' failed, exception details:
2023-12-03 15:59:30,486 Error: Zonnepanelen: Traceback (most recent call last):
2023-12-03 15:59:30,486 Error: Zonnepanelen: File "/home/jon/domoticz/plugins/domoticz-GoodWeSEMS/plugin,py", line 648, in onHeartbeat
2023-12-03 15:59:30,486 Error: Zonnepanelen: _plugin,onHeartbeat()
2023-12-03 15:59:30,486 Error: Zonnepanelen: File "/home/jon/domoticz/plugins/domoticz-GoodWeSEMS/plugin,py", line 538, in onHeartbeat
2023-12-03 15:59:30,486 Error: Zonnepanelen: self,startDeviceUpdateV2()
2023-12-03 15:59:30,486 Error: Zonnepanelen: File "/home/jon/domoticz/plugins/domoticz-GoodWeSEMS/plugin,py", line 150, in startDeviceUpdateV2
2023-12-03 15:59:30,486 Error: Zonnepanelen: self,updateDevices(DeviceData)
2023-12-03 15:59:30,486 Error: Zonnepanelen: File "/home/jon/domoticz/plugins/domoticz-GoodWeSEMS/plugin,py", line 158, in updateDevices
2023-12-03 15:59:30,486 Error: Zonnepanelen: self,createDevices(inverter["sn"])
2023-12-03 15:59:30,486 Error: Zonnepanelen: File "/home/jon/domoticz/plugins/domoticz-GoodWeSEMS/plugin,py", line 217, in createDevices
2023-12-03 15:59:30,486 Error: Zonnepanelen: numDevs = len(Devices[serialNumber].Units)
2023-12-03 15:59:30,486 Error: Zonnepanelen: KeyError: '12500NSU15300047'

Can you tell me what this means or what i'm doing wrong?
Attachments
Domoticz screen.jpg
Domoticz screen.jpg (249.21 KiB) Viewed 1760 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 »

it is a bit hard to say like this, I'd need some more logging.

Questions:
1) do you recognize the serial number 12500NSU15300047 from your SEMS portal?
2) when looking in th devices page of domoticz, are there any devices created for your solar panels?
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
Zeil
Posts: 7
Joined: Sunday 03 December 2023 15:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Zeil »

1. Serial number is the right one.
2. There are no devices are visible

some other logs..

2023-12-01 15:27:09,162 Status: Zonnepanelen: Entering work loop.
2023-12-01 15:27:09,162 Status: Zonnepanelen: Started.
2023-12-01 15:27:11,180 Status: Zonnepanelen: Initialized version 4,0,0, author 'Jan-Jaap Kostelijk'
2023-12-01 15:27:11,184 Status: Zonnepanelen: Starting Goodwe SEMS API plugin, logging to file goodwe Zonnepanelen,log
2023-12-01 15:33:50,922 Status: Zonnepanelen: Stop directive received.
2023-12-01 15:33:50,999 Status: Zonnepanelen: Exiting work loop.
2023-12-01 15:33:51,023 Status: Zonnepanelen: Stopping threads.
2023-12-01 15:33:51,023 Status: Zonnepanelen: Stopped.
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 »

could you switch debug logging on and look for relevant statements in the mentioned logfile (you might need to change ownership with sudo chown if you want to download it)
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
Zeil
Posts: 7
Joined: Sunday 03 December 2023 15:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Zeil »

Thanks for putting time and energy in my problem. (Noob mode activated) Can you tell me how i switch debug mode on? And do the rest you mentioned!
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 »

See in your screenshot a few posts back the bottom parameter:
Log Level: Normaal
This can be switched to Debug.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Zeil
Posts: 7
Joined: Sunday 03 December 2023 15:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Zeil »

I've switched the the log level from normal to debug. Where can i find this debug?
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 »

In your normal Domoticz log (menu setup - log) you find now more logging regarding this plugin.

You also have to press on update after you have changed the value.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Zeil
Posts: 7
Joined: Sunday 03 December 2023 15:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Zeil »

This is what the log spits out


2023-12-04 18:35:32.826 Zonnepanelen: Worker thread started.
2023-12-04 18:35:32.826 Status: Zonnepanelen: Entering work loop.
2023-12-04 18:35:32.826 Status: Zonnepanelen: Started.
2023-12-04 18:35:33.780 Zonnepanelen: Debug logging mask set to: PYTHON
2023-12-04 18:35:33.781 Zonnepanelen: Parameters count: 25
2023-12-04 18:35:33.781 Zonnepanelen: Parameter: 'HardwareID':'5'
2023-12-04 18:35:33.781 Zonnepanelen: Parameter: 'HomeFolder':'/home/jon/domoticz/plugins/domoticz-GoodWeSEMS/'
2023-12-04 18:35:33.781 Zonnepanelen: Parameter: 'StartupFolder':'/home/jon/domoticz/'
2023-12-04 18:35:33.781 Zonnepanelen: Parameter: 'UserDataFolder':'/home/jon/domoticz/'
2023-12-04 18:35:33.781 Zonnepanelen: Parameter: 'Database':'/home/jon/domoticz/domoticz.db'
2023-12-04 18:35:33.781 Zonnepanelen: Parameter: 'Language':'nl'
2023-12-04 18:35:33.781 Zonnepanelen: Parameter: 'Version':'4.0.0'
2023-12-04 18:35:33.781 Zonnepanelen: Parameter: 'Author':'Jan-Jaap Kostelijk'
2023-12-04 18:35:33.781 Zonnepanelen: Parameter: 'Name':'Zonnepanelen'
2023-12-04 18:35:33.781 Zonnepanelen: Parameter: 'Address':'www.semsportal.com'
2023-12-04 18:35:33.781 Zonnepanelen: Parameter: 'Port':'443'
2023-12-04 18:35:33.781 Zonnepanelen: Parameter: 'Username':'****************.com'
2023-12-04 18:35:33.781 Zonnepanelen: Parameter: 'Password':'****************'
2023-12-04 18:35:33.781 Zonnepanelen: Parameter: 'Key':'GoodWeSEMS'
2023-12-04 18:35:33.781 Zonnepanelen: Parameter: 'Mode1':'ab9******************************18'
2023-12-04 18:35:33.781 Zonnepanelen: Parameter: 'Mode2':'90'
2023-12-04 18:35:33.781 Zonnepanelen: Parameter: 'Mode6':'Debug'
2023-12-04 18:35:33.781 Zonnepanelen: Parameter: 'DomoticzVersion':'2023.2'
2023-12-04 18:35:33.781 Zonnepanelen: Parameter: 'DomoticzHash':'19efd039c'
2023-12-04 18:35:33.781 Zonnepanelen: Parameter: 'DomoticzBuildTime':'2023-07-21 17:23:44'
2023-12-04 18:35:33.781 Zonnepanelen: Device count: 0
2023-12-04 18:35:33.783 Zonnepanelen: Starting version: 4.0.0
2023-12-04 18:35:33.777 Status: Zonnepanelen: Initialized version 4.0.0, author 'Jan-Jaap Kostelijk'
2023-12-04 18:35:33.781 Status: Zonnepanelen: Starting Goodwe SEMS API plugin, logging to file goodwe Zonnepanelen.log
2023-12-04 18:35:36.229 Error: Zonnepanelen: Call to function 'onStart' failed, exception details:
2023-12-04 18:35:36.244 Error: Zonnepanelen: Traceback (most recent call last):
2023-12-04 18:35:36.244 Error: Zonnepanelen: File "/home/jon/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py", line 620, in onStart
2023-12-04 18:35:36.244 Error: Zonnepanelen: _plugin.onStart()
2023-12-04 18:35:36.244 Error: Zonnepanelen: File "/home/jon/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py", line 337, in onStart
2023-12-04 18:35:36.244 Error: Zonnepanelen: self.startDeviceUpdateV2()
2023-12-04 18:35:36.244 Error: Zonnepanelen: File "/home/jon/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py", line 150, in startDeviceUpdateV2
2023-12-04 18:35:36.244 Error: Zonnepanelen: self.updateDevices(DeviceData)
2023-12-04 18:35:36.244 Error: Zonnepanelen: File "/home/jon/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py", line 158, in updateDevices
2023-12-04 18:35:36.244 Error: Zonnepanelen: self.createDevices(inverter["sn"])
2023-12-04 18:35:36.244 Error: Zonnepanelen: File "/home/jon/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py", line 217, in createDevices
2023-12-04 18:35:36.244 Error: Zonnepanelen: numDevs = len(Devices[serialNumber].Units)
2023-12-04 18:35:36.244 Error: Zonnepanelen: KeyError: '12500NSU15300047'
erpi1962
Posts: 3
Joined: Sunday 26 November 2023 17:17
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by erpi1962 »

JanJaap wrote: Tuesday 28 November 2023 22:31 @erpi, did you follow the upgrade instructions to exchange the old key with the serial number of the inverter? Please post some loglines....
JanJaap, My errors are EXACTLY the same as @Zeil posted. From my debugging, it seems the plugin breaks because of the new format that Domoticz expects for JSON commands (which seem to result from the python code). CreateDevices uses Devices call which must be GetDevices now...

Answer to your question: It was a fresh install so no database upgrade needed.

Erwin
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,

I pushed a change a couple of days ago, this should fix it (Apparently I never properly tested a clean install). I think it should work now. I just struggle because I apparently messed up the database, therefore cannot test anything new until I solved that.......

Btw logging is placed in separate log file in the Domoticz directory on your RPi. The name of the file is displayed in the domoticz logging, it is a combination of the plugin name (goodwe) and the name you gave the hardware (probably zonnepanelen) so would be "goodwe zonnepanelen.log"
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
erpi1962
Posts: 3
Joined: Sunday 26 November 2023 17:17
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by erpi1962 »

JanJaap wrote: Tuesday 12 December 2023 9:28 Hey,

I pushed a change a couple of days ago, this should fix it (Apparently I never properly tested a clean install).
Hi JanJaap, with the latest code it works for me.
Thanks!

Erwin
Zeil
Posts: 7
Joined: Sunday 03 December 2023 15:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Zeil »

JanJaap wrote: Tuesday 12 December 2023 9:28 Hey,

I pushed a change a couple of days ago, this should fix it (Apparently I never properly tested a clean install). I think it should work now. I just struggle because I apparently messed up the database, therefore cannot test anything new until I solved that.......

Btw logging is placed in separate log file in the Domoticz directory on your RPi. The name of the file is displayed in the domoticz logging, it is a combination of the plugin name (goodwe) and the name you gave the hardware (probably zonnepanelen) so would be "goodwe zonnepanelen.log"
Did a git pull., and now under devices i see 18 hardware entries from my Goodwe inverter. At the moment it's dark outside, so no numbers to be seen. Will check again if the sun shows up.

I can find my "Goodwe zonnepanelen.log in my Domoticz directory on my Raspi. Tried to copy the file to my windows pc with SSH/Putty. No success yet.
Is there a way to see the log file through SSH? what's the command for that? And is there a way to give the user on a pi "admin" control?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest