Getting Sonoff SNZB-01 to work locally

I run it using an Edge Driver instead of the DTH, so it runs locally. See the following for a link to the driver.

1 Like

Both zwave and Zigbee are networking protocols maintained by independent third-party organizations, and you are right, both were originally designed assuming that they would run locally.

But it’s up to each hub manufacturer to decide exactly what, if any, cloud components they will include.

Back when smartthings was first designed, they made the decision to put almost all of their architecture in the cloud. I don’t think they’ve ever publicly discussed why, but it’s what they decided to do. (Now, however, they are transitioning to a new version of the architecture which will run much more locally.)

Anyway, even in a design like smartthings, there are still some significant advantages to Zwave or Zigbee versus Wi-Fi for home automation. The most obvious is that Wi-Fi uses way more power than either of those, maybe 10 times as much, which is why you see so few battery powered Wi-Fi sensors and handheld remotes. Up until about a year ago, a typical Wi-Fi sensor would need new batteries every two or three months as opposed to a Z wave or a Zigbee sensor with the same capabilities that probably wouldn’t need new batteries for a year or two.

There are some advances being made in power management for Wi-Fi that are just starting to come onto the market now, but not many devices available to take advantage of them yet.

The power advantage would apply to anyone, even someone with just two or three devices.

Another advantage for people with more complex systems is that both zwave and Zigbee can handle more individual devices than a typical home Wi-Fi network. If you expect to use between 100 and 200 devices, zwave or Zigbee can usually handle those easily, but you might need a special and more expensive Wi-Fi router to go above 50 or so.

But the main advantage is the power draw, and that applies whether it’s a cloud-based system or local. :sunglasses:

It wasn’t a permanent change, and it was about the channel rather than the profile, but it was a significant issue back in 2015 or so when the smartthings hub used the ZHA profile for Zigbee. However, by 2019 smartthings hubs (and the aeotec hub that came later) used the Zigbee 3.0 profile, and so do the Phillips hue bulbs. So that part is no longer an issue, fortunately.

I see, though it’s quite a bit more expansive to buy the items themselves, at least from what I’m seeing, though it might just be that I don’t know where to look haha. Either way, I think going for a hub for more advanced things was the right call, I doubt I’d have as much control with Wifi devices, or so I was told.

As for the bulb, I didn’t know things had changed, that’s good, and quite a relief I must say. That means that, theorically, I could buy as many Philips hue bulbs as I’d like, and only later buy the bridge if I wanted to expand even more? Cause it seems rather silly to buy the bridge for one or two bulbs… is it such a big deal?

Uhm… sorry for the I imagine incredibly basic question, but… what is an Edge Driver? I only knew of DTH (or DH as I previously called them… what does the T stand for?) and Smart Apps ^^"

DTH = Device Type Handler. Part of the original smartthings architecture written in the groovy programming language. See the old community FAQ for more about those and smartapps and Terminology.

All of this will be replaced soon in the new architecture. Instead of DTHs in groovy, there will be Edge Drivers written in the Lua programming language. And the biggest change is that the edge drivers will run on the local hub, not in the cloud. Here’s the official announcement on those:

Oh, I see. So, if I’m understanding this correctly, now a lot more things are going to run local, and to use the Edge Driver suggested above by Paul Oliver I should simply create a new DTH and use the LUA code instead? Or is there another procuedure that I need to follow?

No….Edge Drivers are written in the LUA programming language and will be used instead of a DTH but the architecture and the process is completely different.

In order to use an edge driver, you subscribe to the author’s channel by following a web link. Then you scan for nearby devices using the smartthings app and it should find the edge driver and automatically use it. So the whole idea is to make it much easier than the previous DTH method.

Because the edge driver has to be downloaded to your own hub, it can take some time before it shows up there, I have heard in some cases as much as 12 hours, but I don’t know for sure.

If you have any questions about a particular edge driver, you should ask in the author’s discussion thread in this forum.

But yes, the good news is that the edge driver will run local, they run on your own hub.

1 Like
  1. Follow the Channel Invitation in link in the I attached above and install the driver “RGD - Zigbee Button”.
  2. Either delete the custom DTH that you installed for the Sonoff Button or comment out the fingerprint (put // before fingerprint) in the custom DTH.
  3. Add new device by running Scan Nearby.
  4. make sure the button in near your hub.
  5. The device will appear in room not assigned.
1 Like

Theoretically, absolutely not. Use hue bulbs with a hue bridge and the official integration.

In practice, some people do use the bulbs without the bridge, it’s your choice.

All the details are in the FAQ that I already linked to so just read that if you want to know more.

2 Likes

Should I delete the one I currently have? I read that sometimes you have to keep it twice or something like that

I see. Thanks so much! So now I can use either DTH or an Edge Driver based on the device and my needs?

For now, yes.

Groovy DTHs Will stop working sometime soon (originally they said the end of 2020, but obviously we’re past that now). But edge drivers are still in beta and can be a little glitchy so a lot of people are willing to wait until the changeover is official. Again, your choice. :sunglasses:

For those reading this thread who are unfamiliar with what is going on, when a DTH is set to run locally it isn’t simply a case of the hub running the Groovy code instead of the cloud. It is more that the hub firmware includes some native device handlers and those are being used instead.

It never used to be possible to set a custom DTH to run locally and doing so gave error messages on saving which was rather confusing if they were new to you. Things changed to allow light tweaking around the edges of stock handlers. Things like adding metadata for a device presentation (definitely), fingerprints (possibly?) or installation and update code that remained in the cloud (wild speculation).

The negative is that you reach a point where your changes are not compatible with running locally. If you change the device name or namespace from the stock handler the hub won’t have a scooby what to do and will just run default code which may or may not be useful. If you mess with the business end of the code then you are wasting your time as it won’t be used.

4 Likes

I see! And do I have to delete the “old” device? Like, delete it, then rematch with this edge driver?

Edge is still in Beta and changing rapidly.

At one point you did have to delete the device, but I think now you can just rescan. But I don’t know for sure, @Paul_Oliver or @orangebucket would have a much better idea.

1 Like

Yes, you need to delete the button then repair it with the hub.

2 Likes

So, sorry for the delay but covid booster held me down for a couple days.

I did install the driver, then deleted the old DTH, which now has the button work off of the driver, however, it still says it’s running on cloud, and on top of that battery level isn’t displayed… is it normal?

It also has no Zigbee ID nor Device Network ID

The IDE does not show much information for devices with Edge Drivers other than Placeholder.

The IDE also shows them as cloud devices with is NOT correct. They truly are local.

Battery levels usually show up in a few hours or the next day at most.

So what you are seeing is normal.

1 Like

Battery level now shows, and I assume the lack of information is due to the Edge Drivers being in beta?

Also, is there any Edge Driver for SNZB-04? Since I’m using that one, however it’s gone offline a few days ago and hasn’t returned online ever since. Plus, if I can use Edge Drivers it’s even better, seeing as they’ll be the future from what I understand