Python Plugin: GoodWe solar inverter via SEMS API

Python and python framework

Moderator: leecollings

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 »

Well you'd need to post some logging to see why it would cause the crash. There are multiple users without issues so maybe you missed some of the preconditions?
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
whoami
Posts: 73
Joined: Tuesday 31 March 2020 22:31
Target OS: -
Domoticz version:
Location: Dutch
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by whoami »

I see that since the 4th of january I get the message:

"Failed to request data: Failed to call GoodWe API (return code = 100007)"
rebooting or restarting wont help.

Does anybody has this same message?

EDIT: selected europe and it works 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 »

I had the same issue, restarted the plugin and logged in with the Goodwe app and it worked again.....
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
jspeybro
Posts: 3
Joined: Tuesday 18 January 2022 15:45
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by jspeybro »

Hi,

I'm trying to get this plugin running, but get this in the logs:

Code: Select all

 2022-01-18 16:40:33.609 Error: GoodWe Solar Inverter: (GoodWeSEMS) failed to load 'plugin.py', Python Path used was '/config/plugins/domoticz-GoodWeSEMS-master/:/usr/lib/python38.zip:/usr/lib/python3.8:/usr/lib/python3.8/lib-dynload:/usr/local/lib/python3.8/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.8/dist-packages'.
2022-01-18 16:40:33.610 Error: GoodWe Solar Inverter: (GoodWe Solar Inverter) Module Import failed, exception: 'ModuleNotFoundError'
2022-01-18 16:40:33.610 Error: GoodWe Solar Inverter: (GoodWe Solar Inverter) Module Import failed: ' Name: requests'
2022-01-18 16:40:33.610 Error: GoodWe Solar Inverter: (GoodWe Solar Inverter) Error Line details not available.
2022-01-18 16:40:38.886 Error: Goodwe Solar Inverter: Error getting http user data! 
I'm running domoticz in a docker container on libreElec.

Python is installed, but maybe I'm missing some additional packages?
any idea?

thanks
regards,
Johan
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 »

Yes, you are missing the 'request' package as indicated in the log. Please see installation instructions. Be aware that the installation path may depend on the user that makes the instalaltion. Your logfile mentions the path below as to look for the requests package.

'/config/plugins/domoticz-GoodWeSEMS-master/:/usr/lib/python38.zip:/usr/lib/python3.8:/usr/lib/python3.8/lib-dynload:/usr/local/lib/python3.8/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.8/dist-packages'.
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
jspeybro
Posts: 3
Joined: Tuesday 18 January 2022 15:45
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by jspeybro »

ok, got it to work by copying manually the required modules to the Goodwe plugin directory
in case someone else needs it for libreelec 10:
I had to get these libraries from here:

https://github.com/psf/requests
https://github.com/urllib3/urllib3
https://github.com/chardet/chardet
https://github.com/kjd/idna
https://github.com/certifi/python-certifi

I unpacked them and copied the subdirectory with the library name to
/storage/.kodi/userdata/addon_data/docker.linuxserver.domoticz/config/plugins/domoticz-GoodWeSEMS-master/

after that, the devices show up and can be added to domoticz.

thanks for the plugin.

any way you can also get it to download all the historic data?
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 »

Perhaps consider to use a docker container on LibreElec:
https://www.domoticz.com/wiki/Docker
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
jspeybro
Posts: 3
Joined: Tuesday 18 January 2022 15:45
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by jspeybro »

that's what I did, but then I didn't find how I should add the extra libraries that were required for python. just adding them manually to the plugin seemed to work for me but if there's a better way, I'm all ears.
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 »

Other way is to install them within the docker container with

docker exec -it domoticz
And then in that shell
pip3 install "module"

You have to install them every time you upgrade the docker container. There is already an discussion to have some kind of script in the container to have them installed after update.
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
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 »

There seems to be a Python library that is reading the Goodwe inverter directly. See https://domoticz.com/forum/viewtopic.ph ... 56#p285656

