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

Add attribute as a parameter for the state integration #106

Closed
xaviml opened this issue Jul 30, 2020 · 3 comments
Closed

Add attribute as a parameter for the state integration #106

xaviml opened this issue Jul 30, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@xaviml
Copy link
Owner

xaviml commented Jul 30, 2020

Feature Request

Is your feature request related to a problem?

As of now, the state integration only listen to state changes. However, if the user wants to listen to state attribute changes, he/she is not able to do so.

Describe the solution / feature you'd like

Add an attribute parameter for the state integration that is None by default.

Describe alternatives you've considered

Additional context

@xaviml xaviml added the enhancement New feature or request label Jul 30, 2020
@xaviml xaviml self-assigned this Jul 30, 2020
@xaviml xaviml closed this as completed in fa6634f Jul 30, 2020
@htvekov
Copy link
Contributor

htvekov commented Jul 31, 2020

Hi' @xaviml

Just a note.
Won't we run into problems with non updating HA sensors, if only attribute changes - but state doesn't ?
Probably not an issue in real life for the kind of sensors that will be used here, but I'm not sure.

I just wasted hours and hours on my display code, trying to template my way out of an explicit entity_id as trigger.
Just to find out that template didn't always update when only attributes changed.

I find the HA documentation a little vague regarding this, so I'm not actually sure if this could give issues later on ?

Ciao !

@xaviml
Copy link
Owner Author

xaviml commented Jul 31, 2020

Hi Henning,

Thank you for your concerns. This new attribute works the same as it is described in AppDaemon: https://appdaemon.readthedocs.io/en/latest/AD_API_REFERENCE.html#appdaemon.adapi.ADAPI.listen_state the attribute keyword. According to the documentation it listens to changes on the specific state attribute and not the state itself.

This enhancement does not break anything, it is just an add up to what is already there. By default, it will listen to the state as it was already doing.

Cheers,
Xavi M.

@htvekov
Copy link
Contributor

htvekov commented Jul 31, 2020

Check, Xavi !

Actually it's a smart move that can eliminate lots of ControllerX code and is a lot more user friendly 👍😃
It's seems that appdeamon is somewhat more dynamic than HA when it comes to states and attributes.
It still eludes me, that you cant use an attribute change on an entity_id as direct trigger in HA, Only way as I understand is to specify a hardcoded entity_id or breakout attributes in seperate sensors.
Not very dynamic, when I need to trigger on attribute changes on first entity_id in a group 🤔

Ciao !

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

No branches or pull requests

2 participants