State shown in UI not the same as in developer console?

Hi!

I’m a bit confused here. When viewing the state on any entity (in this case a device tracker) I have noticied that the state shown in the UI isn’t the real one as it is shown in the developer console?

For example when building automations I need to know the REAL states names/ids and not the nice name that is shown in the UI. How can I view the history of this? In both the logbook and history apps it is only the friendly name shown and not the real id. How can I see the real ID of past states?

As you can see in the printsceen everywhere it says “Away” but the real state ID is “not_home”.

Thanks!

Edit: added image

That’s expected behaviour, the real state can only be seen under Developer Tools -> States. For the history you should be able to query the database to get the states.

Ok, no easier way then querying the DB? :slight_smile: I mean this seems like a standard scenario when people write automations? The need to know the different states of an entity?

Look at Developer Tools -> States when the entity changes state.

For most entities it’s also known what the states are. E.g. binary_sensors, input_booleans, lights and switches are only on or off. Device trackers are home/not_home or the name of the current zone erc.

Hi!

Hi, I hear what you are saying. And I agree, mostly for simple entities it’s just on or off and you can test it straight away. But I can also say that I have noticied that this can be confusing and annoying at times with entities that have more complex states. Such as the device trackers, alarms and vacuum cleaners. I was quite annoyed with my vaccum cleaner because it sometimes was in the state “ready” but that wasn’t clear from the UI.

Well well, I just think it could be nice to be allowed to see the state ID in someway in the history. :slight_smile:

Thanks for you answer!

1 Like

I agree. Unfortunately the current focus of the devs is to get everyone to use ‘device based’ triggers, conditions and actions using the UI automation builder, where knowledge of the actual ‘state’ of the entity doesn’t matter because you will select from a drop down list that matches the state you see in the dashboard.

For example you would select the device_tracker in the first box and in the next box will pick either ‘comes home’ or ‘goes away’ in the drop down, with those options translated into your own language. Or you would select your vacuum device as a condition and the next box would have ‘is ready’ or ‘is busy’ or whatever as its options.

And whilst this is a worthy goal, it is unfortunately at the expense of all the powerful parts of homeassistant becoming more and more ‘hidden’, which is OK for those of us that have been here for a long time because we already know what the backend states are, and how to template services based on them etc - but for the newer audience it is definitely confusing.

3 Likes

Yes! I use Node Red for all my automations (which is simply amazing!) so I need the actual state. And I agree, it’s nice for the early users but it would be nice if you could see the actual states as well. :slight_smile:

1 Like