Is it possible to create a plugin for this? Should be better than scraping the cloud. Also when the cloud portal is gone (like Omnik) you can continue to monitor your inverter.

It seems that this libary is very usable for Domoticz: https://github.com/marcelblijleven/goodwe
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
tykasan
Posts: 2
Joined: Thursday 07 April 2022 15:41
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by tykasan »

Hello Everyone,
I;'d like to ask you, about compatility issues on Domoticz Version: 2021.1
After update I dont have field for password and plugin wont connect.
I tried to clear browser cache/incognito mode/ domoticz reinstall/ plugin reinstall... nothing works...

Im thinking to revert back to versio 2020.03.

Can you please advise
M
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'm running latest development with no issues.... Perhaps try a clean installation?
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
tykasan
Posts: 2
Joined: Thursday 07 April 2022 15:41
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by tykasan »

Thank for suggestion. I was hoping for not having to do so...
But yes, it worked....

fortunately I had a copy of working backup (not the latest one) but it will save me a lot of time to cofigure

Thank you for your input!
Darsh
Posts: 12
Joined: Tuesday 21 February 2017 13:37
Target OS: Linux
Domoticz version: 2022.1
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Darsh »

Plugin version 1.1.1, author 'dylian94'
Domoticz version: 2022.1 (build 14231)
Starting from today 02:45 UTC, the plugin crashes, stopping Domoticz as well:

Code: Select all

2022-04-12 03:45:14.510  GoodWe GW2500-NS: Station data received from GoodWe SEMS API (Station ID: cf85dc2c-8e0c-4aa9-8572-dd768e7e4a55)
2022-04-12 03:45:14.510  Error: GoodWe GW2500-NS: Call to function 'onMessage' failed, exception details:
2022-04-12 03:45:14.526  Error: Domoticz(pid:2724734, tid:2724767('GoodWe GW2500-N')) received fatal signal 11 (Segmentation fault)
2022-04-12 03:45:14.526  Error: siginfo address=0x770029937e, address=0x7f3a7b854fe1
2022-04-12 03:45:14.533  Error: Failed to start gdb, will use backtrace() for printing stack frame
2022-04-12 03:45:14.674  Error: #0  /home/domovoi/domoticz/domoticz :  + 0x3f1c33 [0x55e20d807c33]
2022-04-12 03:45:14.674  Error: #1  /home/domovoi/domoticz/domoticz : signal_handler(int, siginfo_t*, void*) + 0x29d [0x55e20d80871d]
2022-04-12 03:45:14.674  Error: #2  /lib/x86_64-linux-gnu/libpthread.so.0 :  + 0x14140 [0x7f3a7b855140]
2022-04-12 03:45:14.674  Error: #3  /lib/x86_64-linux-gnu/libpthread.so.0 : raise + 0x141 [0x7f3a7b854fe1]
2022-04-12 03:45:14.674  Error: #4  /lib/x86_64-linux-gnu/libpthread.so.0 :  + 0x14140 [0x7f3a7b855140]
2022-04-12 03:45:14.674  Error: #5  /usr/lib/x86_64-linux-gnu/libpython3.9.so :  + 0x1249d8 [0x7f3a7a68c9d8]
2022-04-12 03:45:14.674  Error: #6  /usr/lib/x86_64-linux-gnu/libpython3.9.so : _PyObject_MakeTpCall + 0x90 [0x7f3a7a62ea50]
2022-04-12 03:45:14.674  Error: #7  /usr/lib/x86_64-linux-gnu/libpython3.9.so : _PyEval_EvalFrameDefault + 0x7248 [0x7f3a7a5def08]
2022-04-12 03:45:14.674  Error: #8  /usr/lib/x86_64-linux-gnu/libpython3.9.so :  + 0x1a4ddc [0x7f3a7a70cddc]
2022-04-12 03:45:14.674  Error: #9  /usr/lib/x86_64-linux-gnu/libpython3.9.so : _PyFunction_Vectorcall + 0x9d [0x7f3a7a629c7d]
2022-04-12 03:45:14.674  Error: #10 /usr/lib/x86_64-linux-gnu/libpython3.9.so :  + 0xc8724 [0x7f3a7a630724]
2022-04-12 03:45:14.674  Error: #11 /usr/lib/x86_64-linux-gnu/libpython3.9.so : PyObject_CallFunctionObjArgs + 0x9f [0x7f3a7a630baf]
2022-04-12 03:45:14.674  Error: #12 /home/domovoi/domoticz/domoticz : Plugins::CPlugin::LogPythonException() + 0x1bc [0x55e20dca519c]
2022-04-12 03:45:14.674  Error: #13 /home/domovoi/domoticz/domoticz : Plugins::CPlugin::Callback(_object*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, _object*) + 0x1b6 [0x55e20dca7806]
2022-04-12 03:45:14.674  Error: #14 /home/domovoi/domoticz/domoticz : Plugins::onMessageCallback::ProcessLocked(Plugins::CPlugin*) + 0x1b3 [0x55e20dcc81b3]
2022-04-12 03:45:14.674  Error: #15 /home/domovoi/domoticz/domoticz : Plugins::CPluginMessageBase::Process(Plugins::CPlugin*) + 0x2b [0x55e20d78632b]
2022-04-12 03:45:14.674  Error: #16 /home/domovoi/domoticz/domoticz : Plugins::CPlugin::Do_Work() + 0x490 [0x55e20dcaf2f0]
2022-04-12 03:45:14.674  Error: #17 /home/domovoi/domoticz/domoticz :  + 0xb546d0 [0x55e20df6a6d0]
2022-04-12 03:45:14.674  Error: #18 /lib/x86_64-linux-gnu/libpthread.so.0 :  + 0x8ea7 [0x7f3a7b849ea7]
2022-04-12 03:45:14.674  Error: #19 /lib/x86_64-linux-gnu/libc.so.6 : clone + 0x3f [0x7f3a7b615def]
Restarting Domoticz doesn't help, after 5-6 successful SEMS portal polls the plugin fails again with the same message "Call to function 'onMessage' failed":

