πŸ“Œ This is Part 3 of the series. Part 1: Theory, Part 2: Practice.


πŸ”— What We’re Integrating

ComponentPurposeDifficulty
ONEmesh MQTTBridge between local mesh and global map + Telegram notifications🟒 Low
Home AssistantNode sensors, device_tracker, automations on mesh messages🟑 Medium
NotificationsAlerts for new nodes, lost connection, mentions in chat🟒 Low

πŸ’‘ All examples tested on: HA 2026.4.2 (Docker) + Orange Pi 3B + built-in MQTT broker.


🌐 Step 1: Configure Meshtastic MQTT for ONEmesh

Connection Parameters

ParameterValueNote
MQTT Addressmqtt.onemesh.ruCommunity server
UsernameonemeshDefault
PasswordonecatShared for all
Root topicmsh/RU/XXXXXX = city code (list)
TLS enabledYesTry No if not working
JSON enabledYesRequired for Home Assistant
Uplink / DownlinkYes / NoUplink only is enough for monitoring

⚠️ Important: Firmware 2.5+ supports new encryption key format (PKI). If using encryption - ensure keys are synced across nodes.

How to Verify

  1. Enable JSON enabled in MQTT settings
  2. Connect to broker via mosquitto_sub or MQTT Explorer:
mosquitto_sub -h mqtt.onemesh.ru -u onemesh -P onecat \
  -t 'msh/RU/MOW/json/#' -v
  1. You’ll see messages like:
{
  "id": 452664778,
  "from": 2130636288,
  "payload": {
    "text": "Hello from local mesh!",
    "battery_level": 87,
    "voltage": 4.12
  },
  "type": "text",
  "timestamp": 1714234567
}

πŸ“¬ Step 2: Telegram Notifications via ONEmesh Bot

ONEmesh automatically forwards messages from your city topic to a private chat with the bot.

Notification Examples

