Yet another Heating Setup

hi,
all relevant items, things and rules are in first post already…

is there something missing?

19 days ago you post new rules and screenshots without items, sitemap configuration.
If look both screenshots (first and last) can see you change code and in first post you usage ITEM “TransferItem1” on Webview and no information more about “TransferItem1”, you can please update information ?
Thank you.
B.R…

I posted simplified ruleset but nothing else was changed. First post is still relevant as well as simplified ruleset.

TransferItem1 is something you have to define in your timelinepicker.rules which are completely separated and I did not went thorough of explaining this bit as I do expect whomever wants to use it, know how (and there is extensive post linked about how to work with it anyway)

in rule relevant to timelinepicker you need to do just this, but as this is quite obvious I did not explicitly said that

val HashMap<String,ArrayList<String>> timePicker = newHashMap(
    "TransferItem1" -> newArrayList('Heating_AutoState')
)

small update from real life usage after almost 3months.
Everything working like a charm.

only thing I needed to do is to relocate and adjust some of the temperature sensors, as they either were reporting lower temps (because they were near to the wall for example) or they were reporting higher values (because they were exposed to sun)
I was expecting this need from begining, but that’s longer process which have to be observed place by place… so that’s fine :wink:

Other than that, house is being nicely heated when needed and there is literally 0 need of interacting with it whatsoever.

I’m pretty happy with that so far.

A complete tutorial on how to do this in OH3 would be awesome (from installation of required plugins, to rules, to whatever).

this is working in OH3 as well, there was (maybe is) cheat sheet what you need to change in order to OH3 ruleengine works properly.

Main thing was to adapt TimeLinePicker for OH3, my rules are quite compatible I hope :wink:

this is my current OH3 rule file for it

val logName = "HEATING"

rule "Heating"
when
    Item HeatingHouseTemp changed or
    Member of HeatingTrigger changed or
    Item hPresence changed or
    Item vTimeOfDay received update
then
    // UNDEF & NULL checks
    if(HeatingHouseTemp.state == UNDEF || HeatingHouseTemp.state == NULL) return;               // do not continue when there is no temperature
    if(Heating_Mode.state == UNDEF || Heating_Mode.state == NULL) Heating_Mode.postUpdate(OFF)  // automode is default

    // Calculate what needs to be done.
    var actualTemp = (if(Heating_Style.state == ON) HeatingHouseMin.state else HeatingHouseTemp.state) as Number

    var Number baseTemp = 0
    var Number upper = 0
    var Number lower = 0
    var timepicker = ''
    var actualstate = ''


    // manual override
    if(Heating_Mode.state == ON){
        baseTemp = Heating_Temp_Manual.state as Number
        if(vTimeOfDay.state == "NIGHT") { upper = -1.5;  lower = -3.5 } // 22 => 20.5 - 18.5
        else                            { upper = 0.3;   lower = -0.5 } // 22 => 22.3 - 21.5
    }

    // auto mode
    else {
        switch(Heating_Plan.state.toString){
            case "WINTER": {
                timepicker = Heating_AutoState.state.toString
                actualstate = timepicker
                
                if(timepicker.toString == "Away" && hPresence.state == ON) actualstate = "Normal"  // somebody is home, but automatic program is on Away, so force it to heating

                postUpdate(holderHeatingState, actualstate)

                if      (actualstate.toString == "Comfort") { upper = 0.5; lower = 0;    baseTemp = Heating_Temp_Normal.state as Number }   // comfort
                else if (actualstate.toString == "Normal")  { upper = 0.3; lower = -0.5; baseTemp = Heating_Temp_Normal.state as Number }   // normal
                else if (actualstate.toString == "Away")    { upper = 0;   lower = -0.5; baseTemp = Heating_Temp_Away.state as Number }     // away
                else                                        { upper = 0.2; lower = -0.7; baseTemp = Heating_Temp_Night.state as Number }    // night
            }
            case "AWAY": { baseTemp = 15; upper = 0; lower = -1.5 } // max 15 min 13.5 when away
            default:     { baseTemp = 17; upper = 0; lower = -2 }   // max 17 min 15 during summer period
        }
    }
    
    val Number targetTemp = baseTemp + upper
    val Number lowerTemp = baseTemp + lower


    // Heating ON/OFF
    var heatingState = "STAY"
    
    if      (actualTemp >= targetTemp)  heatingState = "OFF"
    else if (actualTemp <= lowerTemp)   heatingState = "ON"

    if(heatingState != "STAY" && Heating.state.toString != heatingState){
        Heating.sendCommand(heatingState)
        logInfo(logName, "Current temp is " + actualTemp + " and target temp is " + targetTemp + " : Heating " + heatingState)
    }
end



rule "Helpers: End Manual Heating mode at 2.02 am"
when
    Time cron "0 2 2 ? * * *"
then
    Heating_Mode.sendCommand(OFF)
end