Page 1 of 1

TTNMQTT module does not differentiate between 2 sensors of same vendor and type

Posted: Tuesday 01 February 2022 18:21
by hferinga
I run Domoticz version 2022.1 on a raspberry pi (debian version 10.11).

I have two sets of identical sensors: (Browan TBHH100 and Dragino LHT65).

Configured the TTN MQTT module and it gets data from The Things Network.

However only one sensor of each is discovered as a device in domoticz. But after a while I noticed that the recorded values in domoticz was alternating
between the two similar sensors.

When I run a mosquitto_sub on the same topic, I do see that they identify as different devices.

One of the Dragino sensors is outdoors, while the other is indoors. During the day it alternates between the outdoor temp (currently below 9) and the indoor temp (around 20). The same is true for the humidity. (the 2 Browan's are both indoors in different rooms with slightly different values for temp&humidity).

Furthermore it looks like that the first detected sensor is setting the device name.

I did not see any other settings that needed configuration on either domoticz or on The Things Network.

Any suggestions on how I can fix this would be appreciated.

Thanks,

Hans

Re: TTNMQTT module does not differentiate between 2 sensors of same vendor and type

Posted: Wednesday 02 February 2022 7:18
by kiddigital
Can you post MQTT messages from both devices? Identification is done by looking at Device_ID (and Application ID). I would expect them to be different.

Re: TTNMQTT module does not differentiate between 2 sensors of same vendor and type

Posted: Wednesday 02 February 2022 8:18
by hferinga

Code: Select all

{"tst":1643785455,"topic":"v3/first-lorawan-app@ttn/devices/eui-a84041c7e1843c40/up","qos":0,"retain":0,"payloadlen":1744,"payload":{"end_device_ids":{"device_id":"eui-a84041c7e1843c40","application_ids":{"application_id":"first-lorawan-app"},"dev_eui":"A84041C7E1843C40","join_eui":"A840410000000100","dev_addr":"260BC330"},"correlation_ids":["as:up:01FTWKZ2ANV4BJYTSB2KNE47KJ","gs:conn:01FTWGMHV68883M9SG27HMMH9B","gs:up:host:01FTWGMHVXXT2PND9AK39REQG8","gs:uplink:01FTWKZ246XNTCKH678EZ14VD7","ns:uplink:01FTWKZ247E43P26VNKJQDN2QW","rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01FTWKZ247CNPHRJ81P16M7QPJ","rpc:/ttn.lorawan.v3.NsAs/HandleUplink:01FTWKZ2ANJ8Z7SSBJVY59E1NH"],"received_at":"2022-02-02T07:04:15.958458615Z","uplink_message":{"session_key_id":"AX6YD2QjGtI2SaKOMwak5Q==","f_port":2,"f_cnt":465,"frm_payload":"zDACygNsAQLVf/8=","decoded_payload":{"BatV":3.12,"Bat_status":3,"Ext_sensor":"Temperature Sensor","Hum_SHT":87.6,"TempC_DS":7.25,"TempC_SHT":7.14},"rx_metadata":[{"gateway_ids":{"gateway_id":"hf-lorawan-gw01","eui":"58A0CBFFFE804796"},"time":"2022-02-02T07:04:15.691912889Z","timestamp":3488859731,"rssi":-105,"channel_rssi":-105,"snr":6,"uplink_token":"Ch0KGwoPaGYtbG9yYXdhbi1ndzAxEghYoMv//oBHlhDTjM//DBoMCO/Z6I8GEOacyeUCILjo+oHFZSoMCO/Z6I8GELmB98kC"}],"settings":{"data_rate":{"lora":{"bandwidth":125000,"spreading_factor":7}},"coding_rate":"4/5","frequency":"867100000","timestamp":3488859731,"time":"2022-02-02T07:04:15.691912889Z"},"received_at":"2022-02-02T07:04:15.751804030Z","consumed_airtime":"0.061696s","locations":{"user":{"latitude":52.432835816105154,"longitude":4.847298860549928,"altitude":2,"source":"SOURCE_REGISTRY"}},"version_ids":{"brand_id":"dragino","model_id":"lht65","hardware_version":"_unknown_hw_version_","firmware_version":"1.8","band_id":"EU_863_870"},"network_ids":{"net_id":"000013","tenant_id":"ttn","cluster_id":"ttn-eu1"}}}}     

Code: Select all

{"tst":1643785545,"topic":"v3/first-lorawan-app@ttn/devices/eui-a84041fd21841fb7/up","qos":0,"retain":0,"payloadlen":1618,"payload":{"end_device_ids":{"device_id":"eui-a84041fd21841fb7","application_ids":{"application_id":"first-lorawan-app"},"dev_eui":"A84041FD21841FB7","join_eui":"A840410000000100","dev_addr":"260BC245"},"correlation_ids":["as:up:01FTWM1SEWY2177RZA1ZV9WET3","gs:conn:01FTWGMHV68883M9SG27HMMH9B","gs:up:host:01FTWGMHVXXT2PND9AK39REQG8","gs:uplink:01FTWM1S86F55GQHYHGMW47TKF","ns:uplink:01FTWM1S88R15JTXS7AFBR54ZK","rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01FTWM1S881RDDBSMP35J9AJ95","rpc:/ttn.lorawan.v3.NsAs/HandleUplink:01FTWM1SEVC1SRR8TGR868TDBF"],"received_at":"2022-02-02T07:05:45.181679560Z","uplink_message":{"session_key_id":"AX6bnWmdGdICeMs/mZQlug==","f_port":2,"f_cnt":415,"frm_payload":"zEEHUwHJBQAAf/8=","decoded_payload":{"BatV":3.137,"Bat_status":3,"Hum_SHT":45.7,"ILL_lx":0,"TempC_SHT":18.75,"Work_mode":"Illumination Sensor"},"rx_metadata":[{"gateway_ids":{"gateway_id":"hf-lorawan-gw01","eui":"58A0CBFFFE804796"},"time":"2022-02-02T07:05:44.909001111Z","timestamp":3578086772,"rssi":-57,"channel_rssi":-57,"snr":7.5,"uplink_token":"Ch0KGwoPaGYtbG9yYXdhbi1ndzAxEghYoMv//oBHlhD0ipWqDRoMCMja6I8GENe89MwDIKCa3bSRaCoMCMja6I8GEJeDubED"}],"settings":{"data_rate":{"lora":{"bandwidth":125000,"spreading_factor":7}},"coding_rate":"4/5","frequency":"867500000","timestamp":3578086772,"time":"2022-02-02T07:05:44.909001111Z"},"received_at":"2022-02-02T07:05:44.968279265Z","consumed_airtime":"0.061696s","version_ids":{"brand_id":"dragino","model_id":"lht65","hardware_version":"_unknown_hw_version_","firmware_version":"1.8","band_id":"EU_863_870"},"network_ids":{"net_id":"000013","tenant_id":"ttn","cluster_id":"ttn-eu1"}}}}

Re: TTNMQTT module does not differentiate between 2 sensors of same vendor and type

Posted: Monday 07 February 2022 20:31
by kiddigital
Thank you for the info. A fix has been prepared.

If it gets accepted and merged, it will be in an upcoming beta release.

Re: TTNMQTT module does not differentiate between 2 sensors of same vendor and type

Posted: Tuesday 08 February 2022 9:23
by hferinga
kiddigital wrote: Monday 07 February 2022 20:31 Thank you for the info. A fix has been prepared.

If it gets accepted and merged, it will be in an upcoming beta release.
Thanks for the quick response.

Re: TTNMQTT module does not differentiate between 2 sensors of same vendor and type

Posted: Tuesday 08 February 2022 17:18
by hferinga
That fixed it. Thanks again. Installed build 14166.

Re: TTNMQTT module does not differentiate between 2 sensors of same vendor and type

Posted: Tuesday 08 February 2022 17:19
by kiddigital
Great

So this topic can be closed

Re: TTNMQTT module does not differentiate between 2 sensors of same vendor and type

Posted: Wednesday 09 February 2022 12:12
by hferinga
kiddigital wrote: Tuesday 08 February 2022 17:19 Great Image

So this topic can be closed Image
yes