Hey there,
im trying to change the mode of my AVM 301 heating radiator when I arrive at home, depending on the temperatur there is.
I dont get, why openHAB always sends the BOOST command, even if COMFORT would be enough.
rule "Anwesenheit"
when
Item Presence changed to ON
then
val TempIst = TempWZ.state as Number
val TempSoll = WZHeizungComfortTemp.state as Number
val diff = TempSoll - TempIst
if(diff>= 5)
{
if(WZHeizungRadiatorMode.state != "BOOST") WZHeizungRadiatorMode.sendCommand("BOOST")
}else{
if(WZHeizungRadiatorMode.state != "COMFORT") WZHeizungRadiatorMode.sendCommand("COMFORT")
}
end
Try this and change diff value to what works best for you.
rule "Anwesenheit"
when
Item Presence changed to ON
then
var TempIst = TempWZ.state as Number
var TempSoll = WZHeizungComfortTemp.state as Number
val diff = TempSoll - TempIst
if(diff>= 5)
{
if(WZHeizungRadiatorMode.state != "BOOST") WZHeizungRadiatorMode.sendCommand("BOOST")
}else if (diff>= 2){
if(WZHeizungRadiatorMode.state != "COMFORT") WZHeizungRadiatorMode.sendCommand("COMFORT")
}
end
It would probably help to log out what diff actually is, to compare with what you are hoping it is. logInfo("myTest", "variable diff is " + diff.toString)
I think you may get a surprise because TempWZ state is a simple Number but WZHeizungComfortTemp is a Number:Temperature with units.