The issue is - HA sees the sensor data as a message - and is not parsing out the relevant values. In TTN, im using the device specific payload formatted.
So as u can see above - HA sees “messages” as a sensor. It would seems like HA should see the 3 or 4 values within the messages as the sensors.
It’s not HA but the integration and you can’t do anything about it that’s why I suggest you since few messages to use the MQTT way as you can then easily extract any data you need
I configure the MQTT broker in HA with the host, and username/password - but nothing populates in devices, MQTT.
And i know the Ttn MQTT is working bc if i go to any program that receives MQTT feeds, it will work.
Nothing here is showing up as a device -
This is the set up w the proper credentials that receives data if i try to listen for it on other devices.
It’s absolutely not the way to do it ! Please look at link in my previous posts where I explain how to configure HA MQTT add-on to get it to communicate it with TTN You have to create a bridge configuration !
connection nameitasyouwant
address eu1.cloud.thethings.network
bridge_protocol_version mqttv311
remote_username xxxxx@ttn (to get on device profile page in TTS console)
start_type automatic
notifications false
try_private false
remote_password NNSXS.XXXXXXX (named API keys in TTS console)
bridge_insecure true
topic # in 0
cleansession true
if this is correct - where do I put the above code? I dont see a folder named mosquito? where would I look - or does this get entered in an integration?
absolutely not needed, never indicated that in post linked above
it has to be put in a bridge.conf file that you’ll save in /share/mosquitto folder in HA If it’s properly done, when you restart the mqtt addon you’ll see in logs that it connects the bridge ! something similar to that:
[10:56:31] INFO: Starting mosquitto MQTT broker...
1684400191: Loading config file /share/mosquitto/bridge.conf
1684400191: Warning: Bridge dragino-ttn-bridge using insecure mode.
1684400191: Warning: Bridge boutons-inputs using insecure mode.
1684400191: Warning: Bridge tracker-tbeam-ttn-bridge using insecure mode.
1684400191: Warning: Bridge trackit-ttn-bridge using insecure mode.
2023-05-18 10:56:31: Warning: Mosquitto should not be run as root/administrator.
[10:56:32] INFO: Successfully send discovery information to Home Assistant.
[10:56:32] INFO: Successfully send service information to the Supervisor.
in terms of the file location that im going to add - i can find 2 share directories. one is /share and is currently empty, and the other share directory is - usr/share/
do I put the /mosquitto/bridge.conf file in the first directory that is currently empty?
[06:44:02] INFO: Starting mosquitto MQTT broker...
1684493042: Loading config file /share/mosquitto/bridge.conf
1684493042: Warning: Bridge hampttnlora using insecure mode.
2023-05-19 06:44:02: Warning: Mosquitto should not be run as root/administrator.
[06:44:03] INFO: Successfully send discovery information to Home Assistant.
[06:44:03] INFO: Successfully send service information to the Supervisor.
now the question is - where should the ttn data be visible? in the ttn integration or in the mqtt integration? I was thinking in the mqtt integration - and just log into the local mqtt broadcast - as I thought this would be bridged to show everything? unless im mis understanding.
It’ll show up through the mqtt broker (forget the TTN integration and best to disable it
I strongly suggest to use an app such as MQTT Snooper on your phone (Android only here sorry) and you connect it at TTN with same credentials you used for the bridge and it’ll allow you to “see” messages sent by TTN and know how to decode it
You then use JSON logic to extract data you want ! Here are some few examples for a button, a VOC sensor and get battery level of sensor
Have you done the configuration of the sensor ? as you should be able also to setup it to use different names for different sensors which makes it easier to extract data ! What sensor are you using ?
Hi there, looks like an awesome add-on, thank you!
Can sometime tell me if this would work for an on-premise version of Things Stack Community version? It appears the add-on needs the Storage Integration component which isn’t available in the community version. I tried to re-compose my environment but throws an error:
user@stack:~/the-things-stack$ sudo docker-compose run --rm stack storage-db init
Creating the-things-stack_stack_run … done
The storage integration is not available in the open-source version of The Things Stack.
For more information, see Storage Integration | The Things Stack for LoRaWAN
error:cmd/ttn-lw-stack/commands:storage_integration_not_available (Storage Integration not available)
I guess the only alternative is through MQTT bridge or perhaps Node-Red to pull/push data?
Nope it’s not done for on-premise version and I would strongly suggest in all matters to interface it using MQTT and not integration as integration is not really great and works not really great too ! MQTT is a little more work but so much more reliable
For me, MQTT was very easy. I installed the MQTT client (not broker). I connected it to host eu1.cloud.thethings.network port 1883, with username and api-key.
Then in my configuration.yaml I defined the mqtt sensors like this: