Tilt and Turn Windows: two contacts -- how?

I have tilt and turn windows with two contacts, one for each state… (tilt, turned)

How best to implement this?

I have the option:
a) to have a different restive value being reported
b) to send a MQTT message with the status as a word

[I am just looking at the icons, there is a window ajar]

So, we have a tri-state (ajar, open, closed)…

How do I display this on the sitemap?
What would a rule reading/display the state look like?

You will have to use a string item which will store open, closed and ajar. You could use two contact items to catch the two contacts and use a rule to set a proxy item, but if your contacts are at one board which can handle this, it would be more easy to send the strings directly to the item itself without the need for any rules…

1 Like

The icon displayed on the sitemap is based on the state of the Item. Obviously a Contact Item only has OPEN and CLOSED as possible states so the only way I can think of to use the ajar icon is to use a String Item.

If your Item is a String you can use the text “open”, “closed”, and “ajar” as the potential states. If you sensors are reporting over MQTT just have them report the states using those three words and everything should work out just fine.

In your rules you would do something like:

if(MyWindow.state.toString == "ajar")

You would display it on your sitemap as a Text element

Text item=MyWindow label="My Window [%s]" icon=window
1 Like