Combine two Radiatior Valves with a Rule

Hi,

i´m trying to combine two Eurotronic Spirit Radiator Valves with an rule, so I can change one item and the two setpoints change as well.
I thought it is a easy work but no.
My rule lokks like this:

rule Wohnzimmer_Soll_Temp
when
    Item Wohnzimmer_Soll_Temp_Heizen changed
then
    HT_WohnzimmerLinks_SetpointHeat.sendCommand(Wohnzimmer_Thermostatmode.state as Number)
    HT_WohnzimmerRechts_SetpointHeat.sendCommand(Wohnzimmer_Thermostatmode.state as Number)
end

The item of the radiator valves are made in paper ui and have the type Number:Temperature.

When I change “Wohnzimmer_Soll_Temp_Heizen” in my log apears:

Wohnzimmer_Soll_Temp_Heizen changed from 19 °C to 18 °C

Item 'HT_WohnzimmerLinks_SetpointHeat' received command 0
HT_WohnzimmerLinks_SetpointHeat predicted to become 0
Item 'HT_WohnzimmerRechts_SetpointHeat' received command 0
HT_WohnzimmerRechts_SetpointHeat predicted to become 0
HT_WohnzimmerLinks_SetpointHeat changed from 2E+1 °C to 0.0 °C
HT_WohnzimmerRechts_SetpointHeat changed from 22 °C to 0.0 °C
HT_WohnzimmerLinks_SetpointHeat changed from 0.0 °C to 2E+1 °C
HT_WohnzimmerRechts_SetpointHeat changed from 0.0 °C to 22 °C

Can someone help me?

Please use code fences

What does your logs tell you?

I sorry I was to fast with sending. I edited my previous post

I made a copy and paste mistake.

Add some logging

rule Wohnzimmer_Soll_Temp
when
    Item Wohnzimmer_Soll_Temp_Heizen changed
then
    logInfo("TEST", "Wohnzimmer_Thermostatmode.state :" + Wohnzimmer_Thermostatmode.state.toString)
    HT_WohnzimmerLinks_SetpointHeat.sendCommand(Wohnzimmer_Thermostatmode.state as Number)
    HT_WohnzimmerRechts_SetpointHeat.sendCommand(Wohnzimmer_Thermostatmode.state as Number)
end

Do you really want to set the SetpointHeat to Thermostatmode? Not Soll_Temp_Heizen?

I guess the rule should be more like

rule Wohnzimmer_Soll_Temp
when
    Item Wohnzimmer_Soll_Temp_Heizen changed
then
    HT_WohnzimmerLinks_SetpointHeat.sendCommand(Wohnzimmer_Soll_Temp_Heizen.state as Number)
    HT_WohnzimmerRechts_SetpointHeat.sendCommand(Wohnzimmer_Soll_Temp_Heizen.state as Number)
end

Please be aware that this rule will throw a null-pointer exception if Wohnzimmer_Soll_Temp_Heizen.state changed to a non-Number (i.e. NULL or UNDEF)

If defining Wohnzimmer_Soll_Temp_Heizen as a Group:Number Item and adding both HT_WohnzimmerLinks_SetpointHeat and HT_WohnzimmerRechts_SetpointHeat to this new group, you should not need a rule at all.