Switch, Setpoint broken after 1.8.2 upgrade

I have a switch item which is controlled from both GUI and a rule. Worked fine with 1.8.1, but after upgrade to 1.8.2:

  • switching from OFF to ON in the GUI (event logged)
  • after some time it’s state changed back to OFF by the rule (event logged)
  • GUI (Classic UI) still shows ON, browser refresh does not help

At the same time there is no such an issue in iOS app.
Is it a bug?

Could you post your item, sitemap, and rule?

Setpoint is also stopped working - clicking on Up/Down arrows gives no result in Classic UI (but event is still logged). Here browser refresh does help a bit - value gets changed after refresh.

sitemap default label= "MyTest" {
		Frame label= "Demo items" {
		Switch item= Heater
		Text item= TemperatureOffice
		Setpoint item= TargetTemp minValue=5 maxValue=28 step=1
		}
		Frame label= "Temperature" {
		Chart item= TemperatureOffice period=D refresh=30000
		}
}

Items:

Goup    All
Group    Temperatures (All)    
Number    TargetTemp "Target Temperature [%d °C]" <temperature>
Switch    Delayed_Start
Switch  Heater "WebControl test" <heating> { http=">[ON:POST:http://192.168.5.236/api/setttloutput.cgi?output=1&state=1] >[OFF:POST:http://192.168.5.236/api/setttloutput.cgi?output=1&state=0]" }

Number TemperatureOffice "Ambient Temperature [%.1f °C]" <temperature> (Temperatures) { http="<[http://192.168.5.236/gett1.cgi:60000:REGEX(.*?(\\d+\\.\\d).*)]", mqtt=">[rpilocalbroker:myhouse/office/temperature:state:*:default]" }

And the rule:

// Rule to drive the Heater
rule "Heater"
when
    System started or
    Item TemperatureOffice received update or
    Item TargetTemp received update
then
    if (Delayed_Start.state == ON) {
    if((TemperatureOffice.state as DecimalType)+1 < (TargetTemp.state as DecimalType)) {
    if(Heater.state != ON) Heater.sendCommand(ON)
    }
else {
    if(Heater.state != OFF) Heater.sendCommand(OFF)
    }
}
end

My initial attempt to check your observations appears to confirm your experience. I took your items, sitemap and rule, made a few small changes (see below), and loaded them on a very vanilla openHAB 1.8.1 installation. They performed correctly as I expected that they would.

Then I performed a sudo apt-get update; sudo apt-get upgrade which installed openhab-runtime 1.8.2 over openhab-runtime 1.8.1. This step restarted the openHAB runtime.

Upon reloading the UI (which was very slow, but might have been due to a network situation), the UI was no longer updating the setpoint or the heater switch. The files I used for my test are below.

@teichsta, could you look into this?

default.sitemap:

sitemap default label= "MyTest" {
		Frame label= "Demo items" {
		Switch item= Heater
		Text item= TemperatureOffice
		Setpoint item= TargetTemp minValue=5 maxValue=28 step=1
		}
		//Frame label= "Temperature" {
		//Chart item= TemperatureOffice period=D refresh=30000
		//}
}

test.items:

Goup    All
Group    Temperatures (All)    
Number    TargetTemp "Target Temperature [%d °C]" <temperature>
Switch    Delayed_Start
Switch  Heater "WebControl test" <heating>

Number TemperatureOffice "Ambient Temperature [%.1f °C]" <temperature> (Temperatures)

test.rules:

import org.openhab.core.library.types.DecimalType

// Rule to drive the Heater
rule "Heater"
when
    Item TemperatureOffice received update or
    Item TargetTemp received update
then
    //if (Delayed_Start.state == ON) {
        if((TemperatureOffice.state as DecimalType)+1 < (TargetTemp.state as DecimalType)) {
            if(Heater.state != ON) Heater.sendCommand(ON)
        }
        else {
            if(Heater.state != OFF) Heater.sendCommand(OFF)
        }
    //}
end

rule Startup
when
  System started
then
    TargetTemp.postUpdate(15)
    TemperatureOffice.postUpdate(15)
end

…adding, that the behavior is the same problem after, so it doesn’t appear to be an apt-get upgrade issue.

sudo apt-get remove openhab-runtime
sudo apt-get install openhab-runtime

I added issue #4214 to track this.

1 Like

watou,
thanks for looking into this issue.

1 Like

Should one revert tu 1.8.1 until 1.8.3 comes out ?

So… whatever happened with this?

Still underway.

Fair enough!

1 Like