ironsheep / RPi-Reporter-MQTT2HA-Daemon

Linux service to collect and transfer Raspberry Pi data via MQTT to Home Assistant (for RPi Monitoring)
GNU General Public License v3.0
441 stars 62 forks source link

Always update sensor_name after resolving hostname #144

Closed kroecks closed 2 months ago

kroecks commented 3 months ago

My pi's weren't registering correctly and I was getting a lot of MQTT traffic with rpi_{hostname}. This is because the "default_sensor_name" is not the same as the MQTT.sensor_name config, and yet the default sensor name is being used to validate whether to set the hostname.

Until the logic for reconciling the MQTT config and the default sensor name is more meaningful, it's better to just ALWAYS set the sensor name correctly.

ironsheep commented 2 months ago

Thank you, Ken, for spotting this. This issue has been plaguing many of us. I appreciate your taking the time to file this PR! -Stephen