Home Assistant Integration for Meshtastic.
Supported Features:
- Add meshtastic devices as gateways to interact with the mesh
- Supports TCP, Serial & Bluetooth connection (also works with Bluetooth Proxy)
- Home Assistant Zeroconf, Bluetooth & USB-Serial Auto-Discovery
- Select which meshtastic nodes should be imported to home assistant
- Meshtastic node metrics
- Record received messages
- Send messages (as direct message or on broadcast channel)
- Record node position (as device tracker)
- Device triggers & actions for automations
- Various other service actions (e.g. request metrics, trace route)
For more details, see check the documentation.
Recommended: HACS
- Add this repository as a custom repository to HACS:
- Use HACS to install the integration.
- Restart Home Assistant.
- Set up the integration using the UI:
Alternatives
- Using the tool of choice open the directory (folder) for your HA configuration (where you find
configuration.yaml
). - If you do not have a
custom_components
directory (folder) there, you need to create it. - In the
custom_components
directory (folder) create a new folder calledhomeassistant-meshtastic
. - Download all the files from the
custom_components/meshtastic/
directory (folder) in this repository. - Place the files you downloaded in the new directory (folder) you created.
- Restart Home Assistant
- In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Meshtastic"
For nodes selected as part of the configuration, metrics are exposed as corresponding sensors.
Even though integration is classified as local_polling
it predominantly operates as local_push
and home assistant is notified
as soon as new state is available. Polling is only used as fallback should the push mechanism stop working.
All nodes from the gateway's node database are available as notification targets. Channels are available as targets as well.
Use this method as preferred way to send messages when you don't need control over the details (which gateway to use, acknowledgements, etc.)
Note: Support is based on new entity notification platform, for an example on how to use it, see official documentation.
For nodes selected as part of the configuration, device triggers and device actions are available. Prefer using device actions and triggers in your automation over using (service) actions.
There are triggers when messages have been sent or have been received. Gateway nodes offer more triggers than other nodes. You can further refine the triggers to only fire when a message was sent/received on a particular channel or as direct message.
- Send Direct Message
- Request Telemetry
- Request Position
Note: Ensure you have a delay before the action if your automations are triggered by meshtastic device trigger, otherwise you risk that your action triggered message is being dropped by meshtastic firmware because it is still busy with receiving / sending other mesh messages.
Reply back after message received from device on arbitrary channel (including direct message)
- 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 }}
Direct messages or channel messages are recorded in the log book. Each gateway has an entity for direct messages and its channels, you can navigate to the device and select the entitiy to see an extract of the logbook, or you can navigate to the logbook and filter for the desired entities there.
Note: When logbook is not enabled, messages are not recorded.
For nodes selected as part of the configuration, their position is exposed as a device tracker. You can see the nodes on home assistant map accordingly and home assistant will report if node is at home or away.
Services / Actions
Use the available actions if you need more control compared to other methods to interact with meshtastic devices. Certain actions need you to understand meshtastic details and are not recommended for the average user.
If you want to contribute to this please read the Contribution guidelines