GoodWe Solar: get data from the new semsportal (lua script)

Moderator: leecollings

sandeman684
Posts: 14
Joined: Sunday 08 January 2017 10:37
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by sandeman684 »

Flitske wrote: Wednesday 08 May 2019 7:51 I'm trying to get this working however i cannot get the curl command to work. I run windows 10 on my desktop and domoticz on a raspberry pi. Where do i put in the curl command? In de CMD on win 10 or in on the Raspberry Pi??
I think in Windows 10 you can run curl (https://stackoverflow.com/questions/950 ... on-windows) but it is probably better to do it on the RPi as domoticz will also use it from there. You should get the same response on both.
Marcjeok
Posts: 37
Joined: Wednesday 01 November 2017 19:12
Target OS: -
Domoticz version:
Location: Netherlands
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by Marcjeok »

CrazyFrog wrote: Monday 22 April 2019 20:52 you have create your own sensor.
for hardware you have to create a virtual sensor from the type "Dummy (Does nothing, use for virtual switches only)".

then click on "Create Virtual Sensors", name the sensor "solar panels" and choose "sensor type" - "Electric (instant + counter)"
Do you have to create a new sensor or is it possible to use your existing "Goodwe solar inverter via Web API" idx-code?
CrazyFrog
Posts: 21
Joined: Sunday 21 April 2019 13:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by CrazyFrog »

you have to create your own sensor.
Marktap
Posts: 2
Joined: Tuesday 04 June 2019 14:45
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by Marktap »

I have implemented this script without to much problems. The only thing i see after a couple of days is that the total value of monday is al wrong. It's not 19.2 kWh, but more around 8.8 kWh if i check it in the semsportal.

All of the other days are correct, i dont get it. Does anybody have an idea?

Image
Attachments
Capture.PNG
Capture.PNG (141.8 KiB) Viewed 4371 times
Kencirot
Posts: 5
Joined: Wednesday 05 June 2019 14:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by Kencirot »

I experience the same issue as Marktap. The daily total of previous day is being used untill the currect day is higher for me.

I also notice when there is no power output I still get the last remain known output showing up (e.g 36Watts from 22:00h onwards till the morning).
Is there a way to set it to "0" when the solar system is offline?
solar.PNG
solar.PNG (222.85 KiB) Viewed 4361 times
Merlin1201
Posts: 10
Joined: Friday 07 June 2019 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by Merlin1201 »

Hi
I have installed the script and it works great.

There is one error remaining:
2019-06-08 07:28:10.493 Error: EventSystem: Warning!, lua script Solar Panels has been running for more than 10 seconds
2019-06-08 07:36:10.126 Error: EventSystem: Warning!, lua script Solar Panels has been running for more than 10 seconds
2019-06-08 07:44:10.300 Error: EventSystem: Warning!, lua script Solar Panels has been running for more than 10 seconds
2019-06-08 07:48:10.291 Error: EventSystem: Warning!, lua script Solar Panels has been running for more than 10 seconds
2019-06-08 07:52:10.378 Error: EventSystem: Warning!, lua script Solar Panels has been running for more than 10 seconds
2019-06-08 08:00:10.419 Error: EventSystem: Warning!, lua script Solar Panels has been running for more than 10 seconds


i also try the upload to pvoutput script, but that needs some more work and my scripting is not that good.
https://www.domoticz.com/wiki/Upload_en ... o_PVoutput
User avatar
sincze
Posts: 1299
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by sincze »

lua script works like a charm. Up and running in no time. Thank you so much.
As by default I always build the stuff in Pass2PHP (and have some sort of multi-threading). :D
I updated my Github.

https://github.com/sincze/Domoticz/blob ... Goodwe.php
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
Merlin1201
Posts: 10
Joined: Friday 07 June 2019 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by Merlin1201 »

? so you make a php file from the Lua script?
User avatar
sincze
Posts: 1299
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by sincze »

Merlin1201 wrote: Sunday 09 June 2019 15:53 ? so you make a php file from the Lua script?
:lol:
Yes, basically I rewrote the whole thing in PHP. As all my scripts use PHP. (Pass2PHP user)

This for me has the following advantages:
- I can run it outside of Domoticz and not be scared of 'script has been running for more than 10 seconds ' clogging up my 850 devices and 10 (different branded) inverters.
- In addition I could build some additional failure checks. If the webserver is not available. :P
- It integrates in Pass2PHP
- It can be used for non Pass2PHP users.

However for the typical user I would go for the lua.
- It works fine.
- Easy to implement

I even have it running on my spare pi. :D
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
Merlin1201
Posts: 10
Joined: Friday 07 June 2019 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by Merlin1201 »

impressive, ia'm truck with copy and paste only.
pvdgulik
Posts: 21
Joined: Friday 28 December 2018 20:23
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by pvdgulik »

Also same problem.. Think of editing the database to correct..
Kencirot wrote: Wednesday 05 June 2019 14:56 I experience the same issue as Marktap. The daily total of previous day is being used untill the currect day is higher for me.

I also notice when there is no power output I still get the last remain known output showing up (e.g 36Watts from 22:00h onwards till the morning).
Is there a way to set it to "0" when the solar system is offline?

solar.PNG
Attachments
8A38ABA2-C638-4552-9236-8A2FC65B9F0B.jpeg
8A38ABA2-C638-4552-9236-8A2FC65B9F0B.jpeg (241.46 KiB) Viewed 4246 times
User avatar
sincze
Posts: 1299
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by sincze »

pvdgulik wrote: Friday 14 June 2019 22:21 Also same problem.. Think of editing the database to correct..
Kencirot wrote: Wednesday 05 June 2019 14:56 I experience the same issue as Marktap. The daily total of previous day is being used untill the currect day is higher for me.
This seems to be an issue with all my different branded inverters indeed within domoticz.
Seems like a Domoticz representation graph issue to me as the json request is processed correctly and device is updated correctly as well. I am running Domoticz V4.10730.
pvdgulik wrote: Friday 14 June 2019 22:21 I also notice when there is no power output I still get the last remain known output showing up (e.g 36Watts from 22:00h onwards till the morning).
Is there a way to set it to "0" when the solar system is offline?
That I corrected with a statement (not within lua) to check if the current time is after sunset. If so I update the device with

Code: Select all

0;<daily_generation>.
Goodwe-0Watt.JPG
Goodwe-0Watt.JPG (44.01 KiB) Viewed 4223 times
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
klaaspiet
Posts: 34
Joined: Tuesday 09 January 2018 8:29
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Harlingen
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by klaaspiet »

Merlin1201 wrote: Friday 07 June 2019 11:14 Hi
I have installed the script and it works great.

There is one error remaining:
2019-06-08 07:28:10.493 Error: EventSystem: Warning!, lua script Solar Panels has been running for more than 10 seconds
2019-06-08 07:36:10.126 Error: EventSystem: Warning!, lua script Solar Panels has been running for more than 10 seconds
2019-06-08 07:44:10.300 Error: EventSystem: Warning!, lua script Solar Panels has been running for more than 10 seconds
2019-06-08 07:48:10.291 Error: EventSystem: Warning!, lua script Solar Panels has been running for more than 10 seconds
2019-06-08 07:52:10.378 Error: EventSystem: Warning!, lua script Solar Panels has been running for more than 10 seconds
2019-06-08 08:00:10.419 Error: EventSystem: Warning!, lua script Solar Panels has been running for more than 10 seconds


i also try the upload to pvoutput script, but that needs some more work and my scripting is not that good.
https://www.domoticz.com/wiki/Upload_en ... o_PVoutput

ik got this problem 2 how to solve it?? i can't gat the solution

if have made som changed so i have a 0 value when de inverter is nog genarating

i get de status of the inverter

Status = getValue(splitString, "status")

if that is
1 = Generating,
0 = Waiting</option>
2 = Fault
-1 = Offline

if Status == "1" then
status_text = "Generating"
elseif Status == "0" then
status_text = "Waiting"
elseif Status == "2" then
status_text = "Fault"
else
status_text = "Offline"
end


so i can create a 0 when the status is 0,2 of -1

if Status == "1" then
UpdateDevice(sensorSolarPanels, current..";"..zonTotal)
else
current = "0"
print("current :" .. current)
UpdateDevice(sensorSolarPanels, current..";"..zonTotal)
end

and i use eTotal = getValue(splitString, "eTotal")

so i can get the total of my production
pvdgulik
Posts: 21
Joined: Friday 28 December 2018 20:23
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by pvdgulik »

Thank you for your response. I’m not that experienced with Domoticz, can you tell in detail how to:

That I corrected with a statement (not within lua) to check if the current time is after sunset. If so I update the device with

Code: Select all

0;<daily_generation>.
Thank you!
User avatar
sincze
Posts: 1299
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by sincze »

pvdgulik wrote: Sunday 23 June 2019 16:29 Thank you for your response. I’m not that experienced with Domoticz, can you tell in detail how to:

That I corrected with a statement (not within lua) to check if the current time is after sunset. If so I update the device with

Code: Select all

0;<daily_generation>.
Thank you!
I can help you if you are willing to consider moving to a Pass2PHP script kind of a solution.
Goodwe_Scheme.JPG
Goodwe_Scheme.JPG (62.82 KiB) Viewed 4151 times
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
Wiljums
Posts: 28
Joined: Sunday 11 February 2018 21:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by Wiljums »

I get the following error:
2019-07-19 15:32:00.126 Error: EventSystem: in script_device_solar.lua: [string "-- Created by Raymond Wiertz
..."]:129: bad argument #1 to 'sub' (string expected, got nil)

How to fix this?
Wiljums
Posts: 28
Joined: Sunday 11 February 2018 21:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by Wiljums »

Wiljums wrote: Friday 19 July 2019 15:36 I get the following error:
2019-07-19 15:32:00.126 Error: EventSystem: in script_device_solar.lua: [string "-- Created by Raymond Wiertz
..."]:129: bad argument #1 to 'sub' (string expected, got nil)

How to fix this?
And now this one:
2019-07-19 15:49:01.219 Error: EventSystem: in script_device_solar.lua: [string "-- Created by Raymond Wiertz
..."]:102: attempt to perform arithmetic on global 'endPos' (a nil value)
Wiljums
Posts: 28
Joined: Sunday 11 February 2018 21:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by Wiljums »

dospider wrote: Tuesday 30 April 2019 9:14 I still have a problem retrieving the data.
Does anybody have an idea how to solved this error?

2019-04-30 09:08:43.249 Error: EventSystem: in Goodwe portal: [string "
..."]:88: attempt to perform arithmetic on global 'endPos' (a nil value)
Have you been able to fix this error?
Peter2807
Posts: 8
Joined: Tuesday 30 July 2019 23:01
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by Peter2807 »

Anybody who has this script working on a Synolgy NAS, as I'm unable to find much about syntax differences between Pi and Synology if there are any.
First error already occurs at the first line of executable code: local Username = ... Unexpected keyword local near Username
User avatar
sincze
Posts: 1299
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: GoodWe Solar: get data from the new semsportal (lua script)

Post by sincze »

Peter2807 wrote: Tuesday 30 July 2019 23:14 Anybody who has this script working on a Synolgy NAS, as I'm unable to find much about syntax differences between Pi and Synology if there are any.
First error already occurs at the first line of executable code: local Username = ... Unexpected keyword local near Username
Yes it is working on a DS412 as an alternative I created
However you could also look at: https://github.com/sincze/Domoticz/blob ... Goodwe.php
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests