Telemetry Sensors - awolden/meshcore-ha GitHub Wiki
This guide explains how to retrieve telemetry data from remote repeater nodes in the Meshcore Home Assistant integration. Telemetry is data that remote nodes provide about their status and environment.
To get telemetry from a repeater node:
send_telemetry_req YOUR_PUBKEY_PREFIX
Replace YOUR_PUBKEY_PREFIX
with your node's public key prefix.
Create an automation to collect telemetry regularly:
alias: "Telemetry Request - YOUR_NODE_NAME"
description: "Send telemetry request to YOUR_NODE_NAME every 15 minutes"
trigger:
- platform: time_pattern
minutes: "/15" # Adjust frequency as needed (5, 10, 15, 30, etc.)
action:
- service: meshcore.execute_command
data:
command: "send_telemetry_req YOUR_PUBKEY_PREFIX"
mode: single
Create template sensors to capture the telemetry response events:
template:
- trigger:
- trigger: event
event_type: meshcore_raw_event
event_data:
event_type: EventType.TELEMETRY_RESPONSE
conditions:
- condition: template
value_template: "{{ trigger.event.data.payload.pubkey_pre == '<REPEATER_PUB_KEY>' }}"
sensor:
- name: "<NAME> repeater Vbatt"
unique_id: <name>_repeater_vbatt
state: >
{% set data = trigger.event.data.payload %}
{% if data and data != 'unknown' and data != '' %}
{{ data.lpp[8].value | default(None) }}
{% endif %}
unit_of_measurement: "V"
device_class: voltage
type: entities
title: Repeater Node Status
entities:
- entity: sensor.n_repeater_vbatt
name: Battery Voltage
To collect from multiple repeater nodes:
script:
collect_all_telemetry:
sequence:
- repeat:
for_each:
- "PUBKEY_PREFIX_1"
- "PUBKEY_PREFIX_2"
- "PUBKEY_PREFIX_3"
sequence:
- service: meshcore.execute_command
data:
command: "send_telemetry_req {{ repeat.item }}"
- delay: "00:00:02"
No response from node:
- Check node ID is correct
- Verify node is powered and in range
Sensor not updating:
- Check automation is running
- Verify sensor entity names match your actual entities
- Poll every 15-30 minutes to preserve battery
- Set up alerts for low battery levels
- Use Home Assistant's recorder for historical data