Switching state: not On/Off --> open/closed

Hello everybody,

I need you support, please.
I want to have a special output name for a switch.
Instead of “On/Off” I want to have as an output “open/closed” (garage door).

2025-02-13_09h02_29

How can I change the state to an output I want to have?

Thank you very much and have a nice day.

I’d suggest the Custom:button-card

If it is truly a button card, you can also use card_mod. Tom’s suggestion is the way to go, but I’ll still provide this example…

show_name: true
show_icon: true
type: button
tap_action:
  action: toggle
entity: switch.detached_garage_lights
card_mod:
  style: |
    span {
      color:transparent;
         }

    span::after {
       content: "{{ 'OPEN' if is_state('switch.detached_garage_lights', 'on') else 'CLOSED' }}" !important;
       color: {{ 'red' if is_state('switch.detached_garage_lights', 'on') else 'green' }} !important;
       display: flex;
       justify-content: center;
       align-items: center;
       font-weight: bold;
       font-size: 40px
        }
1 Like

Add the garage-door device class to your binary sensor.

https://www.home-assistant.io/integrations/binary_sensor/#device-class

If it was a discovered entity you should be able to do this in the more-info pop-up card that appeears when you click on the entity. Click on the cog icon then change the “Show as” setting.

If the entity was created in YAML you may be able to add

device_class: garage-door

to the configuration, depending on which integration you used.

If that is not available you can still add it using manual customisation. But we’ll get to that if the other options do not work.

EDIT: just noticed you said this:

Is it really a switch entity?

1 Like

Thank you all fo your really quick response and the hints.

Using binary sensors and device classes-garage_door was good.
This did what I wanted to have.
Thank you all!

2 Likes