@hmerk @rlkoshak can you help with this please… I’ve stared at this many times and cannot see what is wrong with this:…
Switch item=i_HVAC_CH_Switch_Proxy label="Central heating" icon="fire-on" visibility=[i_HVAC_CH_Switch == ON] mappings=[ON="ON",OFF="OFF",AUTO="AUTO"]
Switch item=i_HVAC_CH_Switch_Proxy label="Central heating" icon="fire-off" visibility=[i_HVAC_CH_Switch == OFF] mappings=[ON="ON",OFF="OFF",AUTO="AUTO"]
The fire-on is displayed even when i_HVAC_CH_Switch == OFF and i_HVAC_CH_Switch_Proxy == AUTO
??
Rule
rule
"HVAC_CH"
when
Item g_TRV_Actual_Temperature changed
or
Item g_TRV_Set_Temperature changed
or
Item i_HVAC_CH_Switch_Proxy changed
then
// Check if boiler can be turned OFF or ON in Auto mode
if (i_HVAC_CH_Switch_Proxy.state == "AUTO") {
var Number temperature = g_TRV_Actual_Temperature.state as Number
var Number demand = g_TRV_Set_Temperature.state as Number
val Number hysteresis = 0.5
logInfo("HVAC_CH_Off.rules", "CH AuTO mode checking...")
logInfo("HVAC_CH_Off.rules", "...temperature={} demand={}", temperature, demand)
logInfo("HVAC_CH_Off.rules", "...using hysteresi, go ON if temp < {}", (demand - hysteresis))
logInfo("HVAC_CH_Off.rules", "...using hysteresi, go OFF if temp > {}", (demand + hysteresis))
if (temperature < (demand - hysteresis)) {
// Turn on
i_HVAC_CH_Switch.sendCommand(ON)
logInfo("HVAC_CH.rules", "...CH turned ON by AUTO rule")
} else if (temperature > (demand + hysteresis)) {
// Turn Off
i_HVAC_CH_Switch.sendCommand(OFF)
logInfo("HVAC_CH.rules", "...CH turned OFF by AUTO rule")
}
} else if (i_HVAC_CH_Switch_Proxy.state == "ON") {
// Turn ON by user demand
i_HVAC_CH_Switch.sendCommand(ON)
logInfo("HVAC_CH.rules", "CH turned ON by rule")
} else if (i_HVAC_CH_Switch_Proxy.state == "OFF") {
// Turn ON by user demand
i_HVAC_CH_Switch.sendCommand(OFF)
logInfo("HVAC_CH.rules", "CH turned OFF by rule")
}
/*
//Check if boiler needs to be turned ON
if (i_HVAC_CH_Switch.state == OFF && (g_TRV_Actual_Temperature.state < g_TRV_Set_Temperature.state)) {
i_HVAC_CH_Switch.sendCommand(ON)
logInfo("HVAC_CH.rules", "CENTRAL HEATING turned ON by rule")
}
*/
end
events.log
020-01-16 12:37:49.342 [vent.ItemStateChangedEvent] - i_HVAC_CH_Switch_Proxy changed from ON to OFF
2020-01-16 12:37:49.361 [ome.event.ItemCommandEvent] - Item 'i_HVAC_CH_Switch' received command OFF
2020-01-16 12:37:49.387 [nt.ItemStatePredictedEvent] - i_HVAC_CH_Switch predicted to become OFF
2020-01-16 12:37:49.413 [vent.ItemStateChangedEvent] - i_HVAC_CH_Switch changed from ON to OFF
2020-01-16 12:37:50.120 [ome.event.ItemCommandEvent] - Item 'i_HVAC_CH_Switch_Proxy' received command AUTO
2020-01-16 12:37:50.134 [vent.ItemStateChangedEvent] - i_HVAC_CH_Switch_Proxy changed from OFF to AUTO
2020-01-16 12:37:50.198 [ome.event.ItemCommandEvent] - Item 'i_HVAC_CH_Switch' received command OFF
2020-01-16 12:37:50.225 [nt.ItemStatePredictedEvent] - i_HVAC_CH_Switch predicted to become OFF
[12:41:34] openhabian@openhab:~$
openhab.log
2020-01-16 12:37:50.155 [INFO ] [thome.model.script.HVAC_CH_Off.rules] - CH AuTO mode checking...
2020-01-16 12:37:50.161 [INFO ] [thome.model.script.HVAC_CH_Off.rules] - ...temperature=16 demand=15
2020-01-16 12:37:50.171 [INFO ] [thome.model.script.HVAC_CH_Off.rules] - ...using hysteresi, go ON if temp < 14.5
2020-01-16 12:37:50.179 [INFO ] [thome.model.script.HVAC_CH_Off.rules] - ...using hysteresi, go OFF if temp > 15.5
2020-01-16 12:37:50.200 [INFO ] [smarthome.model.script.HVAC_CH.rules] - ...CH turned OFF by AUTO rule
[12:
On the 3 way switch I went to OFF then from OFF to AUTO
A rule sets i_HVAC_CH_Switch to OFF because in AUTO the actual temp is above the demand temp so turn off boiler which is correct. But the boiler is already OFF because I went from OFF to AUTO , so boiler was already OFF. The events.log shows “…to become OFF” but never forcibly goes to OFF . Could that be it?
I also have widgets only visible in AUTO mode and these correctly occult when Proxy item is ON or OFF, and are displayed correctly when in AUTO so i know the system has the correct Proxy value, and in the log file one can see the rule being activated and turning boiler of OFF , but the fire-on icon is displayed , which is incorrect.
Fire-off is correctly displayed when I move the Proxy item swtich to OFF.
Strange
??