Hello,
I’m brand new to OPENHAB and so far quit happy with it. I got my FritzBox and all the Thermostats and powerplugs running on OPENHAB and some other stuff. So far so good. Now I tried to got the information of my solar powerplant which is connected to an SMA sunny Webbox. There is a procedure with an RPC request that shold be answered by the webbox and provide the values. To do this I created a script:
#!/bin/bash
curl -X POST –silent -d ‘RPC={“version”:”1.0″,”proc”:”GetPlantOverview”,”id”:”1″,”format”:”JSON”}’ -H ‘content-type:text/plain;’ http://192.168.178.200/rpc
and an thing
Thing exec:command:GetPlantOverview [command="sudo -u openhab /etc/openhab2/scripts/SMAwebbox.sh",interval=120000,timeout=10000,autorun=false]
and the items that belong to it:
//SMA Wechselrichter Abfrage über RPC
Number GriEgyTot "Gesamtertrag" (gSolar) {exec="<[/etc/openhab2/scripts/SMAwebbox.sh:300000:JSONPATH($.result.overview[?(@.meta=='GriEgyTot')][0].value)]"}
Number GriEgyTdy "Tagesertrag" (gSolar) {exec="<[/etc/openhab2/scripts/SMAwebbox.sh:300000:JSONPATH($.result.overview[?(@.meta=='GriEgyTdy')][0].value)]"}
Number GriPwr "Leistung" (gSolar) {exec="<[/etc/openhab2/scripts/SMAwebbox.sh:300000:JSONPATH($.result.overview[?(@.meta=='GriPwr')][0].value)]"}
//Number GriEgyTot “Gesamtertrag” {exec=”</etc/openhab2/scripts/SMAwebbox.sh:300000:JSONPATH($.result.overview[?(@.meta==’GriEgyTot’)][0].value)”}
//Number GriEgyTdy “Tagesertrag” {exec=”<[/etc/openhab2/scripts/SMAwebbox.sh:300000:JSONPATH($.result.overview[?(@.meta==’GriEgyTdy’)][0].value)]”}
//Number GriPwr “Momentanleistung” {exec=”<[/etc/openhab2/scripts/SMAwebbox.sh:300000:JSONPATH($.result.overview[?(@.meta==’GriPwr’)][0].value)]”}
String GetPlantOverview_out "Ausgabe SMA-WR" (gSolar) {channel="exec:command:GetPlantOverview:output"}
String GetPlantOverview_exit "Status" (gSolar) {channel="exec:command:GetPlantOverview:exit"}
String GetPlantOverview_lastex "letzte Ausführung" (gSolar) {channel="exec:command:GetPlantOverview:lastexecution"}
The problem now is, that the script seems to run because in the log I found the entry:
2019-02-14 17:53:40.870 [vent.ItemStateChangedEvent] - GetPlantOverview_lastex changed from 2019-02-13T08:33:40.747+0100 to 2019-02-14T17:53:40.808+0100
But on the sitemap all items are empty. If I look in the PaperUI i can see the last exec timestamp and an error message
Can anybody help me solving this problem?