Add show_unavailable_as option for switches and lights

When a ‘smart’ lightbulb or switch is powered off, it the ‘availability’ attribute is set to ‘Offline’. It would be helpful to be able to easily display powered off devices as ‘Off’. i.e. if my smart dining room lamp bulb is switched off at the plug it’s not very useful to see it displayed as ‘on’ in the UI if that was its state before the plug was switched. At the moment, I can get around this using the conditional card:

  - type: conditional
    conditions:
      - entity: sensor.dining_room_lamp_status
        state: Offline
    row:
      entity: sensor.dining_room_lamp_status
      name: Dining Room Lamp
      icon: 'hass:lightbulb'
  - type: conditional
    conditions:
      - entity: sensor.dining_room_lamp_status
        state: Online
    row:
      entity: light.dining_room_lamp
      secondary_info: brightness
      name: Dining Room Lamp

Which is very longwinded. What I would like to see is something like:

type: entities
entities:
  - entity: light.dining_room_lamp
    show_unavailable_as: 'off'

where the show_unavailable_as option could take the value ‘off’ or ‘on’ or ‘last_known’ where ‘last_known’ is equivalent to the existing behaviour.

Don’t forget to vote for your own Feature Request.

1 Like