Can some people please take a look at this current code (I might modify it some more, but it has generally worked ok, but I am getting additional notifications even after not all the conditions are met.)
Here’s what I am trying to do and would like to know, please, how closely this flow matches this. If everyone is away from the house and the security is not armed, send email notification. If one person is away and one is not and the alarm is not armed, don’t make a notification (only if both are.) If both are away and the alarm is armed, don’t make a notification. I was testing it out, both being away, have the notification go off, returned to “home” and I got one residual email after that. I would like the flow to catch this and not send another email.
[{"id":"7194ba2f074feee3","type":"api-current-state","z":"e3aaa0d4de20b317","name":"Presence - 2","server":"78fd209d.3e277","version":2,"outputs":2,"halt_if":"home","halt_if_type":"str","halt_if_compare":"is","entity_id":"device_tracker.hostname2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":290,"y":580,"wires":[[],["ec8a7a143b9ddabe"]]},{"id":"99a3602cb8ae0713","type":"api-current-state","z":"e3aaa0d4de20b317","name":"Presence - 1","server":"78fd209d.3e277","version":2,"outputs":2,"halt_if":"home","halt_if_type":"str","halt_if_compare":"is","entity_id":"device_tracker.hostname1","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":110,"y":580,"wires":[[],["7194ba2f074feee3"]]},{"id":"ec8a7a143b9ddabe","type":"api-current-state","z":"e3aaa0d4de20b317","name":"Disarmed?","server":"78fd209d.3e277","version":2,"outputs":2,"halt_if":"disarmed","halt_if_type":"str","halt_if_compare":"is","entity_id":"alarm_control_panel.home_alarm","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"str"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":510,"y":580,"wires":[["76e5f6279ba5ee52"],[]]},{"id":"3fee99be167ac5bd","type":"api-current-state","z":"e3aaa0d4de20b317","name":"Disarmed?","server":"78fd209d.3e277","version":2,"outputs":2,"halt_if":"disarmed","halt_if_type":"str","halt_if_compare":"is","entity_id":"alarm_control_panel.home_alarm","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"Alarm is off, please turn on.","valueType":"str"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":130,"y":680,"wires":[["78c2b15031ab0f6a"],[]]},{"id":"78c2b15031ab0f6a","type":"e-mail","z":"e3aaa0d4de20b317","server":"smtp.gmail.com","port":"465","secure":true,"tls":true,"name":"1","dname":"","credentials":{"password":"g"},"x":330,"y":680,"wires":[]},{"id":"2a232d3940414051","type":"inject","z":"e3aaa0d4de20b317","name":"Alarm not armed","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"240","crontab":"","once":true,"onceDelay":"1","topic":"","payloadType":"date","x":150,"y":500,"wires":[["99a3602cb8ae0713"]]},{"id":"76e5f6279ba5ee52","type":"delay","z":"e3aaa0d4de20b317","name":"","pauseType":"delay","timeout":"4","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":680,"y":580,"wires":[["3fee99be167ac5bd"]]},{"id":"78fd209d.3e277","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]
Thank you