Skip to main content

A Python client that connects Meshtastic radios via MQTT to Home Assistant (Hass).

Project description

Meshtastic to Home Assistant (Hass)

A Python client for use with Meshtastic devices. The client connects to a mesh radio via USB serial port. Telemetry and position messages from the mesh are published to an MQTT broker and further into Home Assistant. All MQTT entities will by auto discovered in Home Assistant.

Usage

usage: meshtastic2hass [-h] [--config CONFIG] [--dev DEV] [--mqtt-host MQTT_HOST] [--mqtt-port MQTT_PORT] [--mqtt-user MQTT_USER]
                       [--mqtt-password MQTT_PASSWORD] [--mqtt-topic-prefix MQTT_TOPIC_PREFIX] [--use-network USE_NETWORK]
                       [--hostname HOSTNAME] [--version]

Connects Meshtastic radios via MQTT to Home Assistant (Hass).

options:
  -h, --help            show this help message and exit
  --config CONFIG       Path to configuration file in TOML format.
  --dev DEV             The device the Meshtastic device is connected to, i.e. /dev/ttyUSB0
  --mqtt-host MQTT_HOST
                        The MQTT broker host name or IP.
  --mqtt-port MQTT_PORT
                        The MQTT broker port.
  --mqtt-user MQTT_USER
                        The MQTT broker user name.
  --mqtt-password MQTT_PASSWORD
                        The MQTT broker password.
  --mqtt-topic-prefix MQTT_TOPIC_PREFIX
                        The MQTT topic prefix
  --use-network USE_NETWORK
                        Use network connection to Meshtastic interface instead of serial
  --hostname HOSTNAME   Meshtastic interface network hostname or IP
  --version             show programs version number and exit

Node Filter

By default all received Meshtastic nodes will create entities in Home Assistant.

This might be an undesired behavior when only some nodes are of interest. A node filter can be defined in config.toml.

filter_nodes = [] takes a set of Meshtastic nodes short names to be includes in filter. Only these nodes will be forwarded to home assistant via MQTT topic, hence creating entities. Keep empty to forward all nodes.

Receiving channels text from nodes is not filtered at all.

Install packages with pip and requirements.txt

The following command installs packages in bulk according to the configuration file, requirements.txt. In some environments, use pip3 instead of pip.

pip install -r requirements.txt

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

meshtastic2hass-1.0.20.tar.gz (25.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

meshtastic2hass-1.0.20-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

Details for the file meshtastic2hass-1.0.20.tar.gz.

File metadata

  • Download URL: meshtastic2hass-1.0.20.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for meshtastic2hass-1.0.20.tar.gz
Algorithm Hash digest
SHA256 7a2c3755ac655aa7b8a69ae89d83c9b99f426e1db545901827a321fc212601b0
MD5 8e34f187f6ee0698e116cec42ff7ca69
BLAKE2b-256 829cdd8a2844968cfaf01683e53c14f07458c12284ab0d6143ec39283a77962c

See more details on using hashes here.

File details

Details for the file meshtastic2hass-1.0.20-py3-none-any.whl.

File metadata

File hashes

Hashes for meshtastic2hass-1.0.20-py3-none-any.whl
Algorithm Hash digest
SHA256 16a21616aaabe4b4ce9a1447775b98054843d96b6f335d0e95d67a4c1cf2185f
MD5 51c43120a2b90c896254435c2f343fcd
BLAKE2b-256 c1ad7e8972a5fb34ea362635ba56173b9c3d76110623cfb48fae8809c6d61a58

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page