Turn on light, switch, scene, script or group based on motion, illuminance, sun (+ more conditions)

No need for this blueprint, just use a simple automation with time limited actions like this:

description: "Licht Eingangbereich automatisch"
mode: single
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.hue_bwm_eingangsbereich_belegung
    to: "on"
    id: trig_on
  - trigger: state
    entity_id:
      - binary_sensor.hue_bwm_eingangsbereich_belegung
    to: "off"
    from: "on"
    for:
      minutes: 4
      seconds: 50
  - trigger: state
    entity_id:
      - binary_sensor.hue_bwm_eingangsbereich_belegung
    to:
      - unavailable
      - unknown
    for:
      minutes: 30
conditions:
  - condition: or
    conditions:
      - condition: state
        entity_id: switch.eingang_switch_0
        state: "on"
        alias: "Ensure it still switches off when necessary also after 08:00"
      - condition: time
        after: "14:00:00"
        before: "08:00:00"
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - trig_on
        sequence:
          - action: switch.turn_on
            target:
              entity_id: switch.eingang_switch_0
    default:
      - action: switch.turn_off
        target:
          entity_id: switch.eingang_switch_0

I’m using HA with zigbee2mqtt. Within a couple of months version 2.0 of z2m will be released. In this release legacy features that are deprecated for years will be removed (see [forum post](Zigbee2MQTT 2.0.0 breaking changes · Koenkk/zigbee2mqtt · Discussion #24198 · GitHub about breaking changes).
When disabling legacy features this blueprint doesn’t work anymore.

Anyone an idea how to anticipate on the coming change?
Does this blueprint requires an update or does HA being updates?

1 Like

Is there a workaround for using HUE scene’s as target entity, the lights don’t go out if you use this.

  • found the option:
    afbeelding

I would like the light to turn on when movement is detected and turns offafter a minute. I have created a number helper, but it still doesn’t work.

How to switch from working days to weekend days. Time difference when activate this automation?

You could create two automations using this template, one with a blocking (template) entity is_weekend and another one with blocking entity is_workday. But if that makes more sense than writing an automation from scratch is up to you :wink: