Sonoff SNZB-06P Zigbee Human Presence Sensor

Sonoff SNZB-06P Zigbee Human Presence Sensor

I recently bought a Sonoff SNZB-06P Zigbee Human Presence Sensor. As ever it was very easy to connect it directly to Home Assistant via Zigbee. I chose this sensor as it has a microwave radar. This means that it can detect the slightest of movement, even breathing. This will stop the lights going off if people are in the room and not moving.

I wanted Home Assistant to turn the light on if there was movement and the room was dark. There is no illumination setting per se, just light or dark. You can’t use a certain lux level for the illumination.

After writing the automation that should have been quite simple, the light would not come on when it was dark. I noticed the light would come on when I re-entered the room. It turns out the the light level is only checked when movement is reevaluated.

The trick with the automation was to add a short delay before the light/dark value was evaluated. This has worked really well.

I am very happy with this sensor and would recommend it if you are looking for a motion sensor.

alias: Motion - Turn on office light
description: Motion - Turn on office light
trigger:
  - platform: state
    entity_id:
      - binary_sensor.sonoff_snzb_06p_occupancy
    from: "off"
    to: "on"
    for:
      seconds: 2
condition:
  - condition: state
    entity_id: sensor.sonoff_snzb_06p_last_illumination_state
    state: Dark
    enabled: true
action:
  - service: light.turn_on
    metadata: {}
    data: {}
    target:
      entity_id: light.office_ceiling_fan_light
mode: single

This will turn off the office light when no more motion is detected

alias: Motion - Turn off office light
description: Motion - Turn off office light
trigger:
  - platform: state
    entity_id:
      - binary_sensor.sonoff_snzb_06p_occupancy
    from: "on"
    to: "off"
    for:
      hours: 0
      minutes: 0
      seconds: 2
condition: []
action:
  - service: light.turn_off
    target:
      entity_id:
        - light.office_ceiling_fan_light
    data: {}
mode: single
 
Michael Curtis

My introduction to computers started at my middle school in 1981 when our maths teacher brought in a ZX80. That led the computer club being founded and using a Research Machine 380Z

My first computer was a 48K ZX Spectrum which I loved to programme. Once I left school I worked as a photocopier engineer, then a fax engineer and finally moving on the Apple computers.

For the next 30 years I worked as a system administrator. I now work in the cyber security industry as a Sophos Professional Services consultant

https://www.bazmac.me
Previous
Previous

Octopus Energy Daikin Heat Pump Installation - Day 2

Next
Next

Octopus Energy Daikin Heat Pump Installation - Day 1