#Text value toggle

1 messages · Page 1 of 1 (latest)

fringe ibex
#

Trying to figure out the best way to do this - have a home office and my family is forever trying to figure out if I'm in a meeting or not through my closed door. I have an NSPanel right outside my office so I figured using that to somehow display something like "IN MEETING" or "FREE" would be a good idea.

My initial thought was just to create an input_boolean helper that I could use my Stream Deck to easily toggle, but that really only displays "On" or "Off". I started to look into creating a template sensor that outputs something else based on that value but started feeling like perhaps I was going about things in a less than ideal way. If anyone has any suggestions for the cleanest or most expedient way to have what is essentially a toggle between two text values, it would be greatly appreciated!

fringe ibex
#

FWIW, maybe not the cleanest way, but have it working with:

#
- sensor:
    - name: "Meeting Status"
      unique_id: meeting_status
      state: >-
        {% if is_state('input_boolean.meeting', 'off') %}
          Available
        {% elif is_state('input_boolean.meeting', 'on') %}
          IN MEETING
        {% endif %}
      icon: >-
        {% if is_state('input_boolean.meeting', 'off') %}
          mdi:video-off
        {% elif is_state('input_boolean.meeting', 'on') %}
          mdi:video
        {% endif %}
haughty gyro
#

You can probably create a trigger based template sensor which triggers on the steam deck button

#

so use the same logic as you now do to toggle the input boolean, and directly use the binary sensor