Code: Select all

2022-04-12 03:45:14.510  GoodWe GW2500-NS: Station data received from GoodWe SEMS API (Station ID: cf85dc2c-8e0c-4aa9-8572-dd768e7e4a55)
2022-04-12 03:45:14.510  Error: GoodWe GW2500-NS: Call to function 'onMessage' failed, exception details:
2022-04-12 03:45:14.526  Error: Domoticz(pid:2724734, tid:2724767('GoodWe GW2500-N')) received fatal signal 11 (Segmentation fault)
2022-04-12 04:17:05.244  GoodWe GW2500-NS: Worker thread started.
2022-04-12 04:17:05.244  Status: GoodWe GW2500-NS: Entering work loop.
2022-04-12 04:17:05.244  Status: GoodWe GW2500-NS: Started.
2022-04-12 04:17:05.348  Status: GoodWe GW2500-NS: Initialized version 1.1.1, author 'dylian94'
2022-04-12 04:17:06.771  GoodWe GW2500-NS: Station data received from GoodWe SEMS API (Station ID: cf85dc2c-8e0c-4aa9-8572-dd768e7e4a55)
2022-04-12 04:17:06.773  GoodWe GW2500-NS: Updated 18 device(s) for 1 station(s) with 1 inverter(s)
2022-04-12 04:18:05.409  GoodWe GW2500-NS: Station data received from GoodWe SEMS API (Station ID: cf85dc2c-8e0c-4aa9-8572-dd768e7e4a55)
2022-04-12 04:18:05.411  GoodWe GW2500-NS: Updated 18 device(s) for 1 station(s) with 1 inverter(s)
2022-04-12 04:19:05.714  GoodWe GW2500-NS: Station data received from GoodWe SEMS API (Station ID: cf85dc2c-8e0c-4aa9-8572-dd768e7e4a55)
2022-04-12 04:19:05.716  GoodWe GW2500-NS: Updated 18 device(s) for 1 station(s) with 1 inverter(s)
2022-04-12 04:20:06.370  GoodWe GW2500-NS: Station data received from GoodWe SEMS API (Station ID: cf85dc2c-8e0c-4aa9-8572-dd768e7e4a55)
2022-04-12 04:20:06.372  GoodWe GW2500-NS: Updated 18 device(s) for 1 station(s) with 1 inverter(s)
2022-04-12 04:21:06.325  GoodWe GW2500-NS: Station data received from GoodWe SEMS API (Station ID: cf85dc2c-8e0c-4aa9-8572-dd768e7e4a55)
2022-04-12 04:21:06.327  GoodWe GW2500-NS: Updated 18 device(s) for 1 station(s) with 1 inverter(s)
2022-04-12 04:22:05.231  GoodWe GW2500-NS: Station data received from GoodWe SEMS API (Station ID: cf85dc2c-8e0c-4aa9-8572-dd768e7e4a55)
2022-04-12 04:22:05.231  Error: GoodWe GW2500-NS: Call to function 'onMessage' failed, exception details:
2022-04-12 04:22:05.233  Error: Domoticz(pid:2844608, tid:2844629('GoodWe GW2500-N')) received fatal signal 11 (Segmentation fault)
Additionally, after restarting Domoticz and stopping the plugin, I've got another bunch of errors:

