### Meshtastic Send Text Action Example Source: https://github.com/meshtastic/home-assistant/blob/main/README.md This YAML configuration shows how to send a text message using the Meshtastic integration. It's designed to echo back an incoming direct message, requiring a delay before execution to ensure the device is idle. Ensure the `to`, `from`, and `text` fields are correctly populated. ```yaml action: meshtastic.send_text metadata: {} data: ack: false from: "{{ trigger.event.data.data.gateway }}" to: "{{ trigger.event.data.data.from }}" text: "ECHO: {{ trigger.event.data.data.message }}" ``` -------------------------------- ### Meshtastic API Text Message Event Data Structure Source: https://github.com/meshtastic/home-assistant/blob/main/README.md This example shows the structure of the event data received when the `meshtastic_api_text_message` event type is triggered. It includes sender, recipient, gateway, and message details. ```yaml trigger: event: event_type: meshtastic_api_text_message event_data: data: from: 1127918844 to: node: null channel: 0 gateway: 862525748 message: Sample Message ``` -------------------------------- ### Handle Incoming Text Messages (Channel) Source: https://github.com/meshtastic/home-assistant/blob/main/README.md This automation handles incoming channel text messages from a specific gateway node (ID 3771721320) on channel 0. It echoes the message back after a 5-second delay using the `send_text` action. ```yaml - id: '1735852176270' alias: Echo on Channel Message (without Notify Platform) description: 'Only from gateway with node id 3771721320 and channel 0' triggers: - trigger: event event_type: meshtastic_api_text_message event_data: data: to: node: channel: 0 gateway: 3771721320 conditions: [] actions: - delay: seconds: 5 - action: meshtastic.send_text data: ack: true text: 'ECHO: {{ trigger.event.data.data.message }}' from: '{{ trigger.event.data.data.gateway }}' channel: '{{ trigger.event.data.data.to.channel }}' mode: single ``` -------------------------------- ### Handle Incoming Text Messages (Direct) Source: https://github.com/meshtastic/home-assistant/blob/main/README.md This automation handles incoming direct text messages to a specific gateway node (ID 3771721320). It echoes the message back after a 5-second delay using the `send_text` action. ```yaml - id: '1735852176271' alias: Echo on Direct Message (without Notify Platform) description: 'Only from gateway with node id 3771721320' triggers: - trigger: event event_type: meshtastic_api_text_message event_data: data: to: node: 3771721320 channel: gateway: 3771721320 conditions: [] actions: - delay: seconds: 5 - action: meshtastic.send_text data: ack: true text: 'ECHO: {{ trigger.event.data.data.message }}' from: '{{ trigger.event.data.data.gateway }}' to: '{{ trigger.event.data.data.from }}' mode: single ``` -------------------------------- ### Reply to Meshtastic Message Source: https://github.com/meshtastic/home-assistant/blob/main/README.md This automation triggers when a message is received from a specific device and replies with 'PONG' followed by the original message after a 10-second delay. ```yaml - id: '1800000042000' alias: Ping Sample description: 'Reply back after message from device' triggers: - device_id: e3376b45b4912c27cffb46c58e4998e4 domain: meshtastic type: message.sent trigger: device actions: - delay: seconds: 10 - device_id: e3376b45b4912c27cffb46c58e4998e4 domain: meshtastic type: send_message message: PONG {{ trigger.event.data.message }} ``` -------------------------------- ### Echo Incoming Channel Text Messages Source: https://github.com/meshtastic/home-assistant/blob/main/README.md This automation echoes incoming channel text messages from any node with a gateway device trigger after a 5-second delay. It uses the `broadcast_channel_message` action to send the echoed message. ```yaml - id: '1735857524502' alias: Echo Channel Message description: '' triggers: - domain: meshtastic device_id: 16efde6990a6a09903153abb8624fe38 type: channel_message.received entity_id: meshtastic.gateway_brig_channel_primary trigger: device conditions: [] actions: - delay: seconds: 5 - action: meshtastic.broadcast_channel_message metadata: {} data: ack: true channel: meshtastic.gateway_brig_channel_primary message: 'ECHO: {{ trigger.event.data.message }}' mode: single ``` -------------------------------- ### Filter Meshtastic Event by Channel Source: https://github.com/meshtastic/home-assistant/blob/main/README.md This Jinja2 template condition filters Meshtastic events to only include those addressed to a specific channel (e.g., channel 0, typically LONGFAST). ```jinja {{ trigger.event.data.data.to.channel == 0 }} ``` -------------------------------- ### Filter Meshtastic Event by Recipient Node ID Source: https://github.com/meshtastic/home-assistant/blob/main/README.md This Jinja2 template condition filters Meshtastic events to only include those addressed to a specific gateway node ID (e.g., 862525748). ```jinja {{ trigger.event.data.data.to.node == 862525748 }} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.