[SOLVED] SATEL Binding - PIR: movement detection and CONTACT: window tilted (ajar)

please help how can I add third state to window (ajar).
(In my windows I have installed 2 contactrons as 2 different zones in satel, so I know if window is opened or ajar). I’ve read to use string, but I’m not sure how to set the string with 2 zones.

And which icon or item type should I use for PIR state, to see if it is validated?

Thanks in advanced.

Please post your Items Definitions as they are now.

At a high level you need to use a String Item to represent the state of the Window. You will only update this Item with the words “ajar”, “open” and “closed” and use the icon “window”.

You will need a rule to interpret the states of the contacts into one of the three states.

Hello, thank You for reply :slight_smile:

My items right now:

Contact Zone2 “PIR saloon violated” (Zones) { satel=“zone:violation:2” }
Contact Zone9 “Okno sypialnia lewe” (Zones) { satel=“zone:violation:9” }
Contact Zone10 “Roof Window Bedroom right (above bad)” (Zones) { satel=“zone:violation:10” }
Contact Zone18 “PIR Bedroom” (Zones) { satel=“zone:violation:18” }
Contact Zone6 “Roof Window Tiga” (Zones) { satel=“zone:violation:6” }
Contact Zone23 “Tigers Window Tilted” (Zones) { satel=“zone:violation:23” }
Contact Zone24 “Tigers Window Opened” (Zones) { satel=“zone:violation:24” }
Contact Zone19 “Guest Window Tilted” (Zones) { satel=“zone:violation:19” }
Contact Zone20 “Guest Window Opened” (Zones) { satel=“zone:violation:20” }
Contact Zone21 “PIR Guest room” (Zones) { satel=“zone:violation:21” }

As You see I have “PIRs” as “contact” so it doesn’t look logic,
and I’ve made 2 different items for opened and ajar window (where ajar has opened icon, which is not logic too).

So, like I said, you need to add a String Item for each window.

Contact Zone19 "Guest Window Tilted" (Zones) { satel="zone:violation:19" }
Contact Zone20 "Guest Window Opened" (Zones) { satel="zone:violation:20" }
String Guest_Window "Guest Window [%s]" <window>

And a Rule to convert the two sensors to the word state of the window:

rule "Guest Window state"
    Item Zone19  changed or
    Item Zone20 changed
    var newState = "closed"
    if(Zone19.state == OPEN && Zone20.state == OPEN) newState = "open"
    else if(Zone19.state == OPEN && Zone20.state == CLOSED) newState = "ajar"


Works like charm even better! :slight_smile:
Because now I get text state all the time, AWESOME!

Do You know how to configure PIR motion sensors, so I could see it’s state changed?

PS (for somebody else reading)
in sitemap I’ve added:
Default item=Guest_Window

Just add them to your sitemap.

Text item="Zone21" label="PIR Guest room [%s]" icon="presence"

Did You mean “present” (I don’t see presence icon)?

Text item=Zone21 label=“PIR Guest room [%s]” icon=“present”

With your string I can finally get text state change but icon doesn’t change.

I did mean present and it appears that the default present icons only works with Switch Items.

Ok, so I’ll just use “motion” icon, which will not change, but that’s ok because now I get state change by text.
Thank You a lot! :slight_smile: Greets from Poland.