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

Group entity does not use Zigbee group name by default #40

Closed
TheJulianJES opened this issue Apr 5, 2024 · 0 comments · Fixed by #42
Closed

Group entity does not use Zigbee group name by default #40

TheJulianJES opened this issue Apr 5, 2024 · 0 comments · Fixed by #42

Comments

@TheJulianJES
Copy link
Contributor

(issue created for tracking purposes)

Issue

Currently, entities created for Zigbee groups do not use the Zigbee group name by default.
For a light group, they'll instead always default to "Light group" which is not expected.

Part of the text below comes from PR #37:
This might be because HA expects the _attr_name attribute for a custom name, but the ZHA library never sets that. It uses _name and exposes it as the name property.
An example of old/new entity registry entries follows below.

Entity registry entries

I've created a ZHA group called "ZHA Group ID 3". The entity in the registry is regenerated on the current HA ZHA integration and afterwards with the ZHA library. A custom name is not set (as seen by name = null), so the original_name is used.
By default, this should be the ZHA group name, so "ZHA Group ID 3". It's also used for the entity id suffix then.
With the ZHA library, this always seems to be "Light group" for now (also resulting in the less descriptive entity id). That should be fixed in a future PR.

Current HA ZHA (good)

{
  "aliases": [],
  "area_id": null,
  "categories": {},
  "capabilities": {
    "min_color_temp_kelvin": 2000,
    "max_color_temp_kelvin": 6535,
    "min_mireds": 153,
    "max_mireds": 500,
    "effect_list": [
      "colorloop"
    ],
    "supported_color_modes": [
      "color_temp",
      "xy"
    ]
  },
  "config_entry_id": "9afa7813c02240642802443599f8f31b",
  "device_class": null,
  "device_id": "930dc2f5f2c48a5fa552c20c27af7e57",
  "disabled_by": null,
  "entity_category": null,
  "entity_id": "light.silicon_labs_ezsp_zha_group_id_3",
  "hidden_by": null,
  "icon": null,
  "id": "7b76a1842a3a279b08ba7a29e1c89bdf",
  "has_entity_name": true,
  "labels": [],
  "name": null,
  "options": {
    "conversation": {
      "should_expose": true
    }
  },
  "original_device_class": null,
  "original_icon": null,
  "original_name": "ZHA Group ID 3",
  "platform": "zha",
  "supported_features": 44,
  "translation_key": "light_group",
  "unique_id": "light_zha_group_0x0003",
  "previous_unique_id": null,
  "unit_of_measurement": null
}

Generated with ZHA lib (unique id is the same, name is not)

{
  "aliases": [],
  "area_id": null,
  "categories": {},
  "capabilities": {
    "min_color_temp_kelvin": 2000,
    "max_color_temp_kelvin": 6535,
    "min_mireds": 153,
    "max_mireds": 500,
    "effect_list": null,
    "supported_color_modes": [
      "color_temp",
      "xy"
    ]
  },
  "config_entry_id": "9afa7813c02240642802443599f8f31b",
  "device_class": null,
  "device_id": "930dc2f5f2c48a5fa552c20c27af7e57",
  "disabled_by": null,
  "entity_category": null,
  "entity_id": "light.silicon_labs_ezsp_light_group",
  "hidden_by": null,
  "icon": null,
  "id": "d4fa6c91250a492a5f574371f43634ce",
  "has_entity_name": true,
  "labels": [],
  "name": null,
  "options": {
    "conversation": {
      "should_expose": true
    }
  },
  "original_device_class": null,
  "original_icon": null,
  "original_name": "Light group",
  "platform": "zha",
  "supported_features": 44,
  "translation_key": "light_group",
  "unique_id": "light_zha_group_0x0003",
  "previous_unique_id": null,
  "unit_of_measurement": null
}

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 a pull request may close this issue.

1 participant