You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All nodes from the gateway's node database are available as notification targets.
63
-
Channels are available as targets as well.
64
-
65
-
Use this method as preferred way to send messages when you don't need control over the details
62
+
Using notification platform and the generated `notify.mesh_*` entities is the recommended way to send messages to the mesh when you don't need control over all the details
66
63
(which gateway to use, acknowledgements, etc.)
67
64
65
+
Depending on your needs, all nodes from the gateway's node database as well as the channels can be made available as notification targets.
66
+
67
+
68
68
Note: Support is based on new [entity notification platform](https://developers.home-assistant.io/blog/2024/04/10/new-notify-entity-platform/),
69
69
for an example on how to use it, see [official documentation](https://www.home-assistant.io/integrations/notify/#example-with-the-entity-platform-notify-action).
70
70
@@ -90,9 +90,9 @@ it is still busy with receiving / sending other mesh messages.
90
90
91
91
#### Examples
92
92
<details>
93
-
<summary>Reply back after message received from device on arbitrary channel (including direct message) </summary>
93
+
<summary>Reply back after message received from predefined device on arbitrary channel (including direct message) </summary>
94
94
95
-
```
95
+
```yaml
96
96
- id: '1800000042000'
97
97
alias: Ping Sample
98
98
description: 'Reply back after message from device'
@@ -111,10 +111,89 @@ it is still busy with receiving / sending other mesh messages.
111
111
```
112
112
113
113
</details>
114
+
114
115
<details>
115
-
<summary>Handling incoming text messages from any node</summary>
116
+
<summary>Echo incoming channel text messages from any node with gateway device trigger</summary>
This integration supports the creation of Home Assistant automations that can handle incoming text messages from any public node and replay to these messages. This is useful if to want to reply to incoming direct messages with a standard message, use a LLM or handle various commands with automations.
194
+
If you don't want to use the recommend notification platform for sending messages (e.g. if you don't want to clutter your Home Assistant instance with potentially hundreds of notify mesh entities),
195
+
you can still handle incoming text messages from any public node and reply to these messages.
196
+
This is useful if to want to reply to incoming direct messages with a standard message, use a LLM or handle various commands with automations.
118
197
119
198
To do this, create a new Home Assistant automation that triggers on "Manual Events" and put `meshtastic_api_text_message` as the "Event Type". This will cause this automation to get triggerred on all incoming channel and direct messages. You will get events that include this information:
120
199
@@ -128,10 +207,15 @@ trigger:
128
207
to:
129
208
node: null
130
209
channel: 0
210
+
gateway: 862525748
131
211
message: Sample Message
132
212
```
133
213
134
-
From is the NodeID of the sender of the message, to will have a node value if direct, or a channel number if the message is directed at the channel. You can create conditions in the automation to filter out the incoming messages you want, for example to filter out messages addressed to your node, use this condition with your nodeid.
214
+
From contains the node id of the sender of the message, to will have the node id of the gateway for direct messages, or a gateway channel id if the message is directed at the channel.
215
+
Note that the channel id is dependent on the gateway node, so make sure you are using the proper gateway node when replying using that channel id.
216
+
217
+
You can create conditions in the automation to filter out the incoming messages you want or you can directly filter in the trigger.
218
+
For example to filter out messages addressed to your gateway node, use this condition with your node id.
@@ -149,15 +233,15 @@ You can also forward these messages as notifications to your phone, etc. For exa
149
233
Meshtastic message from ({{ trigger.event.data.data.from }}): {{ trigger.event.data.data.message }}
150
234
```
151
235
152
-
To reply to a text message in this situation, add a 2 second or more delay action and then an action called `Meshtastic 'Send Text'` to your automation. You need to add a short delay to make sure your Meshtastic device is idle before replying. Change the `Meshtastic 'Send Text'` action to edit in yaml and change the `to`, `from` and `text` values to somethign like his:
236
+
To reply to a text message in this situation, add a 2 second or more delay action and then an action called `Meshtastic 'Send Text'` to your automation. You need to add a short delay to make sure your Meshtastic device is idle before replying. Change the `Meshtastic 'Send Text'` action to edit in yaml and change the `to`, `from` and `text` values to something like his:
0 commit comments