Cheap contact sensor

All good. Funny though, the motion sensor in the shower, closer to it than the humidity sensor decided it prefers the controller. :joy:

1 Like

Frickin' Frack! Error...

Any ideas? Off to go Googling...

Moments later...maybe not so bad - it came up!

Created account and looks like it's working.

Now do I need to install zigbee2mqtt?

2 Likes

Yes, if you want to. You can use ZHA and it's easier, but I'm really liking z2m. Stuff I thought was dead is actually working under z2m.

You'll add it via "Add-Ons" in the latest version. This video is updated, but now out of date too! :upside_down_face: But you can figure it out, just follow his instructions. They're good.

1 Like

It’s alive and well. I was about the throw this in the garbage. It was an AS-IS device for $8 or something like that. Can't remember now, but anyway I thought because of that it was actually no good and I had just been lucky for a while. But it's not dead at all. Working perfectly and controlling my Sonos speakers. I'm sold on z2m! :smiley:

Wait, weren't we talking about contact sensors? :rofl: Sorry @TMLeafs. I think you get the point. This will be the best way to get that bag of contact sensors working perfectly. :wink:

1 Like

So just get this add them and put them around the house?
https://www.amazon.co.uk/Sonoff-Universal-Gateway-Antenna-Assistant/dp/B09KZX4WSB/ref=pd_lpo_2?pd_rd_i=B09KZX4WSB&psc=1
What firmware do I need?

Here’s the link:

Here’s a relevant discussion thread:

I don’t think you’ll be disappointed. I bought several from Itead, but the price has gone up a few dollars: https://itead.cc/product/sonoff-zigbee-3-0-usb-dongle-plus/

Edit: if you’re using windows, go to windows update/check for updates after plugging it in to your usb. The correct usb driver for it should show up to install. I used the TI software to do the firmware update (it’s also free). You’ll want to take the case off of the dongle until you have it updated and paired with Hubitat because the buttons you’ll have to press are on the board.
Firmware flashing:

1 Like

The two big advantages of zigbee2mqtt over ZHA are that:

  1. More active development community - so new devices are more rapidly supported
  2. Your coordinator is portable. One day if you don't like HA, you can connect your z2m coordinator and paired devices to any new system of your choice that supports MQTT.
1 Like

My equivalent device is this guy:

I have it controlling Hubitat paired light bulbs.

Thanks...so I noticed the deCONZ add-in in HA...
image

I have a ConBee2 I'm going to use w/HA (plug it into Pi w/extender). If I install zigbee2mqtt I don't need deCONZ, correct?

And I did not see a zigbee2mqtt add-on, so that's an install outside of HA correct?

Oops - I forgot the video @SmartHomePrimer pointed to...

1 Like

Darn...something else stopping me at zigbee2mqtt config - video shows adding "Core" line to config, but I'm running Supervisor, not Core, tried using supervisor but that doesn't work.

Using
image

