My mapping of the MQTT payload to the SEP
Hi all,
In writing the plugin I needed to decode the relevant sections of the specification document to the payload itself. No warranties but this may be useful (I know the formatting of the JSON could be clearer) but this did the job foe me
Comments
Very useful - thanks!
For information to convert the RSSI to dBm it's {RSSI(16) - 256} = dBm value.
configuration.yaml in Home assistant. I use NODE RED to connect to the source and subscribe all topics in the HA MQTT broker and filter on configuration.yaml
' - platform: mqtt
name: "RSSI" # PAN Received Signal Strength
state_topic: "#"
unit_of_measurement: 'dBm'
value_template: "{{ value_json['pan']['rssi']|int(base=16)-256 }}"
icon: 'mdi:antenna'
- platform: mqtt
name: "LQI" #PAN link quality
state_topic: "#"
unit_of_measurement: ''
value_template: "{{ value_json['pan']['lqi']|int(base=16) }}"
icon: 'mdi:antenna'
Here are my notes on my Home Assistant configuration, just use the HA MQTT Integration and configure to your external broker (I just use the NODE RED add-on for this, but a PI or a NAS drive running Mosquito could be used. I don't filter the MQTT messages until Home Assistant, but I don't have much traffic from MQTT in my implementation. Thanks to others on here for some of the code, I just modified it a bit for a few more indications and sensors. Anyone know where in the MQTT I can find the tariff information?
ui-lovelace.yaml
automation.yaml