“Assume off when unavailable” for lights? How?

Hi, I have a Zigbee light (via Zigbee2MQTT) in kitchen that I sometimes also switch off with the physical light switch. I would like HA to assume the light is off when the entity becomes unavailable. I understand this probably requires the light to have the Restore after power failure feature (which this one doesn’t) and that it wouldn’t be conceptually pure but assuming the entity is On when unavailable makes less sense to me than the other way around.

Is there a way? Thanks!

Also looking for the answer to this.
Don’t see any “default state” in the entity settings.

@Stooovie & @mattkrins

- platform: template
    lights:
      fake_light:
        friendly_name: "Fake light"
        value_template: >-
          {{ is_state('light.real_light', 'on') }}
        turn_on:
          service: light.turn_on
          target:
            entity_id: light.real_light
        turn_off:
          service: light.turn_off
          target:
            entity_id: light.real_light
1 Like

Thanks Olivier.
I tried a basic implementation of this and it worked great.
Problem now is to implement all light features such as brightness/color, etc. would need a huge, exhaustive and varying template for each light. Is there no way to inherit all settings and just overwrite some?

For all the features, it seems that you have to implements at least the one you really need, as shown in the provided link.

Is it possible to “templatize” it? I don’t think so :confused: