General question about the "show as" setting for entities (door contact sensor)

Hello all,

Can someone give me a little bit of knowledge of the purpose of the “show as” input field within the entities settings dialog box?

Why would one wan to change it from it’s default for a entity. Does it change available settings etc./ how you interact with it in different areas of home assistant?

Can someone give me an example using a contact sensor that is on a door? What if I changed it’s show as from “opening” to “door”. What implications would that have?

Thank you all!!


t

You’re setting the Device Class. See here for binary sensors:

Note that whatever you set it to, the entity state will always be on or off. Different classes will show different “translated states” like door “Open” / “Closed”; motion “Detected” / “Clear” etc.

If you’re writing automations, I’d always recommend using entity triggers, conditions etc that work on the underlying state, as opposed to device triggers etc that abstract things and use the translated state.

Ahhh, I follow you. Thank you for this explanation and link. Very helpful!!