Python Plugin: GoodWe solar inverter via SEMS API

Python and python framework

Moderator: leecollings

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: Wednesday 23 October 2019 21:10 Hi Nodri,

I fixed this by updating python:
sudo apt-get install python3.4 libpython3.4 python3.4-dev
Now it is working fine!
Did that, but it says all latest verions, re-installed the Goodwe inverter via web api in Domoticz and still don't get the watt tile.
Running version 4.10717
Can't for the life of me understand what's going on.
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 Nodri,

If you set the loglevel to debug and filter on the name of your hardware unit, can attach that logging? Then we can see what's going on. Hardware config should look like this. In my case, I would filter the logs on 'Zonnepanelen' (I think it is case-sensitive).
Goodwe HW panel.png
Goodwe HW panel.png (46.74 KiB) Viewed 2785 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
Sanigepalli
Posts: 1
Joined: Saturday 14 December 2019 20:17
Target OS: Windows
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Sanigepalli »

Can you find the IP of your inverter in your router? I believe most “chinese” inverters have an integrated webserver. I have Hosola inverters, and use the http binding to scrape the webpage running on the inverters themselves.
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 »

Hi all,

Sorry for the late reply, busy busy busy. How do i set loglevel to debug??
This is what i see in Domoticz:
Image
Attachments
Goodwedomo.JPG
Goodwedomo.JPG (111.62 KiB) Viewed 2689 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 Nodri, you are using the wrong plugin. This is the domoticz build in one that doesn't work anymore. Did you follow instructions to install the plugin correctly? Please mind to restart domoticz to activate any newly installed plugin.

Regards Jan-Jaap
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 »

I did everything that was on this page:
https://github.com/dylian94/domoticz-GoodWeSEMS

The Goodwe solar inverter via Web API shows up but not the SEMS portal api thing.
Restarted several times now.
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,

OK, some things to check:

//updated//
please check this link if it helps you. It checks if the plugin framework is actually running
https://www.domoticz.com/wiki/Using_Python_plugins
//updated//


- make sure the Debian distribution is up to date:

Code: Select all

sudo apt-get update
sudo apt-get upgrade
- then make sure python 3 is installed (python 3 is part of the regular Debian distributions):

Code: Select all

sudo apt install python3
- then make sure you actually have the Python plugin on your device:

Code: Select all

cd domoticz/plugins/domoticz-GoodWeSEMS/
ls
should return:

Code: Select all

pi@raspberrypi:~/domoticz/plugins/domoticz-GoodWeSEMS $ ls
GoodWe.py  LICENSE.md  plugin.py  __pycache__  README.md
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 »

Thanks guys for your help, sorry for my late reply. Really busy here.

So i updated the debian stuff but when i want to install python3 i get this:
Image
Attachments
python3fout.JPG
python3fout.JPG (106.95 KiB) Viewed 2557 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 Nodri,

That's well beyond my knowledge. When I googled the previous time I got the link I mentioned in the previous post.

Since this is no longer concerning the GoodWE plugin, I propose you open a new topic about the Python framework to keep this thread clear.
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
pazzje
Posts: 11
Joined: Thursday 12 March 2015 17:53
Target OS: Windows
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by pazzje »

Hi...

The goodweplugin does not show up in my hardware selection..
I am using windows 7 and if updated pyton and domoticz..
Wiht other pyton pluins no problem...like wan ip checker...they show up...

What is goinig wrong??
pazzje
Posts: 11
Joined: Thursday 12 March 2015 17:53
Target OS: Windows
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by pazzje »

it works
markv1
Posts: 3
Joined: Thursday 13 February 2020 12:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by markv1 »

JanJaap wrote: Sunday 03 November 2019 16:40
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.

Good work here all (especially dylan and Jan Jaap),

@janjaap I see that you have already worked on adding the other data I am very interested in Ipv1 (A) and Ipv2 (A).
is the script I see here already usable?

https://github.com/JanJaapKo/domoticz-G ... 6f09568d33

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 (%)
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,

Yes it works like a charm for a couple of months here. Only thing I can't get rid of is irregular repetitive error:

Code: Select all

2020-02-14 05:19:31.924 Error: (Zonnepanelen): Async Secure Read Exception: 1, stream truncated
But that doesn't seem to hurt (there have been other threads on this topic, no solution seems at hand....)

Currently created Domoticz devices:
Inverter temperature
Output current [A]
Output voltage [V]
Output power [kWh]
input 1..4 current [A]
input 1..4 voltage [V]
input 1..4 power [kWh]
inverter state [offline|waiting|generating]
Where the power devices log both the real power in W as well as the cumulative energy in kWh.

