Multi détecteur de mouvements

Voici mes deux blueprint pour le traitement

blueprint:
  name: Zigbee2MQTT - Detector light and switch
  description: Automate your Detector light and switch via Zigbee2MQTT
  domain: automation
  input:
    motion_sensor1:
        name: Motion Sensor 1
        description: A sensor that detects motion
        default: []
        selector:
          entity:
            integration: mqtt
            domain: binary_sensor
    motion_sensor2:
        name: Motion Sensor 2
        description: A sensor that detects motion
        default: []
        selector:
          entity:
            integration: mqtt
            domain: binary_sensor
    motion_sensor3:
        name: Motion Sensor 3
        description: A sensor that detects motion
        selector:
          entity:
            integration: mqtt
            domain: binary_sensor                        
    light:
        name: Light
        description: A light that is turned on and off
        default: []
        selector:
          entity:
            integration: mqtt
            domain: light
    pluglight:
        name: Plug Light
        description: A plug light that is turned on and off
        default: []
        selector:
          entity:
            integration: mqtt
            domain: switch            
mode: restart
max_exceeded: silent                               
trigger:
  - type: motion
    platform: device
    device_id: device_id(motion_sensor1)
    entity_id: !input motion_sensor1
    domain: binary_sensor
    id: capteur1on
  - type: motion
    platform: device
    device_id: device_id(motion_sensor2)
    entity_id: !input motion_sensor2
    domain: binary_sensor
    id: capteur2on
  - type: motion
    platform: device
    device_id: device_id(motion_sensor3)
    entity_id: !input motion_sensor3
    domain: binary_sensor
    id: capteur3on
  - type: no_motion
    platform: device
    device_id: device_id(motion_sensor1)
    entity_id: !input motion_sensor1
    domain: binary_sensor
    id: capteur1off
  - type: no_motion
    platform: device
    device_id: device_id(motion_sensor2)
    entity_id: !input motion_sensor2
    domain: binary_sensor
    id: capteur2off
  - type: no_motion
    platform: device
    device_id: device_id(motion_sensor3)
    entity_id: !input motion_sensor3
    domain: binary_sensor
    id: capteur3off
condition:[]          
action:
  - choose:
      - conditions:
          - condition: trigger
            id: capteur1on
        sequence:
          - service: light.turn_on
            data: {}
            target:
              entity_id: !input light
          - service: switch.turn_on
            data: {}
            target:
              entity_id: !input pluglight              
      - conditions:
          - condition: trigger
            id: capteur2on
        sequence:
          - service: light.turn_on
            data: {}
            target:
              entity_id: !input light
          - service: switch.turn_on
            data: {}
            target:
              entity_id: !input pluglight                             
      - conditions:
          - condition: trigger
            id: capteur3on
        sequence:
          - service: light.turn_on
            data: {}
            target:
              entity_id: !input light
          - service: switch.turn_on
            data: {}
            target:
              entity_id: !input pluglight              
      - conditions:
          - condition: trigger
            id: capteur1off
          - condition: trigger
            id: capteur2off
          - condition: trigger
            id: capteur3off            
        sequence:
          - service: light.turn_off
            data: {}
            target:
              entity_id: !input light
          - service: switch.turn_off
            data: {}
            target:
              entity_id: !input pluglight              
blueprint:
  name: Zigbee2MQTT - Detector light
  description: Automate your Detector light via Zigbee2MQTT
  domain: automation
  input:
    motion_sensor1:
        name: Motion Sensor 1
        description: A sensor that detects motion
        default: []
        selector:
          entity:
            integration: mqtt
            domain: binary_sensor
    motion_sensor2:
        name: Motion Sensor 2
        description: A sensor that detects motion
        default: []
        selector:
          entity:
            integration: mqtt
            domain: binary_sensor
    motion_sensor3:
        name: Motion Sensor 3
        description: A sensor that detects motion
        selector:
          entity:
            integration: mqtt
            domain: binary_sensor                        
    light:
        name: Light
        description: A light that is turned on and off
        default: []
        selector:
          entity:
            integration: mqtt
            domain: light
mode: restart
max_exceeded: silent                               
trigger:
  - type: motion
    platform: device
    device_id: device_id(motion_sensor1)
    entity_id: !input motion_sensor1
    domain: binary_sensor
    id: capteur1on
  - type: motion
    platform: device
    device_id: device_id(motion_sensor2)
    entity_id: !input motion_sensor2
    domain: binary_sensor
    id: capteur2on
  - type: motion
    platform: device
    device_id: device_id(motion_sensor3)
    entity_id: !input motion_sensor3
    domain: binary_sensor
    id: capteur3on
  - type: no_motion
    platform: device
    device_id: device_id(motion_sensor1)
    entity_id: !input motion_sensor1
    domain: binary_sensor
    id: capteur1off
  - type: no_motion
    platform: device
    device_id: device_id(motion_sensor2)
    entity_id: !input motion_sensor2
    domain: binary_sensor
    id: capteur2off
  - type: no_motion
    platform: device
    device_id: device_id(motion_sensor3)
    entity_id: !input motion_sensor3
    domain: binary_sensor
    id: capteur3off
condition: []        
action:
  - choose:
      - conditions:
          - condition: trigger
            id: capteur1on
        sequence:
          - service: light.turn_on
            data: {}
            target:
              entity_id: !input light
      - conditions:
          - condition: trigger
            id: capteur2on
        sequence:
          - service: light.turn_on
            data: {}
            target:
              entity_id: !input light
      - conditions:
          - condition: trigger
            id: capteur3on
        sequence:
          - service: light.turn_on
            data: {}
            target:
              entity_id: !input light
      - conditions:
          - condition: trigger
            id: capteur1off
          - condition: trigger
            id: capteur2off
          - condition: trigger
            id: capteur3off            
        sequence:
          - service: light.turn_off
            data: {}
            target:
              entity_id: !input light
1 « J'aime »