The “attribute” keyword doesn’t actually seem to do anything in the entities card, except remove the switch and replace it with a “-”. I was hoping to get something more interesting than the “-”, but I can’t figure out how to make it so. I sure wish the docs had examples.
type: entities
title: Washer Status
state_color: true
entities:
- entity: input_boolean.washer
icon: 'mdi:washing-machine'
secondary_info: last-changed
type: attribute
attribute: this does nothing
- entity: sensor.washer_power_sensor
- entity: input_select.washer_notify
Attribute is to get a entity’s attribute. input_boolean’s don’t have many attributes. What are you trying to show? I think you’re using the wrong type and expecting it to work without understanding what an attribute is.
Quite possibly. I’m trying to get it to show the “state” attribute of of the input_boolean.washer.
Under the “attribute:” key I’ve tried various things like state, input_boolean.washer, input_boolean.washer.state, state.input_boolean.washer, state.input_boolean.washer.state but nothing changes no matter what I use:
If I remove type: and attribute:, I get a switch to control the state – which is NOT what I want. I just want to display the state as “ON” or “OFF”. The rest of it is doing what I want - the icon is correctly colorized to show the state (state_color: true), the secondary_info is working fine. But I definitely don’t want a switch (this is actually a ‘virtual’ sensor based on a power consumption level), and the ‘-’ that I get kind of bugs me.
On your response I tried messing with it again with some limited success. If you use the attribute friendly_name, that does what you would expect. But not editable, which is also an attribute of an input_boolean. So I guess I need to refine my complaint, or perhaps offer some instruction to those others who are wondering how to use this:
Use an attribute name as shown in the “developer tools”, “states” page for your entity.
Trying to get an attribute from an entity to display in a horizontal stack. Not sure if I have the syntax wrong or if this isn’t possible in this context. Returns "Entity is non-numeric: climate.sensi_thermostat" so it’s probably not returning the attribute as I want and rather the default state.
Oh I see it’s because the type is gauge. If I switch that to entity it works. So the gauge type would have to support attribute which it currently does not. Guess I will have to work around it with a template again. Sigh.
… complains the value is non-numeric. I know the attribute value IS numeric. I can get / use it via a template fine and if I switch from gauge to entity it gives the expected numeric attribute value. My guess is it’s just ignoring the attribute line and returning the state (heat, cool, off, etc).
So my assumptions at this point is gauge does not support the attribute property (or whatever you call it) like entity does.