I can look into the fases, although I have a 1 fase inverter so not sure how to output looks like for a 3 fase inverter. I will upload this weekend a version with the fase measurement for 1 fase in and make sure that the debug level spits out all relevant data so that you can produce the right logging with your 3 fase inverter.
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
markv1
Posts: 3
Joined: Thursday 13 February 2020 12:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by markv1 »

Jan Jaap,
Thank you for your response.

Can give you a tip how I implement the modified script?

I also have a 1 phase goodwe 3600d-ns inverter.

I did a copy past of another post here from outpout data.
I only now see that it is a 3 phase inverter my excuse for this.

My Inverter:
ModelGW3600D-NS
capacity3.6kW
Power0.26kW
AC Voltage236.5V
AC Current1.2A
AC Frequency50Hz
Inner Temperature17.4°C
DC Voltage/Current1204.9/0.6V/A
DC Voltage/Current2199.2/0.8V/A
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 added the frequency. It is listed as fac1, so presumably (it was dark when I made it so the inverter was offline) this will hold the frequency of the first fase, which would normally be the only fase in single fase operation. I'll check it out tomorrow.

I dug a bit deeper into the JSON output. It seems that the currently reported output current and voltage are the total output of all fases combined (as that makes most sense) and there is detailed logging per fase. But for now I do not really see the point of logging that in Domoticz. Anyhow, this plugin should work for both a single as well as 3 fase inverter.

Finally, you should be able to pull this version by (I'm usually strugling a bit with Git myself.....):

Code: Select all

cd domoticz/plugins/domoticz-GoodWeSEMS
git pull https://github.com/JanJaapKo/domoticz-GoodWeSEMS
If there is any info you are missing, run the plugin with debug loglevel and send me the output (it does hold some private info like user and password so please remove 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
markv1
Posts: 3
Joined: Thursday 13 February 2020 12:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by markv1 »

Just added script and the extra devices are visible.
Goodwe - Inverter input 1 and 2 power added. lets see if data is visible tomorrow.

Big thanks for this!
OOge
Posts: 4
Joined: Saturday 14 March 2020 15:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by OOge »

Is this plugin still working. I can't seem to get my total consumption.
It shows only 1 inverter even though they are all connected in the sems portal.
All the devices show the same amount of power (same serial number of the device)

This is my log.
20-03-14 14:45:41.250 (Zonnepanelen) onHeartbeat called, starting device update.
2020-03-14 14:45:41.354 (Zonnepanelen) Connected to SEMS portal API successfully.
2020-03-14 14:45:41.354 (Zonnepanelen) build stationDataRequest with number of stations (len powerStationList) = 1
2020-03-14 14:45:41.354 Error: (Zonnepanelen) 'onConnect' failed 'AttributeError':''str' object has no attribute 'id''.
2020-03-14 14:45:41.354 Error: (Zonnepanelen) ----> Line 312 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onConnect
2020-03-14 14:45:41.354 Error: (Zonnepanelen) ----> Line 152 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onConnect
2020-03-14 14:45:41.354 Error: (Zonnepanelen) ----> Line 130 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function startDeviceUpdate
2020-03-14 14:45:41.354 Error: (Zonnepanelen) ----> Line 280 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py', function stationDataRequest
2020-03-14 14:45:51.226 (Zonnepanelen) onHeartbeat called, Connection is alive.
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,

The original author doesn't seem to support it anymore. However you can pull an updated version as descibred in issue:
issue 7

please switch the debug logging on and post it (perhaps as file since it could be relatively large) and I'll have a look.
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
OOge
Posts: 4
Joined: Saturday 14 March 2020 15:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by OOge »

. Started fresh with a new SD card. The devices don't show up when I add the stationID. I need the station ID because I don't need the data of my family in my portal : ). I noticed before that when not using the station ID I get 205 devices :).
It did not receive the right data from the semsportal.

Did everything as per described.

Code: Select all

