Homematic rules help needed

Hi,
I managed to setup Openhabian on my Raspi. I installed the demo files
as well and all my things and items were successfully discovered.
Two thermostats (Homematic HM-CC-RT-DN) and one wall thermostat HG_HM_TC_IT_WM_W_EU are in my setup.
To start out I want to keep it extremely simple:
Whenever I change the wall thermostat (which is in manual mode)
the radiator thermostats’ target temperature should be set to
the value of the wall thermostat.

var Number temperature = 0
var Number oldTemperature = 0

rule "woziTemp"
when
         Item homematic_HG_HM_TC_IT_WM_W_EU_HMCFGUSB2_MEQ0869632_2_SET_TEMPERATURE received update
then
        temperature = homematic_HG_HM_TC_IT_WM_W_EU_HMCFGUSB2_MEQ0869632_2_SET_TEMPERATURE.state
        logInfo("wozi", "" + oldTemperature + " - " + temperature)
        if (temperature != oldTemperature) {
                oldTemperature = temperature
                // Regal
                homematic_HG_HM_CC_RT_DN_HMCFGUSB2_LEQxxxxxx_4_SET_TEMPERATURE.state = temperature
                // Couch
                homematic_HG_HM_CC_RT_DN_HMCFGUSB2_MEQxxxxxx_4_SET_TEMPERATURE.state = temperature
                logInfo("wozi", "Temperature set to " + temperature)

        }
end


This rule works OK. But what drives me up the wall is that the radiator thermo
stats set themselves back to the previous value after a couple of minutes.
See the log below.

2017-02-18 14:51:54.270 [ItemStateChangedEvent     ] - homematic_HG_HM_TC_IT_WM_W_EU_HMCFGUSB2_MEQ0xxxxxx_2_SET_TEMPERATURE changed from 29.00 to 27.50
2017-02-18 14:51:54.302 [ItemStateChangedEvent     ] - homematic_HG_HM_CC_RT_DN_HMCFGUSB2_LEQ1xxxxxx_4_SET_TEMPERATURE changed from 22.50 to 27.50
2017-02-18 14:51:54.307 [ItemStateChangedEvent     ] - homematic_HG_HM_CC_RT_DN_HMCFGUSB2_MEQ1xxxxxx_4_SET_TEMPERATURE changed from 22.50 to 27.50
2017-02-18 14:52:04.724 [ItemStateChangedEvent     ] - homematic_HG_HM_CC_RT_DN_HMCFGUSB2_LEQ1188821_4_SET_TEMPERATURE changed from 27.50 to 22.50
2017-02-18 14:52:12.224 [ItemStateChangedEvent     ] - homematic_HG_HM_CC_RT_DN_HMCFGUSB2_MEQ1546967_4_ACTUAL_TEMPERATURE changed from 25.60 to 25.50
2017-02-18 14:52:12.237 [ItemStateChangedEvent     ] - homematic_HG_HM_CC_RT_DN_HMCFGUSB2_MEQ1546967_4_SET_TEMPERATURE changed from 27.50 to 22.50


Any idea what I’m doing wrong?

Cheers,
Christian

1 Like

Why do you want to use a rule for this purpose? An easier way would be create in Homematic a group with the thermostats. If you do it this way you could change the radiator temperature even if OH is offline.

I have configured it this way. Via OH I set the temperature of the wall thermostat and this then sets the temperature of the connected radiators.

I wouldn’t do this approach also. I would just pair the devices directly. Then you are not relying on OH or a CCU.

This will not work:
homematic_HG_HM_CC_RT_DN_HMCFGUSB2_LEQxxxxxx_4_SET_TEMPERATURE.state = temperature

You need to send a command like this:
homematic_HG_HM_CC_RT_DN_HMCFGUSB2_LEQxxxxxx_4_SET_TEMPERATURE.sendCommand(temperature)

Thanks a lot both of you, Martin and Markus!

I will definately look into the group thing. But the sendCommand did the trick
for me at the moment.

Cheers,
Christian

Oh. There is another option to send command:

sendCommand(homematic_HG_HM_CC_RT_DN_HMCFGUSB2_LEQxxxxxx_4_SET_TEMPERATURE, temperature)

Most people use the above. I prefer the other.