SONOFF Zigbee Human Presence Sensor | SNZB-06P

Hi, all,

Sonoff just released this mmWave occupancy sensor. Do you know if it will be supported in Homey pro?

(Just thinking that I need to know how to use the SDK to add new devices :slightly_smiling_face: )

Cheers,
Ricardo

1 Like

Not by itself most probably.
There’s one sonoff app, but I think it’s not actively maintained.
So I think building a driver (app) yourself is one way to do it.

Or, while it’s supported by zha / zigbee2mqtt

You can install homeassistant with the zigbee2mqtt add-on OR the zha integration on an (old) Rpi or thin client. With the Home Assistant Community app you can add the sensor to Homey, like right away.

Or install zigbee2mqtt on an (old) Rpi or thin client. Together with the Zigbee2mqtt app you possibly can add the sensor to Homey. If not, you can ask nicely to the dev Robin to add support for this sensor, and donate him some of those presence sensors :blush:

2 Likes

Thanks, @Peter_Kawa for the detailed reply.

I have HA running on my NAS so I’ll probably follow your suggestion. I may also adventure myself into writing a driver and learn along the way.

Cheers,
Ricardo

1 Like

Thanks, @JPe4619. That’s quite a good info repo.
I’ll probably give it a try as soon as I receive the sensor.

Thanks again.

Cheers,
Ricardo

1 Like

i just received 2 of these sensors, i wish they would integrate them into Homey

Indeed. I’m still waiting for mine (coming from china…) but when it arrives I may give it a shot at developing the driver for it. If that happens I’ll let it be known on this thread.

@Ricardo_Santos @Peter_Kawa I do think the Sonoff Zigbee app is actively maintained. It is just that there weren’t that many new Sonoff Zigbee devices to be added lately. Also I’m sure that the developer @johan_bendz is quite busy maintaining the Tuya Zigbee app.

I think there are 2 much simpler ways to have the SNZB-06P device supported:

  1. It could be added as a supported device in the Sonoff Zigbee app. The amount of work depends on the exact Zigbee clusters it supports. Unfortunately the code for this app is not on Github, but I’m quite sure it is a spin off of the Tuya Zigbee app. At least it is the same developer that built both apps. Further see 2.
  2. It could be added as a supported device in the Tuya Zigbee app. From the specs of your device I think that it has the same Zigbee clusters as the existing Radar Sensor that is supported in the Test version of the Tuya Zigbee app. You could first try to install that from this url: https://homey.app/nl-nl/app/com.tuya.zigbee/Tuya-Zigbee/test/ (append /test to the url)
    It might work, but if that doesn’t work, you could request support for the device by creating a Github issue. Please read the first post of this topic carefully. You need to do some home work for that. :wink: Maybe @johan_bendz decides to also add that to the Sonoff Zigbee app.

Good luck!

1 Like

@Boechie Oww my bad, I checked the wrong Sonoff app as it appears. The wifi version.

if they got this device to work in Smartthings, someone should be able to get it working in Homey

The issue isn’t that it isn’t possible, the issue is that most community app developers have a chronic lack of time.

1 Like

Hi,

Here’s an update after getting it to work in Homey.

1) Pairing
I paired the sensor with HomeAssistant (via Sonoff Zigbee Dongle 3.0 / ZHA). This was pretty straightforward.
Details here:
How SONOFF Works with Home Assistant - SONOFF Official

Just a note: I did not use the Sonoff app eWeLink. I added the sensor directly in HA.

2) Firmware Upgrade
The factory firmware version was 1.0.3, which seems to be buggy according to online feedback.
I upgraded the firmware to 1.0.5 via HA by following the official Sonoff docs, here:
SNZB-06P Firmware Upgrade and Home Assistant Operation Guide - SONOFF Official

3) From HA to Homey
I installed the HomeAssistant App in Homey and added a new Device. The Sensor was immediately “discovered” and easily added to Homey.

4) Capabilities
The sensor has two main capabilities: motion alarm (alarm_occupancy) and occupancy alarm (alarm_motion)

In HA:
image

In Homey:
image

As seen in the images above, only the Occupancy alarm is triggered. The motion alarm was never triggered.

5) Available cards in Homey
Unfortunately, in Homey flows there’s only a ‘When’ card for Motion alarm and not for Occupancy alarm.

This meant I could not create a simple flow to turn on a light when the occupancy alarm was triggered.

6) Workaround
The workaround was to create an advanced flow, in which I can use a ‘And’ Logic card to check the Occupancy alarm state every second.

This works well. Not the “nicest” approach as it’s a periodic-status-check instead of event triggered, but it’s the simpler I could find without having to go into HomeyScript or developing an App (I’m a newbie to Homey).

I hope this can help whoever may need to use this sensor before it’s supported in an App.

Cheers,
Ricardo

Be aware that Homey may choose to rate-limit your flow if it thinks it gets called too often.

Since you’re using Home Assistant, there are other ways to get it working that will be push (event-based), not pull, like creating a Home Assistant automation that gets triggered on occupancy (or motion) and will execute a webhook call to Homey.

Thanks, @robertklep

So far, it’s been working fine, but thanks for the heads-up wrt rate-limiting.

Indeed, the approach you mention in HA is better. But I want to limit the dependencies on HA as much as possible and use it only as a “bridge”, without any logic or automations in it.

I’ll either patiently wait for this sensor to be available in an Homey App or adventure myself in developing one if I can find the time and state-of-mind to learn it.

Thanks again for the insights.

Cheers,
Ricardo

Because alarm_occupancy is not a valid Homey capability…

Ditch the Athom HA app :face_with_hand_over_mouth::grimacing:
The following is only possible with the very cool Home Assistant Community app:
(installable side-by-side with the Athom HA app)
It most probably gets it right when you add a new HA sensor. When it doesn’t, no worries;
Just edit the device in Homey, and add the motion capability again (maybe it has to be removed prior to adding)
Make sure to use alarm_motion as Homey capability.
Xmpl:

As suggestey by @Peter_Kawa and using the HA community app:
If the HA entities device_class is ‘occupancy’, then it’s added with alarm_motion capability when adding it as sensor device to Homey (the simple way). Peter is showing the more complex way of adding an entity to an existing device (like custom device).

1 Like

Thanks, @Peter_Kawa and @RonnyW. I was not aware of that App! I’ll try it out and let you know.
Thanks for mentioning it.

Cheers,
Ricardo

1 Like

Hi,

I have developed the driver for this sensor based of the athombv/node-homey-zigbeedriver: Generic class to map ZigBee Endpoints/Clusters to Homey capabilities (github.com).

@johan_bendz I’m glad to send you the four source files in case you want to add it to your SONOFF ZIGBEE app.

I believe SONOFF will release a new firmware in the coming weeks unlocking more functionalitites, but for now it’s working great with basic motion detection and already with two flows controlling the lights in my office room.

Cheers,
Ricardo

Hi @Ricardo_Santos

Sounds very good. Where can we get your driver?

Best,
Marcus

Hi, @Mr.K

I tried to get it added to the existing Sonoff ZigBee community app, but got no replies from the developer so far. I’ll initiate now the process of publishing a dedicated app with this driver. I already have part of the required images and I plan to submit it in the coming week or so.

I’ll post here as soon as it becomes available.

Cheers,
Ricardo

5 Likes