2020-03-15 14:16:50.078 (Zonnepanelen) onStop - Plugin is stopping.
2020-03-15 14:16:50.368 (Zonnepanelen) Debug logging mask set to: PYTHON
2020-03-15 14:16:50.368 (Zonnepanelen) 'Database':'/home/pi/domoticz/domoticz.db'
2020-03-15 14:16:50.368 (Zonnepanelen) 'Author':'dylian94'
2020-03-15 14:16:50.368 (Zonnepanelen) 'HomeFolder':'/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/'
2020-03-15 14:16:50.368 (Zonnepanelen) 'DomoticzBuildTime':'2019-05-09 12:04:08'
2020-03-15 14:16:50.368 (Zonnepanelen) 'UserDataFolder':'/home/pi/domoticz/'
2020-03-15 14:16:50.368 (Zonnepanelen) 'Version':'1.2.1'
2020-03-15 14:16:50.368 (Zonnepanelen) 'Language':'en'
2020-03-15 14:16:50.368 (Zonnepanelen) 'StartupFolder':'/home/pi/domoticz/'
2020-03-15 14:16:50.369 (Zonnepanelen) 'Port':'443'
2020-03-15 14:16:50.369 (Zonnepanelen) 'Key':'GoodWeSEMS'
2020-03-15 14:16:50.369 (Zonnepanelen) 'Password':'******'
2020-03-15 14:16:50.369 (Zonnepanelen) 'DomoticzHash':'b38b49e5'
2020-03-15 14:16:50.369 (Zonnepanelen) 'Mode1':'858f9c60-ba99-471f-851f-df52895****'
2020-03-15 14:16:50.369 (Zonnepanelen) 'Username':'*******'
2020-03-15 14:16:50.369 (Zonnepanelen) 'Address':'www.semsportal.com'
2020-03-15 14:16:50.369 (Zonnepanelen) 'Mode6':'Debug'
2020-03-15 14:16:50.369 (Zonnepanelen) 'Mode2':'3'
2020-03-15 14:16:50.369 (Zonnepanelen) 'Name':'Zonnepanelen'
2020-03-15 14:16:50.369 (Zonnepanelen) 'DomoticzVersion':'4.10717'
2020-03-15 14:16:50.369 (Zonnepanelen) 'HardwareID':'2'
2020-03-15 14:16:50.369 (Zonnepanelen) Device count: 0
2020-03-15 14:16:50.029 Status: (Zonnepanelen) Stop directive received.
2020-03-15 14:16:50.029 Status: (Zonnepanelen) Exiting work loop.
2020-03-15 14:16:50.130 Status: (Zonnepanelen) Stopping threads.
2020-03-15 14:16:50.130 Status: (Zonnepanelen) Stopped.
2020-03-15 14:16:50.130 Status: (Zonnepanelen) Started.
2020-03-15 14:16:50.364 Status: (Zonnepanelen) Entering work loop.
2020-03-15 14:16:50.365 Status: (Zonnepanelen) Initialized version 1.2.1, author 'dylian94'
2020-03-15 14:16:53.498 (Zonnepanelen) Connected to SEMS portal API successfully.
2020-03-15 14:16:53.499 (Zonnepanelen) build tokenRequest with UN: '*******', pwd: '*******'
2020-03-15 14:16:53.499 (Zonnepanelen) build apiRequestHeaders with token: '{"client": "web", "token": "", "uid": "", "version": "", "timestamp": 0, "language": "en-GB"}'
2020-03-15 14:16:54.052 (Zonnepanelen) message received: CrossLogin
2020-03-15 14:16:54.052 (Zonnepanelen) SEMS API Token: {"account": "******", "agreement_agreement": 1, "pwd": "*******"}
2020-03-15 14:16:54.053 (Zonnepanelen) build stationDataRequest with number of stations (len powerStationList) = 1
2020-03-15 14:16:54.053 Error: (Zonnepanelen) 'onMessage' failed 'AttributeError':''str' object has no attribute 'id''.
2020-03-15 14:16:54.053 Error: (Zonnepanelen) ----> Line 317 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onMessage
2020-03-15 14:16:54.053 Error: (Zonnepanelen) ----> Line 174 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py', function onMessage
2020-03-15 14:16:54.053 Error: (Zonnepanelen) ----> Line 280 in '/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py', function stationDataRequest
2020-03-15 14:17:02.471 (Zonnepanelen) onHeartbeat called, Connection is alive.
2020-03-15 14:17:12.493 (Zonnepanelen) onHeartbeat called, Connection is alive.
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 OOge,

You haven't pulled the latest version, that is 1.2.2, your logfile shows 1.2.1. So please pull latest first according:

Code: Select all

cd domoticz/plugins/domoticz-GoodWeSEMS
git pull https://github.com/JanJaapKo/domoticz-GoodWeSEMS
Then switch on debug logging. And please show me a screenshot of your configuration to see what you are doing. I presume you have filled in the optional Station ID? It should be some GUID which should be the last part (after the las '/') of the URL when you log in to the SEMS portal via a webbrowser, url should be something like:
https://www.semsportal.com/PowerStation ... usSnMin/<8 char hex>-<4 char hex>-<4 char hex>-<4 char hex>-<12 char hex>
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