awilliams / wifi-presence

Presence detection on OpenWrt routers using connect/disconnect events of WiFi clients. Events are published to MQTT with Home Assistant integration.
MIT License
64 stars 8 forks source link

MQTT entity name starts with the device name #18

Open definitio opened 1 year ago

definitio commented 1 year ago

A breaking change was introduced in Home Assistant 2023.8 involving naming of MQTT entities.

The following warning is logged by Home Assistant:

2023-08-03 10:52:24.376 WARNING (MainThread) [homeassistant.components.mqtt.mixins] MQTT entity name starts with the device name in your config {'availability_topic': 'wifi/access-point-4/status', 'device': {'connections': [['mac', '00:00:00:00:00:0']], 'name': 'Xiaomi Redmi K20', 'via_device': 'access-point-4', 'identifiers': []}, 'icon': 'mdi:wifi-marker', 'json_attributes_topic': 'wifi/station/access-point-4/00-00-00-00-00-00/attrs', 'name': 'Xiaomi Redmi K20 access-point-4', 'object_id': '000000000000_access-point-4', 'payload_available': 'online', 'payload_home': 'connected', 'payload_not_available': 'offline', 'payload_not_home': 'not_connected', 'qos': 2, 'source_type': 'router', 'state_topic': 'wifi/station/access-point-4/00-00-00-00-00-00/state', 'unique_id': 'wifipresence_000000000000_access-point-4', 'encoding': 'utf-8', 'enabled_by_default': True, 'payload_reset': 'None', 'availability_mode': 'latest'}, this is not expected. Please correct your configuration. The device name prefix will be stripped off the entity name and becomes 'Access-point-4'
Gopten commented 1 year ago

Yeah saw that. Only have 7 months to find a fix. I found it a bit difficult to understand what was going to happen then. Possibly just some added stuff to the name or unique id then and some adjustments to some scripts and automations to account for new names. I wonder if can just adjust something in the wif-presence config to get around this. Must give it a go and see.

awilliams commented 1 year ago

Thanks, we'll have to update the naming convention to match these new requirements. https://developers.home-assistant.io/blog/2023-057-21-change-naming-mqtt-entities/