Code: Select all

2022-04-12 08:06:06.305  Error: GoodWe GW2500-NS: Stop: Device 'GoodWe GW2500-NS - Solar inverter output current' Reference Count not correct, expected 1 found 2.
2022-04-12 08:06:06.305  Error: GoodWe GW2500-NS: Stop: Device 'GoodWe GW2500-NS - Solar inverter output voltage' Reference Count not correct, expected 1 found 2.
2022-04-12 08:06:06.305  Error: GoodWe GW2500-NS: Stop: Device 'Solar (kWh)' Reference Count not correct, expected 1 found 2.
...
It has been working fine up until today.
Has something changed on the SEMS portal that needs updating the plugin?

Additional question: is it possible to make Domoticz keep running if one of its plugins fails?


Darsh
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 »

You seem to be using the (very) old version by Dylian (which is no longer maintained). You need to pull from here:
https://github.com/JanJaapKo/domoticz-GoodWeSEMS

This one is running flawlessly on my end.
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
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 I need some more info to fully get it. Please run the plugin in debug mode and create an issue on GitHub with the logging included. Please also provide info like operating system etc.

Edit:
OK I see the previous comment is gone so assume the problem is also gone?
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
Darsh
Posts: 12
Joined: Tuesday 21 February 2017 13:37
Target OS: Linux
Domoticz version: 2022.1
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Darsh »

Hi Jan-Jaap,
Thanks, your 2.0.7 is working fine. The issue was caused by the wrong portal password.


Darsh
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, that is good to know. Wrong passwords should be handled a little bit more elegant than this ;) I'l look into 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
tonymer
Posts: 16
Joined: Wednesday 15 June 2022 16:43
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by tonymer »

Hi, Thanks for the plugin. Would there be any way to have in Domoticz the import/export of energy to the network? For me it is the most important data because it is what allows me to activate things automatically without spending energy. That data is in SEMS and also when you connect locally through PV Master. I have done some local connection test with the goodwe inverter and I have managed to request some test information (Model, serial number, etc). Thanks in advance
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 Tony,

What do you exactly mean with 'import/export' to the network? The inverter can only see how much power it generates into the network of your house (which is the main counter in the plugin). It cannot know how much you (your house) had to take from the public network (a.k.a the grid). You need to read out your connection (I've got a smart meter with a so-called P1 plug which nicely lets me do that in Domoticz). I also do not see any such data in the SEMS portal.

Things get a bit more interesting when you have an inverter with not only solar panels but also a battery. I do not own such a thing so I'm depending on others to provide me with the data structures to make that happen. See plugin issue 14. I do not have proper logging yet in that issue......
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