name: Motion sensor light
products:
  - id: oapo5mmfbcr2y7ox
    manufacturer: Deta
    model: "360 Motion Sensor"
  - id: 8mrw54ape8opgl69
    manufacturer: Deta
    model: Light Motion Sensor
  - id: pxyhz90upglpoedu
    manufacturer: Arlec
    model: MAL315HA
entities:
  - entity: light
    dps:
      - id: 101
        type: string
        name: effect
        mapping:
          - dps_val: mode_off
            value: "off"
          - dps_val: mode_auto
            value: auto
          - dps_val: mode_on
            value: "on"
            default: true
      - id: 102
        type: boolean
        name: switch
        readonly: true
  - entity: switch
    name: Auto mode
    icon: "mdi:motion-sensor"
    dps:
      - id: 101
        type: string
        name: switch
        mapping:
          - dps_val: mode_auto
            value: true
          - dps_val: mode_on
            constraint: relay
            conditions:
              - dps_val: true
                value: false
          - dps_val: mode_off
            constraint: relay
            conditions:
              - dps_val: false
                value: false
      - id: 102
        name: relay
        type: boolean
        readonly: true
        hidden: true
  - entity: number
    name: Sensitivity
    icon: "mdi:human-greeting-proximity"
    category: config
    dps:
      - id: 103
        type: integer
        name: value
        range:
          min: 0
          max: 4
        mapping:
          - invert: true
  - entity: number
    icon: "mdi:camera-timer"
    class: duration
    category: config
    dps:
      - id: 104
        type: integer
        name: value
        unit: s
        range:
          min: 10
          max: 900
        mapping:
          - step: 10
  - entity: number
    name: Light level
    icon: "mdi:theme-light-dark"
    category: config
    class: illuminance
    dps:
      - id: 105
        type: integer
        name: value
        unit: lx
        range:
          min: 0
          max: 3900
        mapping:
          - invert: true
  - entity: switch
    name: Auto reset
    category: config
    dps:
      - id: 106
        type: boolean
        name: switch
