I have the following rule for checking a door contact. If the contact is triggered to ON, an if check follows to check the general presence in the house (number item JemandAnwesend):
rule "Terrassentür auf"
when
Item Terrassentuer changed from OFF to ON
then
if(JemandAnwesend.state == 0) {
sendBroadcastNotification("Terrassentür auf!!")
}
end
Unfortunately, the notification is never broadcasted. I checked the item “JemandAnwesend”, which was set to 0 according to the event log:
2016-12-03 18:16:25.694 [ItemStateChangedEvent ] - JemandAnwesend changed from 1 to 0
Oddly enough, the rule is triggered when it’s:
if(JemandAnwesend.state == "0") (Value set in exclamation mark)
Is this logical? I have other rules and haven’t set values in exclamation marks anywhere. But here it seems to be the only solution to get this rule running.
Any thoughts from the rule gurus out here are appreciated!
@Kai: Yes, that would be logical. But it is defined as a Number item.
@Udo: I’ve already tried this with no luck. But I will try it again.
Wait…
It was a number item, but I changed it to String some hours ago to get a better layout on the main menu (mapping in the item file to get the mapped state as a text item on the sitemap).
Well, then everything makes sense and is absolutely logical.