This rule sort of works, nearly, it is intended to switch off the Central Heating when the maximum actual temperature of any TRV in a group is greater than the maximum desired temperature of any TRV in the group. In other words, the actual temp is higher than the highest setpoint for a TRV.
However, what happens when max actual > max setpoint , is that when I move a Switch widget (for Central Heating) on a Sitemap , from OFF to ON, widget immediately indicates ON then immediately goes to OFF (I suspect, the rule fires and correctly turns off the Switch). However the Sitemap widget then goes back to ON and only after I refresh the screen , does the widget now indicates OFF.
I have checked the openhab.log and the automated message is fired as soon as I select ON .So how do I refresh a sitemap in the rule? although I wouldn’t have thought I needed to do this because the widgets are linked to items linked to channels/groups so OH knows to refresh the ON/OFF widget?
Rule
rule
"HVAC_CH_Off"
when
Member of g_TRV_Actual_Temperature changed
or Member of g_TRV_Set_Temperature changed
or Member of g_HVAC_Switch changed to ON
then
/*
logInfo("HVAC_CH_Off.rules", "Checking ACTUAL temp {} against MAX temp {}", g_TRV_Actual_Temperature.state, g_TRV_Set_Temperature.state)
*/
if (i_HVAC_CH_Switch.state == ON && (g_TRV_Actual_Temperature.state >= g_TRV_Set_Temperature.state)) {
i_HVAC_CH_Switch.sendCommand(OFF)
logInfo("HVAC_CH_Off.rules", "CENTRAL HEATING turned off by rule")
}
end
Items
Group g_HVAC
Group g_HVAC_Switch
Group:Number:MAX g_TRV_Actual_Temperature "Max Temp TRV"
Group:Number:MAX g_TRV_Set_Temperature "Max Temp TRV"
...
String i_TRV_Lounge_Get_Temperature "Current temperature [%s]C" <temperature> (g_HVAC, g_TRV, g_TRV_Actual_Temperature) {channel="mqtt:topic:b_MQTT_Broker:t_TRV_Lounge:c_Temperature"}
String i_TRV_Lounge_Set_Temperature "Set temperature [%s]" <temperature> (g_HVAC, g_TRV, g_TRV_Set_Temperature) {channel="mqtt:topic:b_MQTT_Broker:t_TRV_Lounge:c_Set_Temperature"}
...
/* Danfoss RF Controller */
Switch i_HVAC_CH_Switch "CH On/Off" <switch> (g_HVAC, g_HVAC_Switch) {channel = "zwave:4849599d:t_Zcontroller:node3:swtich_binary2"}
Switch i_HVAC_HW_Switch "HW On/Off" <switch> (g_HVAC, g_HVAC_Switch) {channel = "zwave:4849599d:t_Zcontroller:node3:swtich_binary1"}
Sitemap
Frame label="HEATING CONTROLS" {
Switch item=i_HVAC_CH_Switch label="Central heating On/Off"
Switch item=i_HVAC_HW_Switch label="Hot water On/Off"
Text item=g_TRV_Set_Temperature label="Max desired temperature [%.1f]" icon="temperature"
Text item=g_TRV_Actual_Temperature label="Max ACTUAL temperature [%.1f]" icon="fire"
}
???
EDIT: Oh, and I’m on a LAN (i.e. not Cloud / WAN) , and , I am using the OH app on Android. I note a refresh must be done manually (swipe down on Android) and browser (F5).,
Events
2020-01-13 20:51:16.604 [GroupItemStateChangedEvent] - g_TRV_Actual_Temperature changed from 21.6992 to 21.5 through i_TRV_Lounge_Get_Temperature
2020-01-13 20:56:04.396 [ome.event.ItemCommandEvent] - Item 'i_HVAC_CH_Switch' received command ON
2020-01-13 20:56:04.470 [nt.ItemStatePredictedEvent] - i_HVAC_CH_Switch predicted to become ON
2020-01-13 20:56:04.521 [vent.ItemStateChangedEvent] - i_HVAC_CH_Switch changed from OFF to ON
2020-01-13 20:56:04.524 [ome.event.ItemCommandEvent] - Item 'i_HVAC_CH_Switch' received command OFF
2020-01-13 20:56:04.586 [nt.ItemStatePredictedEvent] - i_HVAC_CH_Switch predicted to become OFF
2020-01-13 20:56:04.607 [vent.ItemStateChangedEvent] - i_HVAC_CH_Switch changed from ON to OFF