i am new to openHAB2 and have a little problem. I have a script running called temp.py which returns me the value of my room-temperature from an arduino.
It’s working fine, but the Output-Value does not get saved. After a refresh of the PaperUI my Output is back to NaN.
My Item: Number Wohnzimmer_Temp1 "Raumtemperatur [%.1f °C]" <temperature> (RoomTemp) { channel="exec:command:temp1:output" }
My Sitemap:
Frame label=“Wohnzimmer” {
Text item=Wohnzimmer_Temp1
Text label=“HDMI-Switch” icon=“television” {
Switch item=HDMI1 label=“Switch to HDMI 1” icon=“television-off” mappings=[ON=“GO”]
Switch item=HDMI2 label=“Switch to HDMI 2” icon=“television-off” mappings=[ON=“GO”]
Switch item=HDMI3 label=“Switch to HDMI 3” icon=“television-off” mappings=[ON=“GO”]
Switch item=HDMI4 label=“Switch to HDMI 4” icon=“television-off” mappings=[ON=“GO”]
Switch item=HDMI5 label=“Switch to HDMI 5” icon=“television-off” mappings=[ON=“GO”]
}
}
My Thing Thing exec:command:temp1 [command="python /home/osmc/script/temp.py", interval=60, timeout=5, autorun=true]
PS: If I look in the PaperUI, my last Execution gets saved, but not the output value. After refreshing the page it’s gone
[15:26:03] openhabian@openHABianPi:~$ wget -q "https://www.accuweather.com/en/gb/manchester/m15-6/minute-weather-forecast/329260" -O - |tr '\n\r' ' '| sed 's|.*<div class="mc-summary">[[:blank:]]\+<p>\(.*\)</p>[[:blank:]]\+</div>.*|\1|'
No precipitation for at least 120 min[15:26:08] openhabian@openHABianPi:~$
Any guesses?
My Command is set to the text above,
Transform is set to Regex.
I don;t quite understand how to use the transform, since I could simply in theiry have used the wget and a regex pattern to pull the same group text?
I am able to grab the full website using the exec binding now, but the regex does not work.
If I use the default REGEX((.*)) - my items updates with the full page content.
If I modify the regex to parse that info I get null.
I have tested my regex, here is what WORKs and has been tried: