Nee, das ist ein bisschen zu viel Code... Und ich hab auch einen Typo (ist beim Verschieben passiert...)
Code:
rule "Fernseher an/aus"
when
Item harmony_hub_tv_act received command
then
switch(receivedCommand) {
case ON : {
harmony_hub_tv.sendCommand("TVgucken")
logInfo("TV_an_aus","RolloWohnen_site.state: {}",RolloWohnen_site.state)
if(!(RolloWohnen_site.state instanceof DecimalType) || (RolloWohnen_site.state as DecimalType).intValue < 70) {
logInfo("TV_an_aus","RolloWohnen_site verfahren auf 70%%")
RolloWohnen_site.sendCommand(70)
}
logInfo("TV_an_aus","RolloEckeSued_site.state: {}",RolloEckeSued_site.state)
if(!(RolloEckeSued_site.state instanceof DecimalType) || (RolloEckeSued_site.state as DecimalType).intValue < 70) {
logInfo("TV_an_aus","RolloWohnen_site verfahren auf 70%%")
RolloEckeSued_site.sendCommand(70)
}
}
case OFF : {
harmony_hub_tv.sendCommand("PowerOff")
}
}
end



Kommentar