[SOLVED] Rule doesn't work UoM

Hello Community,

does anybody have an idea why this rule doesn’t work? The “if”-condition seems to be the problem.

rule "Heizung Bad Boost"

when
    Item Temp_Bad_soll received update
then
    if (Temp_Bad_soll.state == 28) {
		sendTelegram("bot1", "Die Heizung im Bad wurde für 45 min auf 28 °C gestellt.")
		createTimer(now.plusMinutes(45), [|
			Temp_Bad_soll.sendCommand(24)
			sendTelegram("bot1", "Die 45 min sind vorüber; Heizung jetzt bei 24 °C.")
		])
    }
end

Thank you in advance!
Christoph

Perhaps state is never exactly 28
28.0005 will not match.

Perhaps state is 28 °C That will never match 28 either.

1 Like

@rossko57 Even if Temp_Bad_soll is the temperature setpoint of the thermostat which is set via sitemap?

I assume this item is a Number item? Does it have some dimension?
in case it has a dimension i think you have to add it to your if condition.

best regards,
martin

That’s the one

Thanks, @martin111 and @vzorglub, for this hint.

Just had a look for the dimension issue and found this thread:

Is it possible, that the rule doesn’t work anymore since the OH 2.5 update?
Otherwise: what would you recommend how to change the if-condition concerning the dimension?

The “how to use the dimension” is written in the thread you found!

I’m not on 2.5, but have seen this in 2.4 as well.

syntax is something like: (I have not tested below)

if (Temp_Bad_soll.state == 28|°C)

I would suggest to check your actual Item state. Write a line to your log before the if condition and see whats exactly in the item state. for instance:

logInfo(“test”,"Bad Temperatur: " + Temp_Bad_soll.state)

Why don’t you display the value of Temp_Bad_soll with a logInfo()?
Or look in events.log and see what’s happening to it?
And then share your result.
Everything here is guesses, because only you have that information.
Improve the quality of the help you seek .

That’s it! Thanks!