[26.04.2026 20:52] ONEmesh Bot: LF | qwrt (https://map.onemesh.ru/?node_id=483535916)  QWRT Pocket
20, standard. but for home node - triad antenna
SNR 4.75  RSSI -92  HopLimit 3
- data from 44b4 (https://map.onemesh.ru/?node_id=49169588)
FieldMeaningWhy it matters
SNRSignal-to-Noise RatioSignal quality: higher = better
RSSIReceived Signal StrengthSignal power: closer to 0 = better
HopLimitRemaining hopsShows how far message traveled

Setup

  1. Find @ONEmeshBot in Telegram
  2. Send /start - bot will show instructions
  3. Ensure your node sends data to MQTT with correct root topic
  4. Done: notifications will arrive automatically

πŸ’‘ Tip: if no notifications - check that OK to MQTT is enabled in channel settings and node has internet.


🏠 Step 3: Home Assistant Integration

Prerequisites

  • Built-in MQTT broker in HA (Settings β†’ Devices & Services β†’ MQTT)
  • Meshtastic node with JSON enabled in MQTT
  • Access to configuration.yaml and ability to create mqtt.yaml

Step 3.1: Connect MQTT in HA

# configuration.yaml
mqtt: !include mqtt.yaml
# mqtt.yaml
broker: core-mosquitto # or your broker address
port: 1883
username: homeassistant
password: !secret mqtt_password
# For external broker (e.g., ONEmesh):
# broker: mqtt.onemesh.ru
# port: 8883
# username: onemesh
# password: onecat
# certificate: /config/certs/ca.crt  # for TLS

Step 3.2: Create Sensors for Node

# mqtt.yaml - continued
sensor:
  # Node battery
  - name: "Meshtastic Node Battery"
    unique_id: "meshtastic_node_battery"
    state_topic: "msh/RU/MOW/json/LongFast/!abcd1234"
    value_template: >-
      {% if value_json.from == 2130636288 and value_json.payload.battery_level is defined %}
        {{ value_json.payload.battery_level | int }}
      {% else %}
        {{ this.state }}
      {% endif %}
    unit_of_measurement: "%"
    device_class: battery

  # Voltage
  - name: "Meshtastic Node Voltage"
    unique_id: "meshtastic_node_voltage"
    state_topic: "msh/RU/MOW/json/LongFast/!abcd1234"
    value_template: >-
      {% if value_json.from == 2130636288 and value_json.payload.voltage is defined %}
        {{ value_json.payload.voltage | float | round(2) }}
      {% else %}
        {{ this.state }}
      {% endif %}
    unit_of_measurement: "V"
    device_class: voltage

  # Channel utilization (airtime load)
  - name: "Meshtastic Channel Utilization"
    unique_id: "meshtastic_chutil"
    state_topic: "msh/RU/MOW/json/LongFast/!abcd1234"
    value_template: >-
      {% if value_json.from == 2130636288 and value_json.payload.channel_utilization is defined %}
        {{ value_json.payload.channel_utilization | float | round(1) }}
      {% else %}
        {{ this.state }}
      {% endif %}
    unit_of_measurement: "%"

πŸ”‘ Important: replace 2130636288 with your node’s decimal from (find via MQTT Explorer or meshtastic --info).

Step 3.3: Location Tracking (device_tracker)

# automations.yaml
- alias: "Meshtastic: Update node location"
  trigger:
    platform: mqtt
    topic: "msh/RU/MOW/json/LongFast/!abcd1234"
    value_template: >-
      {% if value_json.from == 2130636288 and 
            value_json.payload.latitude_i is defined and 
            value_json.payload.longitude_i is defined %}on{% endif %}
  action:
    service: device_tracker.see
    data:
      dev_id: "meshtastic_node_1"
      gps:
        - "{{ (trigger.payload_json.payload.latitude_i | int * 1e-7) }}"
        - "{{ (trigger.payload_json.payload.longitude_i | int * 1e-7) }}"
      battery: "{{ states('sensor.meshtastic_node_battery') | default(0) }}"

πŸ’‘ Meshtastic stores coordinates as integer * 1e7, so multiply by 1e-7 to get real values.

Step 3.4: Notifications on Chat Mentions

# automations.yaml
- alias: "Meshtastic: Notify on mention"
  trigger:
    platform: mqtt
    topic: "msh/RU/MOW/json/LongFast/!abcd1234"
    value_template: >-
      {% if value_json.type == "text" and 
            value_json.payload.text is defined and 
            "ponf" in value_json.payload.text.lower() %}on{% endif %}
  action:
    service: notify.mobile_app_your_phone
    data:
      title: "πŸ“‘ Meshtastic"
      message: "Mention: {{ trigger.payload_json.payload.text }}"
      data:
        priority: high

πŸ” Security: Encryption and Keys

What Changed in Firmware 2.5+

VersionKey TypeNotes
< 2.5Single PSK per channelSimple setup, but vulnerable if compromised
β‰₯ 2.5PKI + shared secretSeparate keys for encryption and authentication

How to Configure Encryption

  1. In Meshtastic app: Channel β†’ Primary β†’ PSK
    • Enable encryption
    • Copy the key (same AQ== for primary channel)
  2. In MQTT settings: Encryption enabled β†’ Yes
  3. Ensure all nodes in mesh use the same key

⚠️ Critical: if keys don’t match - messages arrive but won’t decrypt. Verify via MQTT Explorer.

Where to Store Keys

  • βœ… In secrets.yaml Home Assistant (don’t commit to Git!)
  • βœ… In password manager (Bitwarden, KeePassXC)
  • ❌ Not in public repos, logs, or screenshots

⚠️ Common Issues

SymptomCauseFix
Sensors not updatingWrong from in value_templateFind node’s decimal ID via meshtastic --info
No Telegram messagesWrong root topicCheck city code: msh/RU/MOW, msh/RU/SPB, etc.
Encryption not workingKeys don’t matchCopy PSK exactly, no spaces, to both nodes
device_tracker not movingCoordinates in wrong formatMultiply latitude_i/longitude_i by 1e-7
HA won’t connect to brokerWrong credentialsCheck username/password and port (1883/8883)