Connecting Goodwe Solar Panel Inverter to Openhab

Hello all, is this tread still alive?
I’ve get tis error.
2020-12-28 12:59:55.789 [WARN ] [rthome.model.script.actions.BusEvent] - Cannot convert '{

Somebody know’s what’s wrong?

Thanks,
Harold.

Hello Roger, how do you create a new user in Sems Portal?
Can you help me?

Cheers,
Harold

Hi Harold,
You can make a new user in Sems Portal. Select the tab “Management”, select your device and ad a visitor.
Dit you ad your script to the Whitelist?

Succes,
Toine

Hello Toine,
What do you mean with whitelist?

Just add a visitor, but now i’ve got the error
2020-12-28 20:57:19.568 [WARN ] [rthome.model.script.actions.BusEvent] - Cannot convert '{

“hasError”: false,

“code”: 0,

“msg”: “Success”,

“data”: {

"agreement_agreement": true

},

“components”: {

"para": null,

"langVer": 91,

"timeSpan": 0,

"api": "http://eu.semsportal.com:82/api/Auth/GetTokenV2",

"msgSocketAdr": "https://eu-xxzx.semsportal.com"

},

“api”: “https://eu.semsportal.com/api/

}’ to a state type which item ‘UG_PV_SoC’ accepts: [DecimalType, QuantityType, UnDefType].

Helaas,
Harold.

Hi Harold,
You seem to have a similar problem as Toine previously. You need to login to the semsportal with the newly created account at least once for it to work. Let me know if this helped.
Best Regards
RogerG

Oke logged in and i had to confirm it.
Now i don’t see anything in the log. Maybe that’s a good signs???

Edit: made a new semsapi.sh with the right email-passwd and numbers.
Now i get
Cannot convert '/etc/openhab2/scripts/semsapi.sh: line 5: jq: command not found
in the log.

And how to put it in the sitemap?
Something like?, Text item=Energy UG_PV_Total_Output

Actually, you should see the portal responses in the log …
If you add

    Text item=UG_PV_Todays_Output
    Text item=UG_PV_Output_Power
    Text item=UG_PV_Grid
    Text item=UG_PV_Loadstatus
    Text item=UG_PV_Home_Load
    Text item=UG_PV_SoC
    Text item=UG_PV_Battery
    Text item=UG_PV_Batterystatus

to the sitemap, we can maybe find out more. openhab should get new values every minute from the portal.

Did that in the sitemap, but then i’ve got a error.
Maybe because there is still something wrong.
See one reply up.

When i use the samsapi.sh of topic starter then i get,

2020-12-29 12:21:15.660 [WARN ] [rthome.model.script.actions.BusEvent] - Cannot convert '{

“hasError”: false,

“code”: 0,

“msg”: “Success”,

“data”: {

"uid": "                 ",

"timestamp": 1609240875653,

"token": "      ",

"client": "ios",

"version": "v2.1.0",

"language": "en"

},

“components”: {

"para": null,

"langVer": 91,

"timeSpan": 0,

"api": "http://eu.semsportal.com:82/api/Auth/GetTokenV2",

"msgSocketAdr": "https://eu-xxzx.semsportal.com"

},

“api”: “https://eu.semsportal.com/api/

}’ to a state type which item ‘UG_PV_SoC’ accepts: [DecimalType, QuantityType, UnDefType].

There is still something wrong. I copied all of topic starter.

Looks like you don’t have jq installed (this is a simple JSON parser). I thought it was a default package with all Linux distributions. On what platform are you running openhab?. If it is raspbian/openhabian, ubuntu or Debian you should be able to install jq with

sudo apt-get update
sudo apt-get install jq

Can you also try just running the shell script on command line and see what it returns there?

raspbian, try sudo apt-get install jq

Edit: Nope, no joy.

echo “$RETURN” | jq “.data”
null

I’m a bit lost here … Could you replace in the bash-script

echo “$RETURN” | jq “.data”

with

echo “$RETURN”

and just run the script on command line again. Hopefully that output will help to debug.

echo “$RETURN” gives

{
“hasError”: false,
“code”: 100003,
“msg”: “missing parameter.”,
“data”: null,
“components”: {
“para”: null,
“langVer”: 91,
“timeSpan”: 0,
“api”: “000”,
“msgSocketAdr”: “”
}
}

Mmmh. It seems that the authentication to the semsportal fails.

Could you add

echo $RESULT
echo $HEADER

to end of the script.

EDIT: Please X-out any sensitive data in the output before posting, such as the token or your id and email.

Oeps, my mistake, hope i wiped it all.
Put
echo $RESULT
echo $HEADER
at the end.

Now nothing happens in the log file.
But in the exec.things, i don’t see collors like the topic starter.
Is that oke?

Could you run the script on the command line with those additions?

No then i get > something
>

Then i use ctrl c to stop it.
But no nothing happens in the log about the goodwe.

.

Roger,

Now i’have a very very long logfile.
Still a mistake in the sitemap, but we’re getting there.

Edit: It’s working,but how can i shorten the logfile?