Good morning,
3 years ago I set in my house a Lorawan sensors network in this way :
Milesight AM319 > Lorawan protocol > Milesight UG65 gateway > MQTT protocol > Home Assistant (Mosquitto server inside Home Assistant)
I read on this forum that the best way is to publish one topic for each sensor, so I created inside UG65 an application for each sensor that publish data in different mqtt topics and in /homeassistant/packages/mqtt.yaml sensors like this :
mqtt:
sensor:
- name: "bagno nonna co2"
state_topic: "milesight/24e124710c345488"
value_template: "{{ value_json.co2 }}"
qos: 0
unit_of_measurement: "ppm"
force_update: true
unique_id: "6261676e6f206e6f6e6e6120636f32"
- name: "bagno nonna hcho"
state_topic: "milesight/24e124710c345488"
value_template: "{{ value_json.hcho }}"
qos: 0
unit_of_measurement: "mg/m3"
force_update: true
unique_id: "6261676e6f206e6f6e6e61206863686f"
- name: "bagno nonna umidità"
state_topic: "milesight/24e124710c345488"
value_template: "{{ value_json.humidity }}"
qos: 0
unit_of_measurement: "%"
force_update: true
unique_id: "6261676e6f206e6f6e6e6120756d69646974e0"
- name: "bagno nonna luminosità"
state_topic: "milesight/24e124710c345488"
value_template: "{{ value_json.light_level }}"
qos: 0
force_update: true
unique_id: "6261676e6f206e6f6e6e61206c756d696e6f736974e0"
- name: "bagno nonna presenza"
state_topic: "milesight/24e124710c345488"
value_template: "{{ value_json.pir }}"
qos: 0
force_update: true
unique_id: "6261676e6f206e6f6e6e612070726573656e7a61"
- name: "bagno nonna pm10"
state_topic: "milesight/24e124710c345488"
value_template: "{{ value_json.pm10 }}"
qos: 0
unit_of_measurement: "μg/m3"
force_update: true
unique_id: "6261676e6f206e6f6e6e6120706d3130"
- name: "bagno nonna pm2.5"
state_topic: "milesight/24e124710c345488"
value_template: "{{ value_json.pm2_5 }}"
qos: 0
unit_of_measurement: "μg/m3"
force_update: true
unique_id: "6261676e6f206e6f6e6e6120706d322e35"
- name: "bagno nonna pressione"
state_topic: "milesight/24e124710c345488"
value_template: "{{ value_json.pressure }}"
qos: 0
unit_of_measurement: "hPa"
force_update: true
unique_id: "6261676e6f206e6f6e6e61207072657373696f6e65"
- name: "bagno nonna temperatura"
state_topic: "milesight/24e124710c345488"
value_template: "{{ value_json.temperature }}"
qos: 0
unit_of_measurement: "°C"
force_update: true
unique_id: "6261676e6f206e6f6e6e612074656d7065726174757261"
- name: "bagno nonna tvoc"
state_topic: "milesight/24e124710c345488"
value_template: "{{ value_json.tvoc }}"
qos: 0
unit_of_measurement: "mg/m3"
At the beginning It was all working fine but after some months (4 or 5) I started to struggle with a strange problem : randomly Home Assistant stops to receive data from some sensors.
I made these checks :
- I have 12 sensors and Home Assistant lose data from some sensors (never all the sensors, at most from 4 sensors)
- it happens randomly between sensors, there aren’t sensors more afflicted
- it happens randomly about time, all can work fine for some weeks than appear one time the problem then work fine than appear the problem 2 / 3 / more time a day then work fine than…
- mosquitto mqtt is working fine when it happens (I have some Shelly through mqtt and there aren’t problems)
- the UG65 load normally is CPU Load 6% RAM (Capacity/Available) 512MB/34MB (6.64%) eMMC (Capacity/Available) 8.0GB/6.5GB (80.97%)
- the only way to solve the problem is an UG65 reboot from it’s webgui
- I sscheduled inside UG65 10 reboot a day (the max possible), each one every 2 hours and 30 minutes but it doesn’t solve : Home Assistant loose data for more than 4 or 5 hours (it is like the UG65 doesn’t make a reboot); so I must continue to check and make reboot manually.
I’m a noob and I’m not able to go further.
Can someone help me ?
Thanks in advance
