Show both name and state text in a button?
See original GitHub issueIs it possible to show both name and state text (of either the button’s entity, or ideally the state of a different entity) as part of a button? I’m trying to create a button representing an outlet that displays its name above an icon which shows the outlet state via colour and toggles the outlet’s switch when clicked, as well as show the outlet’s power usage (captured in the state of a template sensor exposing an attribute of the outlet) underneath the icon.
I have only been able to use the state_text
map to show static text on the button, but this text replaces the name, and also this mechanism isn’t ideal for numeric sensors that don’t have a limited set of discrete values that one can create a map for.
I can almost do this with a glance card button and a custom tap_action
to implement the toggle, except I can’t get the icon colour to reflect the state because the button’s underlying entity needs to be the power usage sensor in order to show the power usage underneath the icon. So I was hoping maybe to be able to implement it through this plugin.
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (5 by maintainers)
Top GitHub Comments
I agree and both templating and an actual separate state field will be in the next update, whenever that is.
This has been fixed in release 0.5.0.