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

Discovered entities with a name that starts with the device name #152

Closed
DeadlySin2 opened this issue Aug 3, 2023 · 6 comments
Closed
Labels

Comments

@DeadlySin2
Copy link

After the update to 2023.8.0 i get a warning:

Some MQTT entities have an entity name that starts with the device name. This is not expected. To avoid a duplicate name the device name prefix is stripped of the entity name as a work-a-round. Please inform the maintainer of the software application that supplies the affected entities to fix this issue.

List of affected entities:

switch.livingroom_cam_motion_detection
select.livingroom_cam_sensitivity
select.livingroom_cam_ir
binary_sensor.livingroom_cam_motion
camera.livingroom_cam_image
switch.livingroom_cam_switch_on
switch.livingroom_cam_local_record
switch.livingroom_cam_rotate

Will it be fixed in later releases?

@darkxst
Copy link
Contributor

darkxst commented Aug 3, 2023

Its probably a bug, I don't think device name should in the entity names already.

can you "download diagnostics" from the mqtt device page for your camera and attach to this issue.

@DeadlySin2
Copy link
Author

config_entry-mqtt-467bbd8aaf33487b44d85ab0925677cb.json.txt
I have attached it to this post. It is not a bug - everything works fine. This is just a warning that it will causse a problem in version 2024.2.0

@darkxst
Copy link
Contributor

darkxst commented Aug 3, 2023

i meant a bug in the generated discovery messages.

As a workaround you can probably delete the HA Discovery "Name" prefix setting on the mqtt page in sonoff hack.

@roleoroleo
Copy link
Owner

The workaround should work.
Probably the final fix is in mqtt-sonoff.c:

    if (mqtt_sonoff_conf.ha_name_prefix) {
        sprintf(dname, "%s %s", mqtt_sonoff_conf.ha_name_prefix, *suffix);
    } else {
        strcpy(dname, *suffix);
    }

Remove the 1st sprintf.

@darkxst
Copy link
Contributor

darkxst commented Aug 22, 2023

Remove the 1st sprintf.

Yes, that looks the correct fix to me

roleoroleo added a commit that referenced this issue Aug 25, 2023
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Mar 31, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants