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

Deprecate Home Assistant entity attributes #7683

Merged
merged 4 commits into from
Jun 8, 2021

Conversation

frenck
Copy link
Contributor

@frenck frenck commented Jun 3, 2021

This PR deprecates the use of Home Assistant entity attributes.

There are multiple reasons to deprecate support for this:

  • Home Assistant has been actively reducing and rejecting the use of additional/separate states in the entity attributes.
  • The entity attributes provided by the Home Assistant discovery in Zigbee2MQTT are duplicates of other entities.
  • Attribute updates trigger updates in the Home Assistant state machine for the entity. E.g., the humidity attribute of a temperature entity changes... thus triggers a state update for the temperature entity. This is confusing and unneeded.
  • Entity attributes are harder to use in Home Assistant automations. There is no need either, as they are already available as separate entities.
  • All state changes are stored in the database, including their attributes (as it is part of the state). This means a lot of additional overhead is stored.

Additionally, it helps to provide a better experience with Zigbee2MQTT out of the box.

An advanced configuration parameter is provided to restore old behavior if needed.

advanced:
  homeassistant_legacy_entity_attributes: true

Before:

image

After:

image
(ignore the state in this screenshot, it's about the attributes column)

Documentation PR: Koenkk/zigbee2mqtt.io#780

@frenck frenck changed the title Promote to dev Deprecate Home Assistant entity attributes Jun 3, 2021
@frenck frenck marked this pull request as ready for review June 3, 2021 10:10
@frenck
Copy link
Contributor Author

frenck commented Jun 4, 2021

Rebased PR onto the latest dev branch to catch up with changes. Adjusted the tests to match those latest changes and pass again.

@frenck
Copy link
Contributor Author

frenck commented Jun 4, 2021

Rebased PR onto the latest dev branch to catch up with changes.

@Koenkk
Copy link
Owner

Koenkk commented Jun 8, 2021

Thanks! 😄

@Koenkk Koenkk merged commit 000884b into Koenkk:dev Jun 8, 2021
@frenck frenck deleted the frenck-2021-1686 branch June 8, 2021 18:10
@andriej
Copy link

andriej commented Aug 12, 2021

How about remote 'action' attributes on battery entities?
Currently it's the way to do automations based on button pressed in YAML (as device-trigger is UI only or needs separate automation per each button/action).

Will it stay?

@frenck
Copy link
Contributor Author

frenck commented Aug 12, 2021

That is not related to this change.

For your subject, you can find documentation here: https://www.zigbee2mqtt.io/integration/home_assistant.html#responding-to-button-clicks

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.

3 participants