In a template how do I find that an entity has an entity_category “property”? How do I find it / test or filter for a category / print it?
By the way (stupid question?) what is an entity property?
For example in one of my ESPHome component I have added ‘entity_category: diagnostic’ on one of my sensor and it is correctly reported as a diagnostic sensor but where is the information hidden
I did try exactly the same thing on one of my devices {{ states.sensor.weather_power_cuisine.entity_category }}
I did not get any error, but I also did not get any value back.
Thanks for the feature request, I have voted for it
I am in the process of exploring templating in detail and I have read in detail the state object page. Before reading the explanation from @petro (this guy seems to know everything about architecture and is a “god” in templating) I did not realize that field = property ! So in the documentation in some places field is used and in some other places property is used
So far I have been trying to avoid using the states.sensor.weather_power_cuisine kind of syntax as this is not recommended in the templating page but as @petro mention sometimes there is no other way around, for example for accessing last_updated field/property : states.sensor.weather_power_cuisine.last_updated
and by using his trick {% if states.sensor.weather_power_cuisine is defined %}
you can avoid error during startup time.
I think it would be nice to have a function like state_field('domain.object_id', 'field_name') that would return the value of the field for the specified entity.
And less important, but would be nice to have, iterators like state_fields('domain.object_id') and to be consistant state_attributes('domain.object_id') as well