Integrate WTH-2 Vacationmode into OH with predefined periods

Tags: #<Tag:0x00007f5c999173f8> #<Tag:0x00007f5c99916f98> #<Tag:0x00007f5c999169f8>

Hello Everyone,

This is my equipment:

  • openHAB version: 2.5
  • Homematic IP CCU3 (Firmware 3.51.6) and HmIP-WTH-2 (Firmware 2.6.0)

I want to integrate the Vacation function for the HmIP-WTH-2 with a rule and predefined periods for vacation ( 2h, 2d, 2w) and a button in my OH.

So i started to observe the process while normal change from manu mode to vacation mode via CCU3 WebUI and what happend in OH Control Panel.

Also I had discussions on “Openhabforum” to this topic ( see Link: Thread on german Forum

We found out, that the device needs for Start and End a special constructed String in this form “yyyy_MM_dd’ 'HH:mm”. (see Documentation of Homematic Devices)

According to this I coded my rule:

.sitemap
Switch item=VACATIONsetter label="VACATION" icon="climate" mappings=[0="STOP", 1="2h", 2="2T", 3="2W"]

.rules

rule "Heating-Shutdown because of Vacation"
    when
        Item VACATIONsetter received update
    then
        if (VACATIONsetter.state == 0) {
        logInfo("Debug", "Vacation state has been set OFF")
        }
        
        if (VACATIONsetter.state == 1) {
        logInfo("Debug", "vacation for 2h")
        var int hour = now.getHourOfDay()
        val String actuelDayTime1 = now.toString("yyyy_MM_dd' 'HH:mm")
        logInfo("Debug", "This Day: " + actuelDayTime1)
        val actuelDayTime_modifiedEnd = actuelDayTime1.replace(" " + hour.toString() ," " + (hour + 2).toString())
        logInfo("Debug", "Calculated Endtime of Vacation: " + actuelDayTime_modifiedEnd)
     
        //This is the Test, if the Command change works with String and Rule
        SHmIPZimmerThermostat_PartyTimeStart.sendCommand("2020_03_26 08:00")
        SHmIPZimmerThermostat_PartyTimeEnd.sendCommand("2020_03_26 10:00")
        
        //Also this code alternative doesn't work!
        //SHmIPZimmerThermostat_PartyTimeStart.postUpdate("2020_03_26 08:00")
        //SHmIPZimmerThermostat_PartyTimeEnd.postUpdate("2020_03_26 10:00")   
        }

        if (VACATIONsetter.state == 2) {
        logInfo("Debug", "vacation for 2d")
        }

        if (VACATIONsetter.state == 3) {
        logInfo("Debug", "vacation for 2w")
        }
    end

The Items SHmIPZimmerThermostat_PartyTimeEnd and SHmIPZimmerThermostat_PartyTimeStart have been created by the homematic binding and these are Strings.

The problem is that the WTH-2 is not stable going into vacation mode with the command via my rule.
While observing it in the CCU3 Web UI I can see that it is not fully changed into vacation. Picture

Did anyone of you use a WTH-2 and had the same issue?
Is there a failure with my constructed String-Command or Rule?
Is there another variable that should be driven, to make this work?

Thank you a lot.