Welcome home announcement

Hello guys,
Im trying to do something.
i want to create a flow that allow announce every one when they arrive home
But my big problem is how to sent the name of the person to the template, let me know the easy way :stuck_out_tongue:
THANKS :slight_smile:

[
    {
        "id": "317411fdb938da11",
        "type": "trigger-state",
        "z": "cb3f5bcb753f3678",
        "name": "rosa_casa",
        "server": "5989b2abe6832582",
        "version": 2,
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "entityid": "device_tracker.rosa_maria",
        "entityidfiltertype": "exact",
        "debugenabled": false,
        "constraints": [
            {
                "targetType": "this_entity",
                "targetValue": "",
                "propertyType": "previous_state",
                "propertyValue": "old_state.state",
                "comparatorType": "is",
                "comparatorValueDatatype": "str",
                "comparatorValue": "not_home"
            },
            {
                "targetType": "this_entity",
                "targetValue": "",
                "propertyType": "current_state",
                "propertyValue": "new_state.state",
                "comparatorType": "is",
                "comparatorValueDatatype": "str",
                "comparatorValue": "home"
            }
        ],
        "inputs": 0,
        "outputs": 2,
        "customoutputs": [],
        "outputinitially": false,
        "state_type": "str",
        "enableInput": false,
        "x": 140,
        "y": 440,
        "wires": [
            [
                "47e6543d81736abc"
            ],
            []
        ]
    },
    {
        "id": "6a8cab8849455816",
        "type": "trigger-state",
        "z": "cb3f5bcb753f3678",
        "name": "nony_casa",
        "server": "5989b2abe6832582",
        "version": 2,
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "entityid": "device_tracker.nony",
        "entityidfiltertype": "exact",
        "debugenabled": false,
        "constraints": [
            {
                "targetType": "this_entity",
                "targetValue": "",
                "propertyType": "previous_state",
                "propertyValue": "old_state.state",
                "comparatorType": "is",
                "comparatorValueDatatype": "str",
                "comparatorValue": "not_home"
            },
            {
                "targetType": "this_entity",
                "targetValue": "",
                "propertyType": "current_state",
                "propertyValue": "new_state.state",
                "comparatorType": "is",
                "comparatorValueDatatype": "str",
                "comparatorValue": "home"
            }
        ],
        "inputs": 0,
        "outputs": 2,
        "customoutputs": [],
        "outputinitially": false,
        "state_type": "str",
        "enableInput": false,
        "x": 140,
        "y": 500,
        "wires": [
            [
                "47e6543d81736abc"
            ],
            []
        ]
    },
    {
        "id": "a1cbe6dd6558ada6",
        "type": "trigger-state",
        "z": "cb3f5bcb753f3678",
        "name": "tato_casa",
        "server": "5989b2abe6832582",
        "version": 2,
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "entityid": "device_tracker.tato",
        "entityidfiltertype": "exact",
        "debugenabled": false,
        "constraints": [
            {
                "targetType": "this_entity",
                "targetValue": "",
                "propertyType": "previous_state",
                "propertyValue": "old_state.state",
                "comparatorType": "is",
                "comparatorValueDatatype": "str",
                "comparatorValue": "not_home"
            },
            {
                "targetType": "this_entity",
                "targetValue": "",
                "propertyType": "current_state",
                "propertyValue": "new_state.state",
                "comparatorType": "is",
                "comparatorValueDatatype": "str",
                "comparatorValue": "home"
            }
        ],
        "inputs": 0,
        "outputs": 2,
        "customoutputs": [],
        "outputinitially": false,
        "state_type": "str",
        "enableInput": false,
        "x": 140,
        "y": 560,
        "wires": [
            [
                "47e6543d81736abc"
            ],
            []
        ]
    },
    {
        "id": "47e6543d81736abc",
        "type": "time-range-switch",
        "z": "cb3f5bcb753f3678",
        "name": "time_9_21",
        "lat": "",
        "lon": "",
        "startTime": "09:00",
        "endTime": "21:00",
        "startOffset": 0,
        "endOffset": 0,
        "x": 350,
        "y": 500,
        "wires": [
            [
                "b36b26bfc9911d1f"
            ],
            []
        ]
    },
    {
        "id": "b36b26bfc9911d1f",
        "type": "api-render-template",
        "z": "cb3f5bcb753f3678",
        "name": "multiples options for tts",
        "server": "5989b2abe6832582",
        "version": 0,
        "template": "{{ [\n\"Disculpen la molestia, pero\" ~ person + \"se esta acercando a la casa.\",\n\"Siento molestar, pero al parecer\" ~ person + \"ha entrado en el rango de la casa.\",\n\"PerdĂłn, les pido un minuto para anunciarles que\" ~ person + \"se encuentra cerca.\",\n\"DiscĂșlpenme, pero, les molesto solo para informarles que\" ~ person + \"ya se encuentra cerca a casa.\",\n\"No deseo interrumpir, pero, les comento que segun los sensores,\" ~ person + \"se encuentra cerca a la casa.\",\n\"Solo un aviso rĂĄpido, mi sentido arĂĄcnido siente la presencia de\" ~ person + \"cerca a la casa.\",\n\"Molesto solo para informarles que mi sexto sentido detecta a\" ~ person + \"cerca a casa.\",\n\"Siento interrumpir pero\" ~ person + \"ha entrado al rango de los sensores de la casa.\"\n ] | random }}",
        "resultsLocation": "payload",
        "resultsLocationType": "msg",
        "templateLocation": "template",
        "templateLocationType": "msg",
        "x": 590,
        "y": 500,
        "wires": [
            [
                "f77ae485251d6642"
            ]
        ]
    },
    {
        "id": "f77ae485251d6642",
        "type": "api-call-service",
        "z": "cb3f5bcb753f3678",
        "name": "anuncio",
        "server": "5989b2abe6832582",
        "version": 5,
        "debugenabled": false,
        "domain": "tts",
        "service": "google_translate_say",
        "areaId": [],
        "deviceId": [],
        "entityId": [
            "media_player.cuarto"
        ],
        "data": "{\"message\":\"{{payload}}\",\"language\":\"es\"}",
        "dataType": "json",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "x": 820,
        "y": 500,
        "wires": [
            []
        ]
    },
    {
        "id": "5989b2abe6832582",
        "type": "server",
        "name": "Home Assistant",
        "version": 5,
        "addon": false,
        "rejectUnauthorizedCerts": true,
        "ha_boolean": "y|yes|true|on|home|open",
        "connectionDelay": true,
        "cacheJson": true,
        "heartbeat": false,
        "heartbeatInterval": "30",
        "areaSelector": "friendlyName",
        "deviceSelector": "friendlyName",
        "entitySelector": "friendlyName",
        "statusSeparator": "at: ",
        "statusYear": "hidden",
        "statusMonth": "short",
        "statusDay": "numeric",
        "statusHourCycle": "h23",
        "statusTimeFormat": "h:m",
        "enableGlobalContextStore": true
    }
]

