Hi all and a Merry Christmas / Happy New Year,
Had a few months away from OH due to work and Christmas and I’m just trying to debug a thermostat rule that isn’t working but the old grey matter doesn’t seem to be in gear. I’m sure it’s something stupid but I can’t seem to see it…
I have a dummy item
Number vThermostatCase "Thermostat Case Number [%s]"
which is called in a few rules and then ultimately runs this rule to change the temperature of the thermostat
rule "Set temperature from vThermostatCase"
when
Item vThermostatCase changed
then
// Run the case options
switch vThermostatCase.state {
case "0":{
// Turn down Thermostat to away mode
GF_HW_TS_SetPoint.sendCommand(16.5)
logInfo(logName, "vThermostatCase 0 - Setpoint 16.5")
sendBroadcastNotification("vThermostatCase 0 - Setpoint 16.5")
}
case "1":{
// Turn down Thermostat to holiday mode
GF_HW_TS_SetPoint.sendCommand(12.5)
logInfo(logName, "vThermostatCase 1 - Setpoint 12.5")
sendBroadcastNotification("vThermostatCase 1 - Setpoint 12.5")
}
case "2":{
// Turn up Thermostat to 20.5
GF_HW_TS_SetPoint.sendCommand(20.5)
logInfo(logName, "vThermostatCase 2 - Setpoint 20.5")
sendBroadcastNotification("vThermostatCase 2 - Setpoint 20.5")
}
case "3":{
// case 3
}
}
end
For example, when the house is empty, (vPresent = OFF), then turn down the thermometer
rule "Set temperature from Presence"
when
Item vPresent changed
then
if(vPresent.state == OFF)
{
vThermostatCase.sendCommand(0)
logInfo(logName, "Presence - No one is home - vThermostatCase 0 called")
}
end
However, whatever rule this goes into the case statement doesn’t seem to work.
I know the sendCommand part is correct as I can use this directly in a rule, ie
GF_HW_TS_SetPoint.sendCommand(16.5)
Will turn the thermostat to 16.5 degrees just fine, so it just seems to be the case statement…
Anything obvious???