OpenHab - Node-red Status setup

Hi All I want to share a small part of my OpenHab - Node-red Setup
I have just implemented it, and it’s working very cool and gives me a lot of flexibility over my system, maybe someone can help me even improve on this

ok, so it goes like this…
i have a String item in openhab called “HomeState”

the values are HOME, ALARM, SLEEP, AWAY, HOLYDAY
Home is when I am home :slight_smile:
Alarm is when the security is on(but tell no one :slight_smile: )
Sleep …
Away is override mode for me
Holyday - for me I cannot press any button on holydays, so i need some automations to come off and not work on holy days

ok so far this was my old setup, now added something that u can call a user system
as all my flows run in node-red, this part of the flow is only configured there

so let’s see how it goes …
i start each flow, let’s say RF signals from PIR sensor will get msg.usr = PIR
so each msg object will have msg.usr = PIR starting from here


next, we go into the subflow Logic Gate
this Subflow will query OH for house State, so let’s say we are home
image

now we go into the home Switch, this will query msg.usr and will direct the msg
to the corect output
image
from there i use the two outputs for good and bad outputs…
so if i need the good and authorize output i use 1 … but some times you want to know whats going on , so to write error string on the 2 output
so we will know what went wrong

so now i can turn off rules, from this subflow and not go into the flows
i will just debug the flow that is giving me trouble and will remove that user, from that state, or add if need to

hope i was able to explain myself :slight_smile: