Strange Thermostat behaviour

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"
    Item vThermostatCase changed 
    // Run the case options
    switch vThermostatCase.state {
        case "0":{
            // Turn down Thermostat to away mode
                logInfo(logName, "vThermostatCase 0 - Setpoint 16.5")
                sendBroadcastNotification("vThermostatCase 0 - Setpoint 16.5")
        case "1":{
            // Turn down Thermostat to holiday mode
                logInfo(logName, "vThermostatCase 1 - Setpoint 12.5")
                sendBroadcastNotification("vThermostatCase 1 - Setpoint 12.5")
        case "2":{
            // Turn up Thermostat to 20.5
                logInfo(logName, "vThermostatCase 2 - Setpoint 20.5")
                sendBroadcastNotification("vThermostatCase 2 - Setpoint 20.5")
        case "3":{
            // case 3

For example, when the house is empty, (vPresent = OFF), then turn down the thermometer

rule "Set temperature from Presence"
    Item vPresent changed
    if(vPresent.state == OFF)
        logInfo(logName, "Presence - No one is home - vThermostatCase 0 called")

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


Will turn the thermostat to 16.5 degrees just fine, so it just seems to be the case statement…

Anything obvious???

Should be:

        case 0 : {

It’s a number so no quotes

Ah, what a wally! Thanks for that…I blame the rum!

Please tick the solution, thanks
And stop the rum, stick to bourbon.