Bewegunsmelder Schalter Steuerung

Verwende keine delays!
Sonder die trigger

  • Bewegung On
  • Bewegung aus für x min

Hier mal eine meiner Standard Automatisierungen für eine Licht Automatik


alias: Gartenhaus - Licht Automatik
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.tur_gartenhaus
    from: "off"
    to: "on"
    id: einschalten
  - platform: state
    entity_id:
      - binary_sensor.tur_gartenhaus_motion_detection
    from: "on"
    to: "off"
    for:
      hours: 0
      minutes: 5
      seconds: 0
    id: ausschalten
  - platform: state
    entity_id:
      - light.licht_gartenhaus
    to: "on"
    for:
      hours: 0
      minutes: 10
      seconds: 0
    id: ausschalten
  - platform: state
    entity_id:
      - sensor.lichtschalter_gartenhaus_action
    to: toggle
    id: Fernbedingung
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - Fernbedingung
        sequence:
          - service: light.toggle
            data:
              brightness: 255
            target:
              entity_id: light.licht_gartenhaus
          - delay:
              hours: 0
              minutes: 0
              seconds: 1
              milliseconds: 0
      - conditions:
          - condition: trigger
            id:
              - einschalten
          - condition: sun
            before: sunrise
            after: sunset
        sequence:
          - service: light.turn_on
            data:
              brightness: 255
            target:
              entity_id: light.licht_gartenhaus
      - conditions:
          - condition: trigger
            id:
              - ausschalten
          - condition: state
            entity_id: binary_sensor.tur_gartenhaus_motion_detection
            state: "off"
            for:
              hours: 0
              minutes: 5
              seconds: 0
        sequence:
          - service: light.turn_off
            data: {}
            target:
              entity_id: light.licht_gartenhaus
mode: single

Gruß
Osorkon