I would like to have a function where, if I set my house to “sleep” or “away” mode, I can get notified when any windows from a list are open. Can anyone think of a way, other than have a condition and action for checking each window? I was hoping to “push” a list of all open windows into a variable and then send a single notification with a list.
Look at this condition that I use, although the strings are in spanish, are self-explanatory._security_status Yes ((main_door_open AND kitchen_patio_close AND !roof_door_open) AND alarm_conditions) ? "{tone:tts}{BGColor:red}{FGColor:red}Alerta! Puerta principal abierta!" : ((!main_door_open AND !kitchen_patio_close AND !roof_door_open) AND alarm_conditions) ? "{tone:tts}{BGColor:red}{FGColor:red}Alerta! Puerta patio abierta!" : ((!main_door_open AND kitchen_patio_close AND roof_door_open) AND alarm_conditions) ? "{tone:tts}{BGColor:red}{FGColor:red}Alerta! Puerta ruf abierta!" : ((main_door_open AND !kitchen_patio_close AND !roof_door_open) AND alarm_conditions) ? "{tone:tts}{BGColor:red}{FGColor:red}Alerta! Puerta principal y patio!" : ((main_door_open AND kitchen_patio_close AND roof_door_open) AND alarm_conditions) ? "{tone:tts}{BGColor:red}{FGColor:red}Alerta! Puertas principal y ruf abiertas!" : ((!main_door_open AND !kitchen_patio_close AND roof_door_open) AND alarm_conditions) ? "{tone:tts}{BGColor:red}{FGColor:red}Alerta! Puertas patio y ruf abiertas!" : ((main_door_open AND !kitchen_patio_close AND roof_door_open) AND alarm_conditions) ? "{tone:tts}{BGColor:red}{FGColor:red}Alerta! Todas las puertas abiertas!" : ((!main_door_open AND kitchen_patio_close AND !roof_door_open) AND alarm_conditions) ? "{tone:tts}{BGColor:red}{FGColor:blue}La casa est? segura" : "{tone:none}{BGColor:red}{FGColor:green}Seguridad desactivada"
BTW, the alarm_conditions are things that you set for your alarm to be active, it can be a virtual switch, other conditions, whatever you whant.
Thanks for this Vreo, unfortunately its not as self explanatory to me as you might hope ;-)… My fault not yours.
I understand the conditions like this:
((main_door_open AND !kitchen_patio_close AND roof_door_open) AND alarm_conditions)
But then you follow it with this:
? “{tone:tts}{BGColor:red}{FGColor:red}Alerta! Todas las puertas abiertas!”
Is the second part actually generating a notification from within the condition? I was not even aware that you could do this if so.
What I really want to do is to generate one alert with a list of open windows or doors. Does yours do this, or does it generate one alert for each condition?
Sorry, no problem. You are not generating the notificaction per se, but you are generating a string, depending on the status of any combination of triggers. So the result of the condition _security_status (that could be without the initial hyphen now, but as you can see the “yes” in the second column means it is a repeating event), would be the string, then you can use that string in another condition to trigger the alert, example:
security_alert Yes _security_status
The action of this last condition would be send alert and the content text of the alert would be ({_security_status})
OK I appreciate the help… Can I ask a couple more questions to ensure I understand fully… Can you clarify some of the function of some of the parts of the condition:
_security_status - Do you prefix a condition name with an underscore to cause it to behave in a different way?
I think having referred to the PLEG Basics guide, you are implementing an “If / Then / Else” statement here. My issue is that I have about 20 windows and doors I want to check. I was hoping to check each one and “push” into a new variable the information as it goes through, so at the end of the check it would have a notification text that contains the list of open windows or doors. If I understand your method, I would have to check every combination of open and closed and format the message accordingly, which with 20 or so inputs would be an extremely long condition
That is if I understand it of course!
Sure, you can ask, I am not an expert but I am glad to help.
In fact it is an if, then else condition.
The underscore previously was used to define that the action would trigger any time the condition became true even if it was true before (eg. (door OR window) when door is true, the condition becomes true, if windows becomes true the condition becomes true again). Now it is not necessary, you can mark the repeat option, but I left the name unchanged, has none effect, sorry for the confussion.
In fact, I have each combination made, because I have only three doors being validated, but in your case maybe you can use OR.
security_status security_activated AND (DOOR1 OR DOOR2 OR .... DOORn) ? "{tone:tts}Alert! At least one door is open!" : security_activated AND (!DOOR1 OR !DOOR2 OR .... !DOORn) ? "{tone:tts}House secured, all doors are closed" : "{tone:tts}Security disabled."
This way you will get different notifications when at least one trigger is triggered and your alarm is on, other notification when your alarm is on but everything is closed and a third notification when there is not alarm activated regarthless of how is the door. Or you think a list of opened doors/windows is needed?
Maybe there is a more intelligent way to do it.
Best Home Automation shopping experience. Shop at Ezlo!