hjelev / rpi-mqtt-monitor

Raspberry Pi MQTT Monitor gathers system information and sends it to a MQTT server.
GNU General Public License v3.0
176 stars 42 forks source link

Homeassistant Name convention #27

Closed TBobsin closed 8 months ago

TBobsin commented 11 months ago

Hello, i use your script with Home Assistant. It's working fine :) But HA has a naming convention that the Hostname should not be in the Entity name.

suggestion: provide an HA Version of your script and remove "hostname" from the Description lines. data["name"] = hostname + " CPU Usage" ... Thanks

Naming of MQTT Entities https://rc.home-assistant.io/integrations/mqtt/

Warning Message in home-asssistant.log [homeassistant.components.mqtt.mixins] MQTT entity name starts with the device name in your config {'state_topic': 'mqtt-monitor/pi-alarm/uptime_days', 'icon': 'mdi:calendar', 'name': 'pi-alarm Uptime', 'unique_id': 'pi-alarm_uptime_days', 'unit_of_measurement': 'days', 'device': {'identifiers': ['pi-alarm'], 'manufacturer': 'Raspberry Pi', 'model': 'Raspberry Pi 4 Model B Rev 1.2\x00', 'name': 'pi-alarm', 'sw_version': 'Debian GNU/Linux 12 (bookworm)\n', 'connections': []}, 'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>, 'force_update': False, 'encoding': 'utf-8', 'enabled_by_default': True, 'payload_available': 'online', 'payload_not_available': 'offline', 'qos': 0, 'availability_mode': 'latest'}, this is not expected. Please correct your configuration. The device name prefix will be stripped off the entity name and becomes 'Uptime'

hjelev commented 8 months ago

Thanks for reporting this, I also use the script with HASS. I have removed the host from the name.