Python Plugin: GoodWe solar inverter via SEMS API

Python and python framework

Moderator: leecollings

Post Reply
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 »

JanJaap wrote: Tuesday 26 January 2021 19:48 Hi Whoami, no, I don't see the same errors (am connected to EU server as well).

Hi Falcon8. That is an interesting situation, please switch to verbose logging and show me the loglines so I can see what the response from the webserver looks like, so I can improve handling multiple power stations. Since I've got only 1, did not exactly know what it would look like. Preferably, create an issue in the Goodwe github.
JanJaap, I did some testing, but it looks like the api of Sems portal has changed? Is that correct?
The output device normally sends the daily, current and total output. Now it only shows the total and not the current and daily anymore...
I use Dashticz and read the 3 values of the idx from your plugin. Since yesterday only the total is displayed as described.
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 »

I use this plugin also and have no issues with it. Nothing changed recently.
Did you change something on your system? What does the original device widget say in the Domoticz gui?

I use the plugin of https://github.com/JanJaapKo/domoticz-GoodWeSEMS

I did not updated to the latest version, changed 12 days ago.... Perhaps you did resulting in your issue (not likely though)
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
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 also not experiencing any different behavior on the output part. All widgets give the 'normal' data.
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
Wiljums
Posts: 28
Joined: Sunday 11 February 2018 21:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Wiljums »


waltervl wrote: I did not updated to the latest version, changed 12 days ago.... Perhaps you did resulting in your issue (not likely though)
No changelog of latest version?

Verstuurd vanaf mijn SM-G950F met Tapatalk

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 »

Changelog is on Github
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
Wiljums
Posts: 28
Joined: Sunday 11 February 2018 21:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Wiljums »

Hi, I don't receive the input string data (Voltage, current and power per string) anymore. I do receive inverter temperature, current, voltage en kWh.
I updated to the latest version, but no effect. I don't see errors in the Domoticz log. What could be wrong here?

Could it be because they changed the web interface?
Image
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 plugin takes the combined field and splits that up into separate widgets for current and voltage. Also the plugin multiplies them to get the input power (in separate widget).

So I'm not sure what you are doing, but this plugin is working as it should. If you are processing the data in an other environment I propose o do that same thing. combined field is called "pv_input_1" in the json object. I use the below code to split (in python obviously)

Code: Select all

inputVoltage,inputAmps = inverter["pv_input_1"].split('/')
Btw if you enable debug logging in the plugin, it will spit out all the returned data fields to get an idea what is in the return object form the SEMS portal.
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
Wiljums
Posts: 28
Joined: Sunday 11 February 2018 21:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Wiljums »

nvm
Last edited by Wiljums on Wednesday 10 February 2021 10:27, edited 1 time in total.
Wiljums
Posts: 28
Joined: Sunday 11 February 2018 21:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by Wiljums »

It seems like I'm still on 1.1.1 (probably due to migration and installing the old version). When trying to update I get:

>> got it updated to 1.2.6 and working again.
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 »

JanJaap wrote: Thursday 28 January 2021 11:44 I'm also not experiencing any different behavior on the output part. All widgets give the 'normal' data.
It looks like there are sometimes hickups when connecting to api of the semsgateway, it works now fine and will igonere the error once in a week.

Other question, I use this script to see what I earned today:

Code: Select all

return {
	on = { timer = { "every 15 minutes" }}, 				  -- script draait iedere 5 minuten
 -- on = { devices = { "Stroom"}}, -- Verwijder -- aan het begin van deze regel en plaats -- voor bovenstaande regel als je het script wilt draaien zodra er een nieuw verbruik aan Domoticz is doorgegeven 
	execute = function(dz)
	-- Devices
	local vandaagKwh = dz.devices('Zonnepanelen').counterToday -- Stroommeter device
    -- Dummy devices
	local StroomKosten = dz.devices('Stroomkosten') -- Stroomkosten device
	-- Eenheidsprijs in Euro's / Kwh 
	local kwhPrijs = 0.21000 -- Normaal tarief
	-- Vaste kosten in Euro's per dag (zoals vastrecht)
	local kwhPrijsVast = 0.0000
	-- Kosten berekenen
	local kwhKosten = dz.utils.round( (kwhPrijs * vandaagKwh) + kwhPrijsVast,2) -- rounded to two decimals and replace dot by comma
	-- Kosten updaten
	StroomKosten.updateCustomSensor(kwhKosten)
	end
}
The device Zonnepanelen is the device from your plugin, but now I want to calculate it for the energy that is generated for the whole year.
So I adjusted the ('Zonnepanelen').counterToday into ('Zonnepanelen').Data because I saw in the JSON output this containt the value that I want to calcute into euros.

Offcourse the rest of the devices I also changed but I get the error:
lua:21: attempt to perform arithmetic on a nil value (local 'vandaagKwh')

So it looks like this is not the right datafield, can you help which one it is?
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 »

whoami wrote: Wednesday 24 March 2021 11:02 The device Zonnepanelen is the device from your plugin, but now I want to calculate it for the energy that is generated for the whole year.
So I adjusted the ('Zonnepanelen').counterToday into ('Zonnepanelen').Data because I saw in the JSON output this containt the value that I want to calcute into euros.
You can get these value on the report page from the 'Zonnepanelen' so no need to calculate....
See the screenshot on https://www.domoticz.com/wiki/Managing_ ... ice_Report

