Page 3 of 6

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

Posted: Wednesday 08 May 2019 9:10
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.

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

Posted: Sunday 12 May 2019 11:18
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?

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

Posted: Sunday 19 May 2019 7:59
by CrazyFrog
you have to create your own sensor.

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

Posted: Tuesday 04 June 2019 15:14
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

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

Posted: Wednesday 05 June 2019 14:56
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 4536 times

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

Posted: Friday 07 June 2019 11:14
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

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

Posted: Saturday 08 June 2019 20:58
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

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

Posted: Sunday 09 June 2019 15:53
by Merlin1201
? so you make a php file from the Lua script?

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

Posted: Sunday 09 June 2019 17:12
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

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

Posted: Sunday 09 June 2019 17:32
by Merlin1201
impressive, ia'm truck with copy and paste only.

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

Posted: Friday 14 June 2019 22:21
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

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

Posted: Saturday 15 June 2019 14:47
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 4398 times

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

Posted: Tuesday 18 June 2019 21:02
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

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

Posted: Sunday 23 June 2019 16:29
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!

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

Posted: Sunday 23 June 2019 18:22
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 4326 times

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

Posted: Friday 19 July 2019 15:36
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?

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

Posted: Friday 19 July 2019 15:49
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)

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

Posted: Friday 19 July 2019 16:12
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?

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

Posted: Tuesday 30 July 2019 23:14
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

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

Posted: Wednesday 31 July 2019 9:09
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