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

feat: Let Home Assistant generate entity name when device_class is present #18208

Merged
merged 1 commit into from
Aug 1, 2023

Conversation

Koenkk
Copy link
Owner

@Koenkk Koenkk commented Jul 4, 2023

Merge after home-assistant/core#95159 is released

@lluisd
Copy link

lluisd commented Jul 4, 2023

@Koenkk can this fix be related to my opened issue? #18201

@Koenkk
Copy link
Owner Author

Koenkk commented Jul 4, 2023

I don't think so, home-assistant/core#95159 is not merged yet. Since you also experience this after a Z2M rollback I think it is caused by HA and not by Z2M

@lluisd
Copy link

lluisd commented Jul 4, 2023

I don't think so, home-assistant/core#95159 is not merged yet. Since you also experience this after a Z2M rollback I think it is caused by HA and not by Z2M

sorry, I mean that when this PR is merged it will fix my issue as I see. I updated to 1.32.0 and all my entities are with _ and long names. Checking this PR and the old code I have renamed sensor device to "door sensor study" instead of "door_sensor_study" without HA renaming checkbox and now door sensor entities are shown as before. how can it be?

example:
image

now i rename it without underscores _
image

and now shows like that
image

seems that doesnt like having _ with names, but was working fine until 1.32.0

@Koenkk
Copy link
Owner Author

Koenkk commented Jul 4, 2023

Nothing has been changed regarding this with 1.32.0, if you want to debug this further I need to know the latest working z2m version. This pr might also fix your issue so maybe its not worth spending time on this.

@BudBundi
Copy link
Sponsor Contributor

BudBundi commented Aug 1, 2023

Merge after home-assistant/core#95159 is released

Is merged, HA beta is showing a warning, about the naming

@Koenkk Koenkk merged commit df93e4c into dev Aug 1, 2023
21 checks passed
@Koenkk Koenkk deleted the ha_device_class_name branch August 1, 2023 17:46
@Koenkk
Copy link
Owner Author

Koenkk commented Aug 1, 2023

@BudBundi thanks for the ping, do you know if this solves #18445 ?

@BudBundi
Copy link
Sponsor Contributor

BudBundi commented Aug 1, 2023

Updated the Add on of Zigbee2mqtt Edge, restart HA but the error message reappear. So it seems it is not fixed.

@BudBundi
Copy link
Sponsor Contributor

BudBundi commented Aug 1, 2023

@BudBundi
Copy link
Sponsor Contributor

BudBundi commented Aug 1, 2023

Okay, I took a quick look at it.

From the linked site

The mandatory fields were previously limited to at least one of connection and identifiers, but has now been extended to at least one of connection and identifiers as well as the name.

when looking at one of the entities with an MQTT explorer shows:

{
  "availability": [
    {
      "topic": "zigbee2mqtt/bridge/state"
    },
    {
      "topic": "zigbee2mqtt/Licht_Eingang_draußen/availability"
    }
  ],
  "availability_mode": "all",
  "device": {
    "identifiers": [
      "zigbee2mqtt_0x680ae2fffed624f1"
    ],
    "manufacturer": "Gledopto",
    "model": "Zigbee LED Controller RGB+CCT (pro) (GL-C-008P)",
    "name": "Licht_Eingang_draußen",
    "sw_version": "V_1_4"
  },
  "enabled_by_default": false,
  "entity_category": "diagnostic",
  "icon": "mdi:signal",
  "json_attributes_topic": "zigbee2mqtt/Licht_Eingang_draußen",
  "name": "Licht_Eingang_draußen_linkquality",
  "state_class": "measurement",
  "state_topic": "zigbee2mqtt/Licht_Eingang_draußen",
  "unique_id": "0x680ae2fffed624f1_linkquality_zigbee2mqtt",
  "unit_of_measurement": "lqi",
  "value_template": "{{ value_json.linkquality }}"
}

I see identifiers and name, but connection is missing
not sure if it means what is stated on https://developers.home-assistant.io/docs/device_registry_index

connections A set of tuples of (connection_type, connection identifier). Connection types are defined in the device registry module.

@Koenkk
Copy link
Owner Author

Koenkk commented Aug 1, 2023

Let's continue in #18445

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

Successfully merging this pull request may close these issues.

None yet

3 participants