To create a flow that announces when someone arrives home, you can use a combination of input and output nodes in Node-RED.

For example, you could use an MQTT input node to listen for messages on a specific topic that are sent when someone arrives home, and then use a template node to generate the announcement message with the person’s name.

To set this up in Node-RED, you can follow these steps:

  1. Add an MQTT input node to your flow and configure it to listen for messages on the topic that will be used to announce when someone arrives home. For example, you could use the topic home/arrival.

  2. Add a template node to your flow and configure it to generate the announcement message. In the template, you can use the {{payload}} placeholder to insert the name of the person who has arrived home. For example, the template could be something like this: {{payload}} has arrived home.

  3. Connect the MQTT input node to the template node, so that the template node receives the name of the person who has arrived home as the input payload.

  4. Add an output node to your flow and configure it to send the announcement message to the appropriate destination. For example, you could use a Twitter output node to tweet the announcement, or an HTTP output node to send the announcement to a chat service like Slack or Microsoft Teams.

  5. Connect the template node to the output node, so that the generated announcement message is sent to the output destination.

Once you have set up this flow, you can test it by publishing a message to the home/arrival topic with the name of the person who has arrived home as the payload.

This should trigger the flow and send the announcement message to the configured output destination.

thanks, yes for example in the flow i put:
i use life360 detection:

[{"id":"317411fdb938da11","type":"trigger-state","z":"cb3f5bcb753f3678","name":"rosa_casa","server":"5989b2abe6832582","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"device_tracker.rosa_maria","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"previous_state","propertyValue":"old_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"not_home"},{"targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"home"}],"inputs":0,"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","enableInput":false,"x":140,"y":440,"wires":[["f54c9a81e0d4e420"],[]]},{"id":"6a8cab8849455816","type":"trigger-state","z":"cb3f5bcb753f3678","name":"nony_casa","server":"5989b2abe6832582","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"device_tracker.nony","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"previous_state","propertyValue":"old_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"not_home"},{"targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"home"}],"inputs":0,"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","enableInput":false,"x":140,"y":500,"wires":[["b36b26bfc9911d1f"],[]]},{"id":"a1cbe6dd6558ada6","type":"trigger-state","z":"cb3f5bcb753f3678","name":"tato_casa","server":"5989b2abe6832582","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"device_tracker.tato","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"previous_state","propertyValue":"old_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"not_home"},{"targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"home"}],"inputs":0,"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","enableInput":false,"x":140,"y":560,"wires":[["1969d4617f73f0c3"],[]]},{"id":"47e6543d81736abc","type":"time-range-switch","z":"cb3f5bcb753f3678","name":"time_9_21","lat":"","lon":"","startTime":"09:00","endTime":"21:00","startOffset":0,"endOffset":0,"x":610,"y":540,"wires":[["f77ae485251d6642","6f05756aaa6c30dd"],[]]},{"id":"b36b26bfc9911d1f","type":"api-render-template","z":"cb3f5bcb753f3678","name":"multiples options for tts","server":"5989b2abe6832582","version":0,"template":"{{ [\n\"Disculpen la molestia, pero Nony se esta acercando a la casa.\",\n\"Siento molestar, pero al parecer Nony ha entrado en el rango de la casa.\",\n\"PerdĂłn, les pido un minuto para anunciarles que Nony se encuentra cerca.\",\n\"DiscĂșlpenme, pero, les molesto solo para informarles que Nony ya se encuentra cerca a casa.\",\n\"No deseo interrumpir, pero, les comento que segun los sensores, Nony se encuentra cerca a la casa.\",\n\"Solo un aviso rĂĄpido, mi sentido arĂĄcnido siente la presencia de Nony cerca a la casa.\",\n\"Molesto solo para informarles que mi sexto sentido detecta a Nony cerca a casa.\",\n\"Siento interrumpir pero Nony ha entrado al rango de los sensores de la casa.\"\n ] | random }}","resultsLocation":"payload","resultsLocationType":"msg","templateLocation":"template","templateLocationType":"msg","x":340,"y":500,"wires":[["47e6543d81736abc"]]},{"id":"f77ae485251d6642","type":"api-call-service","z":"cb3f5bcb753f3678","name":"anuncio google","server":"5989b2abe6832582","version":5,"debugenabled":false,"domain":"tts","service":"google_translate_say","areaId":[],"deviceId":[],"entityId":["media_player.cuarto","media_player.mimi"],"data":"{\"message\":\"{{payload}}\",\"language\":\"es\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":840,"y":500,"wires":[[]]},{"id":"1969d4617f73f0c3","type":"api-render-template","z":"cb3f5bcb753f3678","name":"multiples options for tts","server":"5989b2abe6832582","version":0,"template":"{{ [\n\"Disculpen la molestia, pero Tato se esta acercando a la casa.\",\n\"Siento molestar, pero al parecer Tato ha entrado en el rango de la casa.\",\n\"PerdĂłn, les pido un minuto para anunciarles que Tato se encuentra cerca.\",\n\"DiscĂșlpenme, pero, les molesto solo para informarles que Tato ya se encuentra cerca a casa.\",\n\"No deseo interrumpir, pero, les comento que segun los sensores, Tato se encuentra cerca a la casa.\",\n\"Solo un aviso rĂĄpido, mi sentido arĂĄcnido siente la presencia de Tato cerca a la casa.\",\n\"Molesto solo para informarles que mi sexto sentido detecta a Tato cerca a casa.\",\n\"Siento interrumpir pero Tato ha entrado al rango de los sensores de la casa.\"\n ] | random }}","resultsLocation":"payload","resultsLocationType":"msg","templateLocation":"template","templateLocationType":"msg","x":350,"y":560,"wires":[["47e6543d81736abc"]]},{"id":"f54c9a81e0d4e420","type":"api-render-template","z":"cb3f5bcb753f3678","name":"multiples options for tts","server":"5989b2abe6832582","version":0,"template":"{{ [\n\"Disculpen la molestia, pero Rosa se esta acercando a la casa.\",\n\"Siento molestar, pero al parecer Rosa ha entrado en el rango de la casa.\",\n\"PerdĂłn, les pido un minuto para anunciarles que Rosa se encuentra cerca.\",\n\"DiscĂșlpenme, pero, les molesto solo para informarles que Rosa ya se encuentra cerca a casa.\",\n\"No deseo interrumpir, pero, les comento que segun los sensores, Rosa se encuentra cerca a la casa.\",\n\"Solo un aviso rĂĄpido, mi sentido arĂĄcnido siente la presencia de Rosa cerca a la casa.\",\n\"Molesto solo para informarles que mi sexto sentido detecta a Rosa cerca a casa.\",\n\"Siento interrumpir pero Rosa ha entrado al rango de los sensores de la casa.\"\n ] | random }}","resultsLocation":"payload","resultsLocationType":"msg","templateLocation":"template","templateLocationType":"msg","x":350,"y":440,"wires":[["47e6543d81736abc"]]},{"id":"60ba8c4316a9a138","type":"trigger-state","z":"cb3f5bcb753f3678","name":"nano_casa","server":"5989b2abe6832582","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"device_tracker.fernando_benavides","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"previous_state","propertyValue":"old_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"not_home"},{"targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"home"}],"inputs":0,"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","enableInput":false,"x":140,"y":620,"wires":[["baab58ae8457effe"],[]]},{"id":"baab58ae8457effe","type":"api-render-template","z":"cb3f5bcb753f3678","name":"multiples options for tts","server":"5989b2abe6832582","version":0,"template":"{{ [\n\"Disculpen la molestia, pero Nano se esta acercando a la casa.\",\n\"Siento molestar, pero al parecer Nano ha entrado en el rango de la casa.\",\n\"PerdĂłn, les pido un minuto para anunciarles que Nano se encuentra cerca.\",\n\"DiscĂșlpenme, pero, les molesto solo para informarles que Nano ya se encuentra cerca a casa.\",\n\"No deseo interrumpir, pero, les comento que segun los sensores, Nano se encuentra cerca a la casa.\",\n\"Solo un aviso rĂĄpido, sentido aracnido siente la presencia de Nano cerca a la casa.\",\n\"Molesto solo para informarles que mi sexto sentido detecta a Nano cerca a casa.\",\n\"Siento interrumpir pero Nano ha entrado al rango de los sensores de la casa.\"\n ] | random }}","resultsLocation":"payload","resultsLocationType":"msg","templateLocation":"template","templateLocationType":"msg","x":350,"y":620,"wires":[["47e6543d81736abc"]]},{"id":"6f05756aaa6c30dd","type":"api-call-service","z":"cb3f5bcb753f3678","name":"anuncio alexa","server":"5989b2abe6832582","version":5,"debugenabled":false,"domain":"notify","service":"alexa_media_eco","areaId":[],"deviceId":[],"entityId":[],"data":"{\"message\":\"{{payload}}\",\"data\":{\"type\":\"announce\",\"method\":\"all\"}}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":840,"y":580,"wires":[[]]},{"id":"5989b2abe6832582","type":"server","name":"Home Assistant","version":5,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]

BUT my question is can i make it shorter and use just one “multiple option for tts” that would pick the name of the person from the “state node”?