Summary
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] socat.sh: executing... 
[08:42:04] INFO: Socat not enabled, marking service as down
[cont-init.d] socat.sh: exited 0.
[cont-init.d] zigbee2mqtt.sh: executing... 
[cont-init.d] zigbee2mqtt.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[08:42:05] INFO: Handing over control to Zigbee2mqtt Core ...
> zigbee2mqtt@1.25.1 start
> node index.js
Zigbee2MQTT:info  2022-05-06 08:42:10: Logging to console and directory: '/config/zigbee2mqtt/log/2022-05-06.08-42-08' filename: log.txt
Zigbee2MQTT:info  2022-05-06 08:42:10: Starting Zigbee2MQTT version 1.25.1 (commit #unknown)
Zigbee2MQTT:info  2022-05-06 08:42:10: Starting zigbee-herdsman (0.14.27)
CREATED DECONZ ADAPTER
Zigbee2MQTT:info  2022-05-06 08:42:10: zigbee-herdsman started (resumed)
Zigbee2MQTT:info  2022-05-06 08:42:10: Coordinator firmware version: '{"meta":{"maintrel":0,"majorrel":38,"minorrel":88,"product":0,"revision":"0x26580700","transportrev":0},"type":"ConBee2/RaspBee2"}'
Zigbee2MQTT:info  2022-05-06 08:42:10: Currently 0 devices are joined:
Zigbee2MQTT:info  2022-05-06 08:42:10: Zigbee: disabling joining new devices.
Zigbee2MQTT:info  2022-05-06 08:42:11: Connecting to MQTT server at mqtt://core-mosquito
Zigbee2MQTT:error 2022-05-06 08:42:12: MQTT failed to connect: getaddrinfo ENOTFOUND core-mosquito
Zigbee2MQTT:error 2022-05-06 08:42:12: Exiting...
Zigbee2MQTT:info  2022-05-06 08:42:12: Stopping zigbee-herdsman...
Zigbee2MQTT:info  2022-05-06 08:42:12: Stopped zigbee-herdsman
[08:42:14] INFO: Handing over control to Zigbee2mqtt Core ...
> zigbee2mqtt@1.25.1 start
> node index.js
Zigbee2MQTT:info  2022-05-06 08:42:18: Logging to console and directory: '/config/zigbee2mqtt/log/2022-05-06.08-42-17' filename: log.txt
Zigbee2MQTT:info  2022-05-06 08:42:18: Starting Zigbee2MQTT version 1.25.1 (commit #unknown)
Zigbee2MQTT:info  2022-05-06 08:42:18: Starting zigbee-herdsman (0.14.27)
CREATED DECONZ ADAPTER
Zigbee2MQTT:info  2022-05-06 08:42:19: zigbee-herdsman started (resumed)
Zigbee2MQTT:info  2022-05-06 08:42:19: Coordinator firmware version: '{"meta":{"maintrel":0,"majorrel":38,"minorrel":88,"product":0,"revision":"0x26580700","transportrev":0},"type":"ConBee2/RaspBee2"}'
Zigbee2MQTT:info  2022-05-06 08:42:19: Currently 0 devices are joined:
Zigbee2MQTT:info  2022-05-06 08:42:19: Zigbee: disabling joining new devices.
Zigbee2MQTT:info  2022-05-06 08:42:19: Connecting to MQTT server at mqtt://core-mosquito
Zigbee2MQTT:error 2022-05-06 08:42:20: MQTT failed to connect: getaddrinfo ENOTFOUND core-mosquito
Zigbee2MQTT:error 2022-05-06 08:42:20: Exiting...
Zigbee2MQTT:info  2022-05-06 08:42:20: Stopping zigbee-herdsman...
Zigbee2MQTT:info  2022-05-06 08:42:21: Stopped zigbee-herdsman
[08:42:22] INFO: Handing over control to Zigbee2mqtt Core ...
> zigbee2mqtt@1.25.1 start
> node index.js
Zigbee2MQTT:info  2022-05-06 08:42:27: Logging to console and directory: '/config/zigbee2mqtt/log/2022-05-06.08-42-25' filename: log.txt
Zigbee2MQTT:info  2022-05-06 08:42:27: Starting Zigbee2MQTT version 1.25.1 (commit #unknown)
Zigbee2MQTT:info  2022-05-06 08:42:27: Starting zigbee-herdsman (0.14.27)
CREATED DECONZ ADAPTER
Zigbee2MQTT:info  2022-05-06 08:42:27: zigbee-herdsman started (resumed)
Zigbee2MQTT:info  2022-05-06 08:42:27: Coordinator firmware version: '{"meta":{"maintrel":0,"majorrel":38,"minorrel":88,"product":0,"revision":"0x26580700","transportrev":0},"type":"ConBee2/RaspBee2"}'
Zigbee2MQTT:info  2022-05-06 08:42:27: Currently 0 devices are joined:
Zigbee2MQTT:info  2022-05-06 08:42:27: Zigbee: disabling joining new devices.
Zigbee2MQTT:info  2022-05-06 08:42:28: Connecting to MQTT server at mqtt://core-mosquito
Zigbee2MQTT:error 2022-05-06 08:42:29: MQTT failed to connect: getaddrinfo ENOTFOUND core-mosquito
Zigbee2MQTT:error 2022-05-06 08:42:29: Exiting...
Zigbee2MQTT:info  2022-05-06 08:42:29: Stopping zigbee-herdsman...
Zigbee2MQTT:info  2022-05-06 08:42:29: Stopped zigbee-herdsman
[08:42:31] INFO: Handing over control to Zigbee2mqtt Core ...

Using
image

Summary

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] socat.sh: executing...
[08:46:57] INFO: Socat not enabled, marking service as down
[cont-init.d] socat.sh: exited 0.
[cont-init.d] zigbee2mqtt.sh: executing...
[cont-init.d] zigbee2mqtt.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[08:46:58] INFO: Handing over control to Zigbee2mqtt Core ...

zigbee2mqtt@1.25.1 start
node index.js
Zigbee2MQTT:info 2022-05-06 08:47:03: Logging to console and directory: '/config/zigbee2mqtt/log/2022-05-06.08-47-01' filename: log.txt
Zigbee2MQTT:info 2022-05-06 08:47:03: Starting Zigbee2MQTT version 1.25.1 (commit #unknown)
Zigbee2MQTT:info 2022-05-06 08:47:03: Starting zigbee-herdsman (0.14.27)
CREATED DECONZ ADAPTER
Zigbee2MQTT:info 2022-05-06 08:47:03: zigbee-herdsman started (resumed)
Zigbee2MQTT:info 2022-05-06 08:47:03: Coordinator firmware version: '{"meta":{"maintrel":0,"majorrel":38,"minorrel":88,"product":0,"revision":"0x26580700","transportrev":0},"type":"ConBee2/RaspBee2"}'
Zigbee2MQTT:info 2022-05-06 08:47:03: Currently 0 devices are joined:
Zigbee2MQTT:info 2022-05-06 08:47:03: Zigbee: disabling joining new devices.
Zigbee2MQTT:info 2022-05-06 08:47:04: Connecting to MQTT server at mqtt://supervisor-mosquito
Zigbee2MQTT:error 2022-05-06 08:47:05: MQTT failed to connect: getaddrinfo ENOTFOUND supervisor-mosquito
Zigbee2MQTT:error 2022-05-06 08:47:05: Exiting...
Zigbee2MQTT:info 2022-05-06 08:47:05: Stopping zigbee-herdsman...
Zigbee2MQTT:info 2022-05-06 08:47:06: Stopped zigbee-herdsman
[08:47:07] INFO: Handing over control to Zigbee2mqtt Core ...
zigbee2mqtt@1.25.1 start
node index.js

Either way, zigbee2mqtt shows bad gateway:
image

I did add the mqtt user, but can't add him to the zigbee2mqtt page above since it's stopped at bad gateway.

image

mqtt broker is set up and appears to be fine:

Added adapter in config per statement in video that it's required for conbee2 that I am using:
image

What port number is the broker running on? The most likely reason is that it is not running on port 1883, which is what zigbee2mqtt expects. Can you check if it is running on 8883?

Appears it's set to 8485:

I'll change it to 1883.

Ahh...didn't work, port already in use:

This is a new P4/8GB w/nothing else installed (AFAIR) other than HA and related. So not sure what else would be using 1883.

This is in SoCat section of config:

Just configure z2m to use port 8485. Since they are both on the same machine, you can try something like:

mqtt://local_ip_address:8485

(replacing local_ip_address with the Pi's IP address.)

Thanks, and sorry (another Q!) where would that line go in the config? Replace the "mqqt://supervisor-mosquito line, in the mqtt section, or ?

I tried replacing the mqqt section entry w/the ip/port combo, but still getting bad gateway after restarting zigbee2mqtt....log after changing to ip/port you suggested:

Summary

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] socat.sh: executing...
[09:51:21] INFO: Socat not enabled, marking service as down
[cont-init.d] socat.sh: exited 0.
[cont-init.d] zigbee2mqtt.sh: executing...
[cont-init.d] zigbee2mqtt.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[09:51:23] INFO: Handing over control to Zigbee2mqtt Core ...

zigbee2mqtt@1.25.1 start
node index.js
Zigbee2MQTT:info 2022-05-06 09:51:28: Logging to console and directory: '/config/zigbee2mqtt/log/2022-05-06.09-51-26' filename: log.txt
Zigbee2MQTT:info 2022-05-06 09:51:28: Starting Zigbee2MQTT version 1.25.1 (commit #unknown)
Zigbee2MQTT:info 2022-05-06 09:51:28: Starting zigbee-herdsman (0.14.27)
CREATED DECONZ ADAPTER
Zigbee2MQTT:info 2022-05-06 09:51:28: zigbee-herdsman started (resumed)
Zigbee2MQTT:info 2022-05-06 09:51:28: Coordinator firmware version: '{"meta":{"maintrel":0,"majorrel":38,"minorrel":88,"product":0,"revision":"0x26580700","transportrev":0},"type":"ConBee2/RaspBee2"}'
Zigbee2MQTT:info 2022-05-06 09:51:28: Currently 0 devices are joined:
Zigbee2MQTT:info 2022-05-06 09:51:28: Zigbee: disabling joining new devices.
Zigbee2MQTT:info 2022-05-06 09:51:29: Connecting to MQTT server at mqtt://192.168.20.138:8485
Zigbee2MQTT:info 2022-05-06 09:53:39: Connecting to MQTT server at mqtt://192.168.20.138:8485
Zigbee2MQTT:error 2022-05-06 09:53:40: MQTT failed to connect: read ECONNRESET
Zigbee2MQTT:error 2022-05-06 09:53:40: Exiting...
Zigbee2MQTT:info 2022-05-06 09:53:40: Stopping zigbee-herdsman...
Zigbee2MQTT:info 2022-05-06 09:53:41: Stopped zigbee-herdsman

replace:

server: mqtt://supervisor-mosquito

with

server: mqtt://local_ip_address:8485

Confirm that you use whatever IP address HA is using.

Yup - sorry, cross-posted w/you, that's not working:

Home Assistant is here:
image

Still getting bad gateway...very confusing!

I've also restarted the pi just in case a little while back. And restarted zigbee2mqtt every time I make a config change. Assuming I don't neet to keep restarting the mqtt mosquito broker add-on. These are the mqtt mosquito broker network config values:

Here is what Z2M HA Add-on Configuration page looks like...

You can also edit the zigbee2mqtt specific configuration.yaml file where these settings eventually end up.

I use the Samba AddOn to access the following folder on my RPi running HAOS.

Also, this guide is pretty easy to follow on YouTube

1 Like

Not to confuse things, @ogiewon, that looks like you're running an MQTT server on another machine like I am.

2 Likes

Nope, all on the same machine... Just a RPi 4 - 4GB booting directly from a USB-SATA SSD drive. It was my first time stumbling through the myriad of guides I found online. So, while it works, there may be even simpler solutions/settings than what I have. I am not going to touch it, as it seems to work, though! :wink:

2 Likes