Passing a parameter in Node Red to ID the notification recipient

Looking for someone with more experienced advice…

Trying to create an efficient flow that will send a notification to either myself or my wife if we drive away with the garage door still open.

I can of course create separate flows for that, but dislike the inefficiency and future maintenance implications it brings. Really looking to do something like that shown in the 2nd example but need a method to properly ID who the notification should be send to.

A lot of possibilities, here’s one that could work.

[{"id":"ff33d25a.ca336","type":"trigger-state","z":"ffbd7f06.4a014","name":"","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"person.mark, person.melissa","entityidfiltertype":"substring","debugenabled":false,"constraints":[{"id":"oyvs51ape6d","targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"not_home"},{"id":"goofo672gjp","targetType":"this_entity","targetValue":"","propertyType":"previous_state","propertyValue":"old_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"home"},{"id":"6jmcgttgz1","targetType":"entity_id","targetValue":"sensor.garage_door","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"open"}],"constraintsmustmatch":"all","outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","x":224,"y":848,"wires":[["b86ce093.37787"],[]]},{"id":"b86ce093.37787","type":"change","z":"ffbd7f06.4a014","name":"","rules":[{"t":"change","p":"topic","pt":"msg","from":"person.mark","fromt":"str","to":"mobile_app_mark","tot":"str"},{"t":"change","p":"topic","pt":"msg","from":"person.melissa","fromt":"str","to":"mobile_app_melissa","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":496,"y":848,"wires":[["e9795246.bd5e7"]]},{"id":"e9795246.bd5e7","type":"api-call-service","z":"ffbd7f06.4a014","name":"","version":1,"debugenabled":false,"service_domain":"notify","service":"{{topic}}","entityId":"","data":"{\"message\": \"Garage Door is opened.\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":698,"y":848,"wires":[[]]}]
2 Likes

Great, thank you. That looks exactly like what I was looking for. Will try it out.