Hello,
I need help with the below, I think it should work but I so can’t get it done on my own. The whole setup here is to integrate everything via HomeAssistant.
An entity is now integrated via Zigbee Sonoff stick. The entity itself is available in Home Assistant. So far, so good.
Now this entity in Home Assistant also has attributes. See image below. Unfortunately, these attributes are not available as separate entities. Only as an attribute of an entity.
Who can explain to me in plain language IF and HOW I can make the attributes of an entity into a separate entity. I cannot work this out!
My eternal thanks will be yours!
The basic way would be a state-based Template sensor. You can set one up either through the UI Template Helper editor in the Helpers menu or in your YAML configuration.
The basic template to retrieve the value of an attribute looks like:
Hi,
Can you please elaborate some more how I am supposed to add the attributes of the entity? As shown above. They are not available in any of the menus?
The attributes as shown in the yellow field are not available as entities. And i would like them to be. How can I make them available as an entity?
Only the status (On/Off) is available, the attributes are not.
That would give you a separate entity with the same value of the attribute.
But might I ask why you think you need a separate entity? There may be other ways to get at the attribute where you want it. If so, it is not needed to duplicate the information.
Note that you need to replace the entity id and attribute name, because you only posted screenshots I was not able to copy paste your entity id.
When I try the syntax
value_template: “{{ state_attr(‘switch.voetpad_158d00023369fc’, ‘power_consumed’) }}”
In the helper, I do not get the power as a result.
That syntax is for yaml, that is why I said to use the gui and gave you an example without value_template: and surrounding quotes.
The output in the template tester just copied the value template text, which is not what you want in your new entity. You want that to be a number, not a text.