You will have to fill in the tariffs on the Setup - Settings - Tab Meters and Counters.
https://www.domoticz.com/wiki/Applicati ... ters_Setup
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
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 »

waltervl wrote: Wednesday 24 March 2021 11:38
whoami wrote: Wednesday 24 March 2021 11:02 The device Zonnepanelen is the device from your plugin, but now I want to calculate it for the energy that is generated for the whole year.
So I adjusted the ('Zonnepanelen').counterToday into ('Zonnepanelen').Data because I saw in the JSON output this containt the value that I want to calcute into euros.
You can get these value on the report page from the 'Zonnepanelen' so no need to calculate....
See the screenshot on https://www.domoticz.com/wiki/Managing_ ... ice_Report

You will have to fill in the tariffs on the Setup - Settings - Tab Meters and Counters.
https://www.domoticz.com/wiki/Applicati ... ters_Setup
Yes I know, but I want to see them on my dashticz dashboard, so that is why I made a dummy device with the correct values.
But now I want to see also the values for the whole year....
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 »

Then you need to do something like in the following topic: viewtopic.php?f=59&t=25156
You will have to get al historical generated energy per day from january 1st of this year and add them all up until 1 value.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
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 »

The data is already visible in the device of zonnepanelen, but I can’t get a good count.... see my last detail about zonnepanelen.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 »

You better ask this dzVents question in the dzVents section as it is not Goodwe solar related.
Check the documentation of dzVents. I do not think it is there.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
JanLoule
Posts: 2
Joined: Saturday 05 June 2021 10:27
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by JanLoule »

Just this week installed RPi 4 with P1-USB cable to smart meter, and used the script to add the plug in to the Domoticz and got it working first pass. The GoodWe GW5000-DT works fine and I see on the power output in SEMS an output figure in Watt. In the Domoticz channels I activated channels 4, 14 and 15 resp output power, input-1 power, input-2 power. I am not sure what is what, input 1 and 2 are the power inputs from the two strings of panels? and output power is what is delivered to the switchboard ?
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,

I presume with channel you mean unit ID. Here's a short explanation:
1: inverter internal temperature
2: inverter output current [Ampere], what is going out of the inverter so when you have no consumers on, this is also the current going out of your house into the net
3: Inverter output voltage [Volt]
4: Inverter output power [kW/kWh]: the power delivered to the net, this is in the end what is earning you your investment back. Example: your panels produce 3 kW and you have you're oven running at 3,5 kW, then netto 0,5 kW comes in via the switch board. In the widgets you see the power at the moment (3kW in the example) and the amount of energy produced so far in kWh
5..8: the current and voltage of the input strings 1 and 2 (so that is what you could measure on the wires coming in form the panels)
10..13: the current and voltage of the input strings 3 and 4 (so that is what you could measure on the wires coming in form the panels)
There is allways minimum 1 input, some people have 2 (as I have) I think 3 and 4 is quite rare but it is in the interface nonetheless
9: inverter state: tells you if it is actually generating power or not
14..17: power of the inputs [kW]: this I calculate as it is not in the interface. But gives a better idea of the amount of energy produced by the various input strings (my 2 sets are facing east and west so I can see how this varies over the day)

So your p1 energy smart meter widget you can compare with unit 1 of the solar panels. Hope this helps.
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
JanLoule
Posts: 2
Joined: Saturday 05 June 2021 10:27
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by JanLoule »

OK JanJaap, I see the data as you explained – makes sense.
Solar input power – string 1 = 341 Watt
Solar input power – string 2 = 522 Watt
= total input from the PV panels 863 Watt
Converted into power in the home grid:
Solar output power = 638 Watt
Effectively 79% …
Of this power I read (from the P1 meter) that phase L1 and phase L2 absorb the majority
The inverter is (as I understand) phase-balanced i.e. 1/3 of the output on each phase.
Phase L3 is not using power, hence 188 Watt flows back to the mains i.e. 29%.
The remaining 2/3 are used in the home grid by phase L1 and phase L2
The total power from the net to meet the house demand hence is
Usage L1 = 2619, plus Usage L2 = 1973, minus the production to the grid Delivery L3 = 188 Watt.
This totals 4404 Watt imported from the mains grid into the house.
Screenshot Domoticz with GoodWe script running
Screenshot Domoticz with GoodWe script running
Domoticz-GoodWe.jpg (45.48 KiB) Viewed 1726 times
wlmpie
Posts: 1
Joined: Monday 07 June 2021 20:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: GoodWe solar inverter via SEMS API

Post by wlmpie »

It is now possible to readout your inverter data from your local network when your firmware of an XS inverter is 1.xx.14 of higher. In my case 1.13.15.
The following user wrote some python code to do this.
https://github.com/borft/py-goodwe
Can this possibly be merged with the goodwe solar inverter plugin? (Unfortunately I am too much an amateur in programming to do this myself.)

see also https://gathering.tweakers.net/forum/li ... /1799239/0 In Dutch
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 tweaker post is quite a read. I've read it before (to some extend) but then it was still about sniffing it via USB which I did not want to go into. Somewhere in the 13 pages somebody discovered a Wifi trick. I'll dive into it, probably this weekend.....

Tnx for the hint, btw.
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