Kult at det er en Add-On på vei, gjør nok livet litt lettere :)
Jeg løste dette enn så lenge ved å bruke executeCommandLine og to små python script:
Rules:
rule "Fetch nobo redings"
when
Time cron "0 0/1 * 1/1 * ? *"
then
var String result = executeCommandLine(Duration.ofSeconds(5),"python3", "/etc/openhab/scripts/noboTemp.py")
NoboEntranceTemp.postUpdate(Double::parseDouble(result))
var String zone = '1'
result = executeCommandLine(Duration.ofSeconds(5),"python3", "/etc/openhab/scripts/noboZoneInfo.py", zone)
postUpdate(NoboZone1Mode, result)
zone = '2'
result = executeCommandLine(Duration.ofSeconds(5),"python3", "/etc/openhab/scripts/noboZoneInfo.py", zone)
postUpdate(NoboZone2Mode, result)
zone = '3'
result = executeCommandLine(Duration.ofSeconds(5),"python3", "/etc/openhab/scripts/noboZoneInfo.py", zone)
postUpdate(NoboZone3Mode, result)
zone = '4'
result = executeCommandLine(Duration.ofSeconds(5),"python3", "/etc/openhab/scripts/noboZoneInfo.py", zone)
postUpdate(NoboZone4Mode, result)
zone = '5'
result = executeCommandLine(Duration.ofSeconds(5),"python3", "/etc/openhab/scripts/noboZoneInfo.py", zone)
postUpdate(NoboZone5Mode, result)
zone = '6'
result = executeCommandLine(Duration.ofSeconds(5),"python3", "/etc/openhab/scripts/noboZoneInfo.py", zone)
postUpdate(NoboZone6Mode, result)
end
Items:
Number:Temperature NoboEntranceTemp "Entrance [%.1f %unit%]" <temperature>
String NoboZone1Mode "Nobo Kitchen Mode [%s]"
String NoboZone2Mode "Nobo Office Mode [%s]"
String NoboZone3Mode "Nobo Living Room Mode [%s]"
String NoboZone4Mode "Nobo Master Bedroom Mode [%s]"
String NoboZone5Mode "Nobo Childrens Bedroom Mode [%s]"
String NoboZone6Mode "Nobo Downstairs Hall [%s]"
noboTemp.py
from pynobo import nobo
glen = nobo('<serial>', '<ip>', False)
print(glen.get_current_component_temperature('<componentId>'))
noboZoneInfo.py
from pynobo import nobo
import sys
glen = nobo('<serial>', '<ip>', False)
print(glen.get_current_zone_mode(sys.argv[1]))
Har ikke satt opp noen "sendCommand" funksjoner enda, og ønsker meg en "Global Override Mode".
Bør vel ikke være noe problem, bare finne override med target_id = -1, slik jeg har forstått det.