Cheap contact sensor

You wore me down (and I need a small project to distract me from other stuff) so I've ordered my ConBee 2 and will be pestering you (INCESSENTLY!!) as soon as it arrives.

Gird your loins, my friend, gird your loins. :wink:

2 Likes

LOL. I wear neither a girdle, nor a substantial belt.

I cannot imagine this being difficult unless you want to install it on a Mac in a Python VM :scream: That, was difficult.

1 Like

As an alternative to HA, zigbee2mqtt works very well too if you only need it for sensors. It's not hugely resource intensive AFAIK and should run fine on a pi 2 zero rather than have to use a pi 4 (albeit if you can find a pi 2 zero these days).

2 Likes

Of course I know that, I received the pictures you sent. :wink: :rofl:

I have things mostly ready, but just remembered that my iPad that is my home hub is over at my Mom's house and needs to stay there for a while, so not sure when I'll be able to set things up this way.

And get something on your loins, puhleeze. :smiley:

I have several pi's available, so could get zigbee2mqtt up on one of them. Just need the cookbook to do the setup.

But I have HomeBridge running on one of my Pi's already, and Home Assistant Device Bridge and HomeBridge V2 on my C7, so that's all ready to go, so to speak. Just need to get my iPad back...but that may be a while.

Hmmm...what are the benefits of using HA/Homebridge over zigbee2mqtt?

Don't understand this comment

Just followed this video and got it running

You mean HA/Home Assistant Device Bridge? Homebridge and HADB are completely different. But I run all three plus two production HE hubs. If one thing can't do what I want or bridge the device I want, there's a really good chance the other will be able to.

BTW:
I found many posts saying the stating same issue I was having getting Zigbee2MQTT web UI running (502 bad gateway). For me the issue was that despite what the docs say, I could not keep my ZHA integration enable at the same time as the Zigbee2MQTT integration. As soon as I diabled the ZHA integration and restarted Zigbee2MQTT, I was able to open the web UI so I could join devices.

If it helps, I'm not running my MQTT broker on HA. It's running on the Mac that is also running Homebridge and my Insteon server. So configuration was slightly different than in the video. Here's what it looks like with a remote MQTT broker and ConBee 2.

Not to drive this thread too far off topic (it does still relate to inexpensive contact sensors in a roundabout way), but I'd like to ask a few of the MQTT vets like @aaiyar why there's so little info with Zigbee2MQTT? For example, an Aqara sensor only shows open/close. Compare that to ZHA which shows open/close, temp and battery.

Zigbee2MQTT

ZHA

Not a huge deal, but the friendly name is anything but, and it took quite a bit longer to join with Zigbee2MQTT, versus ZHA which takes about 1 sec to join most Aqara devices.

I already have the following channels in use, would you say it's a good idea to add another to the mix?

This shouldn't be the case. If you check the supported devices list for z2m the Aqara MCCGQ11LM for example exposes battery, contact, temperature, voltage and linkquality. These are shown in the exposes tab for each device. All my battery devices will show battery % for example (FWIW!)

2 Likes

Let me repeat what @rocketwiz wrote. Here's the information that zigbee2mqtt has for an Aqara contact sensor that I bring back into Hubitat as capabilities or attributes.

I'm not sure why that information isn't showing up in HA.

1 Like

Odd. As you can see from the screen shot of the z2m device list, itโ€™s not show up there first, so the HA entity does not get it either.

Maybe a bad pairing. Iโ€™ll try it again today and see if itโ€™s a different result. Thanks.

1 Like

Maybe. Also, it is possible that you have a different version of z2m.

1 Like

20 is free :wink:

Why so many 2.5 GHz AP channels? Put one of those on 5GHz if you can and kill their 2.5 GHz channels if not needed on all three.

1 Like

Latest stable build :man_shrugging:t3:

1 Like

Strange. It was added in version 1.17.1 - released in February 2021.

So maybe it is a bad pairing.

1 Like

Further to this, I hadn't taken stock of my setup in a while.

  • HE Main hub= ch13
  • HE Client hub= ch20
  • Hue bridge= ch25
  • ConBee 2 on HA via ZHA= Ch15 (on MQTT it defaults to Ch11 :point_left: Penny just dropped that this might be my Aqara issue described above)
  • WiFi mesh 2.4GHz=Ch 9

Generally just keep the channels relatively separate and this will resolve most issues that are related to interference. Space is less of a concern most of the time. My hubs are inches from each other in a cabinet (I'll post some pics of that soon so you can get an idea of just how close). Maybe the one exception is how I have the ConBee 2 stick mounted, but it's also not far from the other radios.

Zigbee really has less of an issue with WiFi than most people believe. As long as both devices support Clear Channel Assessment mode, the issues are more frequently the Zigbee controller, its Zigbee stack and the driver, combined with the end device radio and firmware. No one thing is the single answer.

There are just tonns of papers written on the subject of Zigbee and WiFi interferences, but no amount of research and testing in labs, or anechoic chamber testing is going to exactly predict what you'll see in practical everyday use in a home with building materials, furniture and mirrors absorbing and reflecting signals.

Oops, yeah, I meant to say I have Home Assistant Device Bridge, and HomeBridge V2 installed on my C7, and HomeBridge installed on one of my Pi's... I was kind of just going down an inventory of what I had in place at this point. :slight_smile:

1 Like

Yeah, bad pairing or possibly some other issue too. Pairs just as fast as ZHA now and showing everything available.


Side note for anyone "testing" like me. You might just find yourself committing to it. I disabled my ZHA integration to make z2m work for me, and in doing so I have the bonus of needing to re-pair everything! All are offline now when z2m is disabled and ZHA is re-enabled. Reboot doesn't help. It must re-write the Zigbee table, or HA will only look at the new Zigbee table now, or whatever... :rage: Faster for me to re-join all the devices than to learn what happened. :roll_eyes:

Oh well. In for a penny, in for a pound. Looks like I'm migrating to Zigbee2MQTT today.. :upside_down_face:

Honestly, and I'm completely willing to eat a little crow here. MQTT with Switchbot Bluetooth contact sensors have to be my favorite out of anything I've setup this year. They're a significantly higher amount of effort to get into HA and ultimately HE where I build my primary automations, but they just keep going. No interference, no configuration conflicts, no fuss and 100% local with an ESP32. They're the first thing to come back online when my HA reboots. I'm smitten with them. I did have to do some extra simple automations on HA with the other HE -> HA integration and Virtual switches, but that's not that big of a deal to me for the two sensors I have. They are rock solid and more feature rich (really USEFUL features, not just out of wack temps or incorrect battery reporting) than any contact sensor I know of.

[Update] Initial observation. Devices are responding much faster than they did with ZHA. They were already so fast. Honestly didnโ€™t realize (or believe perhaps :thinking:) that it could be any faster. Looks like I may be having an extra helping of crow for lunch. :stuck_out_tongue_winking_eye:

2 Likes

OK, just realized I'm a little confused about zigbee2mqtt vs. Home Assistant.

The setups I'm seeing talk about using zigbee2mqtt as an add-on to HA, not instead of HA. Is there a flow that brings devices into HE w/just zigbee2mqtt on a Pi w/a stick like the conbee2?

1 Like

Yes. I believe thatโ€™s what @aaiyar runs with nodeRed. So much easier to get it setup and into HE with HA and HA device bridge though.

2 Likes