sorry für die Anfängerfrage.
Ich möchte meinen Receiver in OH einbinden. Dazu hab ich ein Item und eine Rule erstellt
vu.items
Code: Alles auswählen
Switch VuPower "Power" <switch> (gVu)
String VuPowerstatus "Powerstatus [%s]" <screen> (gVu) {http="<[http://root:Passwort@10.10.10.10:80/web/powerstate:3000:REGEX(.*?<e2instandby>(.*?)</e2instandby>.*)]"}
Code: Alles auswählen
rule "VuPower"
when
Item VuPower received command
then
if(receivedCommand == ON)
sendHttpGetRequest ("http://root:Passwort@10.10.10.10:80/web/remotecontrol?command=116")
if(receivedCommand == OFF)
sendHttpGetRequest ("http://root:Passwort@10.10.10.10:80/web/remotecontrol?command=116")
end
Mit einer weiteren Rule möchte ich den Status vom Switch "VuPower" ändern auch wenn ich mit der Receiver Fernbedienung schalte.
Code: Alles auswählen
rule "VuPowerstatus"
when
Item VuPowerstatus received update
then
logInfo("Test", "Test")
if (VuPowerstatus == "false")
logInfo("Status Update", "false")
VuPower.postUpdate(ON)
if (VuPowerstatus == "true")
logInfo("Status Update", "true")
VuPower.postUpdate(OFF)
end
Im Log erscheint der VuPowerstatus auch versetzt. Liegt es eventuell auch daran das der Wert neu formatiert werden muss, oder ist einfach meine Rule falsch ?
Code: Alles auswählen
2020-05-04 11:15:27.561 [ome.event.ItemCommandEvent] - Item 'VuPower' received command ON
2020-05-04 11:15:27.593 [vent.ItemStateChangedEvent] - VuPower changed from OFF to ON
2020-05-04 11:15:28.432 [vent.ItemStateChangedEvent] - VuPowerstatus changed from
false to
true
2020-05-04 11:15:28.432 [INFO ] [.eclipse.smarthome.model.script.Test] - Test