I’ve been struggling a bit getting the devices showing in the map. I already have the battery metrics coming in, so I know the MQTT path is working fine.
Here are my code blocks if anyone has ideas:
automations.yaml:
- id: location_lcp
alias: "Las Canchas Park"
description: ""
trigger:
- platform: mqtt
topic: msh/2/json/LongFast/!934cf8a8
condition:
- condition: state
entity_id: sensor.lcp_location
attribute: type
state: position
- condition: state
entity_id: sensor.lcp_location
attribute: from
state: 3750913147
action:
- service: device_tracker.see
data_template:
dev_id: mt_lcp
gps: >-
{{
(((state_attr('sensor.lcp_location','payload')['latitude_i'])|float(0))/10000000)
}},{{
(((state_attr('sensor.lcp_location','payload')['longitude_i'])|float(0))/10000000)
}}
enabled: true
mode: single
Confirm the from field value is correct at 3750913147?
You’ve got 2 types of quotes in there - simple and fancy. Like ” versus " and ’ versus ‘. Suggest try changing those to simple unicode chars since it might be causing issues with config parsing.
Your tracker should be called device_tracker.mt_lcp
Open Developer Tools then click States. Start typing in the text box below Entities column label to search. You can also do this by going to Settings → Devices → Entities and filter there too. - ted
Hello, may i ask to make it clear… noob level questiion?
At HA I should add mqtt.mestastic.org server, right and then pick up topic with my node id?
I want to take environment data from BME280 that is cnnected to TTGO board.
code example: msh/2/json/msws20/![here my node id] right?
[msh/2/json/msws20] remains constant or I have to edit/adjust it as well?
My setup is TTGO on premises where I want to see temp/RH data and at home I have T-Boeam as client-router role (connected to wi-fi) TTGO cant be connected to wifi so I think Environemnt data should go thru mesh network and I should pick it up somehow from mqtt.meshtastic.org server, right?
+how to encrypt messgaes, I see something happening on MQTT Explored, but data is " not readable" and on Home assistant I have " unknown values"
yes, pardon, I used mine, but output is some random numbers, seems it is encrypted, but I dont know how todecrypt, see this ost where I shared screens-
but client with no wifi, only BT- iOS app it shows nothing today
but with proxy funcion enablet it posts encrypted info…
I cant replicate anymore that it show just =online.
setup is folowing, see pic →
if I kill iOS app, then no new posts, seems it does not brodcast anything trhu mest, but I tested iOS app without “network” just BT enabled and then i can chat with my other clinet that has wifi… strange
What firmware and hardware is your device? There have been issues with MQTT in recent versions. Try latest BETA firmware if you’re not already using it.
Suggest you create a new thread and post link here; I’ll help you there.- ted
If i understand this, you are filtering on a node with ID 3750913147. What would be the right approach to see all the nodes on the mesh on a map? Should i repeat the automation step to create new entities?
Yeah to see all the other nodes on a HA map, you would have to repeat the automation for each node. That’s a bit painful if there are a lot of nodes in the area.
I use HA just to monitor my placed nodes because they are all solar. I’d recommend just using https://meshmap.net/ if you want to check the other nodes around you that are just on the map.
I had issues implementing this, because the “import” with the MQTT sensor failed many times.
My Sensor us now:
- name: "MeshMQTT Positions"
unique_id: "meshmqtt_positions"
state_topic: "msh/CH/2/json/LongFast/!da112233"
value_template: >-
{% if value_json.type == "position" and
value_json.payload.latitude_i is defined %}
{{ (value_json.timestamp | float) | round(1) }}
{% else %}
{{ states('sensor.meshmqtt_positions') }}
{% endif %}
json_attributes_topic: "msh/CH/2/json/LongFast/!da112233"
You could also filter the address of your device in there. But I want to track more than one device and and so I need only one sensor, but more than one automation. It probably depends how busy your MQTT topic is.
Also I excluded sensor.meshmqtt_positions from the recorder
Going to give this a shot soon…just mapping and perhaps battery. Pardon my ignorance! Do you use the HA Mosquito mqtt broker?
Additionally, are there any other guides for HA integration? I’m just not that technical or code savvy TIA
@LozC Sure you can use the broker offered by HASS. There are tons of guides about this topic depending on your HASS installation method. Suggest a search in the forum or internet for those knowing your specific situation.- ted