Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: MQTT entity name starts with the device name in your config - HA 2023.8 #337

Closed
Anto79-ops opened this issue Aug 1, 2023 · 16 comments

Comments

@Anto79-ops
Copy link

Anto79-ops commented Aug 1, 2023

Hi,

There was a change about MQTT naming for HA Core 2023.8 about not having device name in entity name. It seems HASS agent uses device name in the entity name, for example:

2023-08-01 07:48:57.836 WARNING (MainThread) [homeassistant.components.mqtt.mixins] MQTT entity name starts with the device name in your config {'availability_topic': 'homeassistant/sensor/ANTO/availability', 'icon': 'mdi:webcam', 'unique_id': '1004c0a3-9f4c-4cf3-95ba-2a91843c225f', 'device': {'identifiers': ['hass.agent-ANTO'], 'manufacturer': 'LAB02 Research', 'model': 'Microsoft Windows NT 10.0.19045.0', 'name': 'ANTO', 'sw_version': '2022.14.0', 'connections': []}, 'name': 'ANTO_HP_webcamactive', 'state_topic': 'homeassistant/binary_sensor/ANTO/ANTO_webcamactive/state', 'payload_off': 'OFF', 'payload_on': 'ON', 'payload_available': 'online', 'force_update': False, 'availability_mode': 'latest', 'enabled_by_default': True, 'payload_not_available': 'offline', 'encoding': 'utf-8', 'qos': 0}, this is not expected. Please correct your configuration. The device name prefix will be stripped off the entity name and becomes '_webcamactive'

All the mqtt entites generated by HASS agent generate this log.

@ABEIDO
Copy link

ABEIDO commented Aug 2, 2023

Ive read the post from HA regrading this but im not really getting it fully. Saw your post ImSkully so im asking here.

If i understand correclty, is Hass.Agent not going to work after 2024.2.0 if Hass.Agent isnt updated to comply with this before that?

@Anto79-ops
Copy link
Author

it sounds like it wont break HASS agent, but rather duplicate the device name according to Frenck

It already removed the device name from the friendly name on my system, but it has not changed the entity itself.

@micium
Copy link

micium commented Aug 2, 2023

same messages here:

MQTT entity name starts with the device name in your config {'availability_topic': 'homeassistant/sensor/XXXXXXXX/availability', 'icon': 'mdi:battery-high', 'unique_id': 'XXXXXXXX_battery_charge_remaining', 'device': {'identifiers': ['hass.agent-XXXXXXXX'], 'manufacturer': 'LAB02 Research', 'model': 'Microsoft Windows NT 10.0.19045.0', 'name': 'XXXXXXXX', 'sw_version': '2022.14.0', 'connections': []}, 'name': 'XXXXXXXX_battery Charge Remaining', 'state_topic': 'homeassistant/sensor/XXXXXXXX/XXXXXXXX_battery/XXXXXXXX_battery_charge_remaining/state', 'force_update': False, 'encoding': 'utf-8', 'qos': 0, 'payload_available': 'online', 'payload_not_available': 'offline', 'enabled_by_default': True, 'availability_mode': 'latest'}, this is not expected. Please correct your configuration. The device name prefix will be stripped off the entity name and becomes '_battery Charge Remaining'

@ImSkully
Copy link

ImSkully commented Aug 2, 2023

This should not be a breaking change when it does come into effect in 2024.2 so the deprecation warning is safe to ignore for HASS.Agent users.

It would be good to perhaps have the option to change the broadcasted entity name for sensors in the same way entity IDs can be provided.

@heilingbrunner
Copy link

Excuse me, for me this is a breaking change ...
or what am i doing wrong ??

What can I do ? Thanks.

ha-mqtt-warning-1 ha-device-mqtt-hm800

@ImSkully
Copy link

ImSkully commented Aug 5, 2023

@heilingbrunner Your issue is unrelated to this warning.

@gitolicious
Copy link

@heilingbrunner looks like these are AhoyDTU warnings, refer to the issue over there: lumapu/ahoy#1066

@vladyspavlov
Copy link

The easiest way to fix this is to do it yourself. You need to manually rename all of your sensor names to remove the device name from the sensor name:

Screenshot

image

So it should look like this:

Screenshot

image

Restart Home Assistant and the warning caused by HASS.Agent entities should disappear. Or another way is to ignore it and wait until someone creates a PR, and it will be merged.

@zanix
Copy link

zanix commented Aug 7, 2023

I also tried to rename all the sensors and commands but it failed in an unexpected way.

If you have multiple computers set with the same names for the sensors and commands, you get a unique_id error in the Home Assistant logs and the duplicates are not listed and never show up.
I ended up having to rename everything with the device name again and live with the repair warning.

@amadeo-alex amadeo-alex mentioned this issue Aug 7, 2023
@amadeo-alex
Copy link

Renaming the names will/can break the entity ids - sensor. within HA as with the current discovery payload, HA is creating entity IDs base on the name. You can leave it for now as it's only a deprecation warning.
A PR is in the works to address this.

@broyuken
Copy link

broyuken commented Aug 8, 2023

the entity id names don't change, it's the friendly names that are changing. and changing the names worked perfectly for me. Now I just need to get my dafang cameras and espresence updated.

@ABEIDO
Copy link

ABEIDO commented Aug 8, 2023

I also tried to rename all the sensors and commands but it failed in an unexpected way.

If you have multiple computers set with the same names for the sensors and commands, you get a unique_id error in the Home Assistant logs and the duplicates are not listed and never show up. I ended up having to rename everything with the device name again and live with the repair warning.

Same here, the disk sensor failed and only one pf the machines with hass agent showed disk c. Also decided to go back and rename with devicename.

@danielbrunt57
Copy link

I renamed my buttons and sensors in HASS Agent removing the device name from them and problem solved.

image

image

image

Alternative if you have more than 1 instance of the Agent deployed would be to change the sensor names somewhat so that they do not contain the device name yet still be unique across the Agent instances.

@Bodge-IT
Copy link

I moved the device name to the end of command name and sensor names. Seems to be OK so far.

@Anto79-ops
Copy link
Author

Fixed in 2.0.1 and up.

@ravngr
Copy link

ravngr commented Mar 8, 2024

For anyone following this and was confused as I was (subscribed to the issue but not activly following the project), there's a fork under the new hass-agent org that's had some ongoing development since this repo/org appears to be dormant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests