Now i’m in “production” with two out of three appartments, but while the first (seems) to run without a hazzle, the second is not.
The task is a very simple heating control: when the set-temperature or act-temperature is changed, both are handled, together with the associated valve switch, in a functor. Problem is: while manual inspection of the values implies the valve should be switched on (its normally open), there is never any command sent to the valve after initialization.
The log exerpt:
2015-11-01 15:22:03.958 [INFO ] [runtime.busevents ] - wbf3_bath_therm0_tempSet state updated to 21.00
2015-11-01 15:22:03.960 [INFO ] [runtime.busevents ] - wbf3_bath_therm0_tempAct state updated to 21.30
2015-11-01 15:22:03.963 [DEBUG] [al.engine.RuleEngine] - Executing rule 'wbf3_bath_therm0'
2015-11-01 15:22:05.113 [INFO ] [runtime.busevents ] - wbf3_bath_valve_state state updated to OFF
2015-11-01 15:22:51.849 [INFO ] [runtime.busevents ] - wbf3_bath_therm0_tempSet state updated to 21.00
2015-11-01 15:23:11.883 [INFO ] [runtime.busevents ] - wbf3_bath_therm0_tempAct state updated to 21.40
2015-11-01 15:23:11.892 [DEBUG] [al.engine.RuleEngine] - Executing rule 'wbf3_bath_therm0'
2015-11-01 15:25:50.115 [INFO ] [runtime.busevents ] - wbf3_bath_therm0_tempSet state updated to 21.00
2015-11-01 15:26:10.115 [INFO ] [runtime.busevents ] - wbf3_bath_therm0_tempAct state updated to 21.60
2015-11-01 15:26:10.118 [DEBUG] [al.engine.RuleEngine] - Executing rule 'wbf3_bath_therm0'
The relevant part from the rules
/*
Functor for handling heating valves
*/
val org.eclipse.xtext.xbase.lib.Functions$Function3 tempControl = [
org.openhab.core.library.items.NumberItem set,
org.openhab.core.library.items.NumberItem act,
org.openhab.core.library.items.SwitchItem valve |
if (set.state == Uninitialized || act.state == Uninitialized) {
logDebug("wbfRule", "temperature undefined, exit")
return false
}
var Number setValue = set.state as DecimalType
var Number actValue = act.state as DecimalType
// globals not accessible from lambda
if (setValue < actValue - 0.1) {
// valve is normally open: ON -> close valve
sendCommand(valve, ON);
} else if (setValue > actValue) {
// valve is normally open: OFF -> open valve
sendCommand(valve, OFF);
}
]
/***************************************************************************
heating
*/
rule "wbf3_bath_therm0"
when
Item wbf3_bath_therm0_tempSet changed
or
Item wbf3_bath_therm0_tempAct changed
then
tempControl.apply(wbf3_bath_therm0_tempSet, wbf3_bath_therm0_tempAct, wbf3_bath_valve_state)
end
The “update to OFF” seems to stem from the openHAB initialization sequence. After this, even when the rule logic implies it should be triggered, the valve is NEVER set to ON. Is there something obvious i’m missing???
The items are configured correctly (i can switch the valves by hand via the sitemap).
Problem is: i need ANY workaround as this is the automation for a rented appartment (that should get warm in winter…).