nielsonm236 / NetMod-ServerApp

Reprogramming the Web_Relay_Con V2.0 HW-584 Network Module
72 stars 23 forks source link

HomeAssistant MQTT Breaking changes in 2023.8+ #200

Closed yozik04 closed 11 months ago

yozik04 commented 1 year ago

Hello @nielsonm236,

I trust you are well!

HomeAssistant has thrown some work at us. See Breaking changes, "MQTT" section "Naming of MQTT entities" New entity naming guidelines

Currently we are getting next log lines in the HomeAssistant 2023.8:

2023-08-22 20:31:27.404 WARNING (MainThread) [homeassistant.components.mqtt.mixins] MQTT entity name starts with the device name in your config {'unique_id': '3a7c01fb9b5a_output_07', 'name': 'heat1floor output 07', 'availability_topic': 'NetworkModule/heat1floor/availability', 'state_topic': 'NetworkModule/heat1floor/output/07', 'command_topic': 'NetworkModule/heat1floor/output/07/set', 'device': {'identifiers': ['NetworkModule_3a7c01fb9b5a'], 'model': 'HW-584', 'manufacturer': 'NetworkModule', 'name': 'heat1floor', 'sw_version': '20220921 0050', 'connections': []}, 'enabled_by_default': True, 'optimistic': False, 'qos': 0, 'payload_not_available': 'offline', 'retain': False, 'payload_available': 'online', 'encoding': 'utf-8', 'payload_off': 'OFF', 'payload_on': 'ON', 'availability_mode': 'latest'}, this is not expected. Please correct your configuration. The device name prefix will be stripped off the entity name and becomes 'output 07'

To fix this we need to strip device name from the beginning of 'name' attribute.

'name': 'heat1floor output 07' should become 'name': 'output 07'

That will fix the issue.

nielsonm236 commented 1 year ago

OK - Should be easy to do. How soon is this needed?

yozik04 commented 1 year ago

Till February 2024 😄

nielsonm236 commented 1 year ago

Just to clarify the above ONLY affects the Auto Discovery messages, but not any of the other Subscribe or Publish messages, correct? Update: Don't need an answer. I made the changes to the Auto Discovery payload, updated Home Assistant to the latest revisions, and tested the code changes. Both the old and new firmware seems to work fine. I will release with the next General Release.

nielsonm236 commented 11 months ago

Addressed in release 20231009 1022

yozik04 commented 11 months ago

I can confirm that warnings are now gone.

nielsonm236 commented 11 months ago

Thank you. Nice when a fix actually works. :-)