Show all possible entity states

I’ve been looking all over but can’t seem to find anything useful. I want to know if it is possible to query HA to show all know state types for all discovered devices/entities?

Does anyone know how I could possibly do this?

1 Like

You can look at the states you have received within the period you have history. There is no way for HA to know all possibilities of all sensors especially if they have never been sent to HA. You have to go to each integration (possibly on github) and see if you can get all possible outputs.

Hmm, that’s kind of disappointing. I would expect HA to interrogate the device when it’s paired, then store all the relevant information about it including all possible states. How can I create automations that are triggered by an entity state change if I don’t know what all the possible states are?

1 Like

Hello, look in HACS for the integration “auto-entities”

LG Werner

You seem to be assuming a categorical state with a fixed taxonomy. Would be good if you could elaborate a bit more. What you’re asking won’t make sense for numerical (there are numerous examples, so to speak) and free text states (like the track title for a media player). Normally, what you’re asking would simply be documented under the integration’s docs or the device’s docs. What are you actually trying to achieve here (honestly asking)?

1 Like

Pieter,

Thanks for the response. What I’m trying to accomplish is using the state change of an entity as a trigger in an automation. As an example, the alarm panel has 4 possible states (that I know of), disarmed, armed_home, armed_away and armed_night. When I was originally setting this up I didn’t know what the states were and I can’t simply grab them from a pull down. I had to figure out what they were. I just thought it would be helpful if there was a way to extract this information from the entities in HA to save me a bunch of time trying to find it from Google or the manufacturer. I’ve already asked a few manufacturers support and they don’t have the first clue.

Sorry, I can’t seem to find that integration in HACS.

Generally speaking, i find the documentation for MQTT-based platforms to be quite complete. For example, it clearly lists the valid states for alarm_control_panel.

However, that list may include values that are not supported by some other integration that implements alarm_control_panel. For example, Yale Smart Living only supports three of them.

Which integration are you using?

Sorry. Unter HACS / Frontend / Hinzufügen

Sorry Under HACS / Frontend / Add

I’m using the alarm_control_panel. I was just using that as an example though. I just thought there would be an easier way to get the info from HA for any entity states but I guess not everything is as easy as I want it to be. Thanks.

I think you’ll need to look at the source. For your specific example though this may deal with it Manual - Home Assistant

Found it now. I’ll see if it helps me out. Thank you.

Right, thanks.

Taras answered with exactly I would’ve given your reply (while I was sleeping :joy:).

Yes, the hardware vendors are usually not great when it comes to software, and the alarm hardware vendors in particular aren’t very open (at least from my experience, there are very few options unless you reverse engineer, and even less if you want to stay out of the cloud).

BTW, auto-entities won’t do the job. It’s just a convenient way to list sensors on the frontend using templates/rules and not to determine sensor states.

There are two ways to find this - play with the devices while watching the state in home assistant, preferably via the dev-tools, states.

Alternatively look at the source. It isn’t hard. for example this is a xiaomi lock: core/lock.py at de6e7ea016743e3dccbfe9bac0519650108ca387 · home-assistant/core · GitHub

Right at the start of the code is this

from homeassistant.const import STATE_LOCKED, STATE_UNLOCKED

So this lock has two possible states, locked and unlocked.

Every integration’s source is directly linked off Integrations - Home Assistant

1 Like

Thanks everyone, I think I have what I need now.