[RELEASE] Sonoff Zigbee Button, Motion/Temperature&Humidity/Contact Sensor Drivers

These drivers are BETA since they are very new, with that said, they probably work just as expected and might just have a bit to much debug information. When released as non-Beta they will exist in HPM.

4e224c55e323c94ee1d7a18b9b77e97ab1e120ef_2_666x500 (2)

Supported Devices

  • Sonoff Zigbee Button (works with model SNZB-01) - Import URL
  • Sonoff Zigbee Contact Sensor (works with model SNZB-04) - Import URL
  • Sonoff Zigbee Motion Sensor (works with model SNZB-03) - Import URL
  • Sonoff Zigbee Temperature & Humidity Sensor (works with model SNZB-02) - Import URL

For my Generic Zigbee Drivers, see this thread.
For my Xiaomi / Aqara Drivers, see this thread.
For my Tasmota WiFi Device drivers, see this thread.

Which driver should I use?

All drivers are as combined as they can be, the list above should make it clear which driver go with which model.

Installation

install manually using the Import URLs above. When changing from another driver to mine, make sure to PAIR THE DEVICE AGAIN WITHOUT DELETING IT! There are init commands that are easiest to send automatically just after pairing. You can also try activating the device and clicking Initialize on the driver page at the same time, it might work.

Pairing

Start Zigbee pairing in HE then hold the reset button on the device until the red light starts blinking. Wait patiently.

Your mesh

A good and stable mesh is needed for any Zigbee devices:

Presence

All drivers have the Presence capability, if the device doesn't report in for over 3 hours it will be set as not present. This makes it easy to see that all devices are online at a glance in a Dashboard, or to monitor any change in Presence using RM or a custom App.

Recovery Mode

This mode has been able to get devices that have fallen off to reconnect. There is a warning in the log when it activates for a device. When the device is back another warning message will show that it is disabled again.
This doesn't always work, it depends on how the device fell off. It at least helps partially. If the device doesn't come back on its own when in Recovery Mode, try quick-pressing the reset button (do not fully reset and re pair the device). This might nudge the device back. If pressing the reset button works, it works within 30 seconds. On button devices it may be enough to just press any button.
If none of the above works, re pairing without deleting the device is your last option.

Please report your progress in using this, good or bad results are all needed to know how to improve.

Counters

When a device becomes Present after having been Not Present, the restoredCounter is increased by 1. restoredCounter can be reset manually.
For every 3 hours the device is Not Present the notPresentCounter is increased by 1. When Present again, the notPresentCounter is reset to 0.

Errors/Bugs/Feature requests

Post about it in this thread and maybe it will make it into a Github Issue and eventually taken care of :wink:
There may still be some excessive logging, that will be removed shortly, this is mostly so that it will be easier to debug any early issues not caught during beta testing.

Mesh problems

Post about it somewhere else which seems appropriate. Not in this thread.

FAQ

  1. "Your idea is stupid and slow and I don't like it" - Don't use the code
  2. "Your app/driver is crashing my Hub. I submitted a support ticket" - Don't do that, the fine folks at Hubitat Inc. do NOT maintain this code. This software is given free of charge with no support, implied or otherwise. I may still help...
  3. "The latest update broke it, FIX IT" - I do this for fun, please don't make it un-fun.
  4. "I have a great idea for a feature" - Go ahead and post it, I might get around to it...
  5. "You ignored my great idea" - See #2
  6. "I hate you for getting my hopes up, your app/driver is awful/buggy/stupid" - Ok, please write a better one so I can use it
  7. "Please fix your code, it's broken" - I write this because I enjoy coding. I will continue to support and provide updates as long as that remains the case.
  8. "I stole your code and made it soooo much better" - Thanks. Please post it so I can start using it.
  9. "You are awfully sarcastic, I don't like you" - That's ok, I don't need you to
    (thank you @thomas.c.howard for the original FAQ this one was based on)
26 Likes

Reserved

Also reserved

@markus I have noticed you can start buying these on Aliexpress now at very reasonable prices :slight_smile:

Love the FAQ!!

I can't wait to give this a whirl when mine come in.

Received by itead. Without battery (for faster delivery).
They are as ugly as sin, but they are small.
I plan to replace the xiaomi sensors, after a test.
They are working for now.
Thanks Markus

p.s. they flash during the transition from active to inactive. They do'nt in the reverse transition

EDIT:... even more, those sensors are really reactive and FAST.

Why replace the Xiaomi sensors? Do these work better?

They seems more sensitive and rearm very quickly. With xiaomi you need to wait 60 second after a change before to detect a new change. The form factor for some uses is better (not for all). They are extremely cheap (I've got for 8.75 Euro)

Can you get these in the US yet or is it China shipping for now? Ill just buy on itead if so, what was shipping times if I may ask? Very interested in the temp/humidity sensor. I have a ton of iris v2 motion sensors I am very happy with and ive been using iris v2 door sensors (minus the magnet) for temp sensor but been in the market for a temp/humidity sensor for the fridge, rooms, etc. This is actually just what I need minus the 50 dollar price tag.

I have purchased some of the SNZB-3 and I cannot get them to connect. The hub finds them but stays on initiating and never completes the setup.

Any suggestions??

Are you sure there was no device named Device created? It does happen that the UI doesn't update. Otherwise, try to pair them close to the hub first, then reset and re pair (without deleting the device) at the location they are to be mounted.

Yea it did, sorry should have checked, went in as a hue motion device.

Thanks

what is the proper Procedure to recover a device that has gone missing?

I replaced the battery do I just wait?

It depends on how it disconnected, it might come back within a few hours, otherwise you could try to just fast-press the button on the device a few times and see if that is enough. If that doesn't work you would have to re-pair (without deleting the device in HE).

thanks @markus will give it a few hours since battery replacement and then follow your suggestions

What's the difference between these 2 settings?

Invert open/close inverts the contact sensor state. Switch Mirrors open/close changes how the switch state follows the contact sensor state. The different modes for that is for if the contact sensor is rewired as a button or you just want open to be on and closed to be off so that you can mirror the state of the switch to a an actual switch.

Do you mean for the optional child device? Sorry, I feel a bit dumb asking these questions. Just trying to understand it properly

The switch setting is for the optional child device. The contact sensor invert is for the contact sensor state of the main device.

Ok, got it. Makes sense now.
Cheers Markus.

1 Like