2 ms·
I've been trying to get Zigbee python libs to work without having to use Home Assistant, and have had so many problems. I'd love to see some lighterweight examp
by demondemidi 3y ago
I've been trying to get Zigbee python libs to work without having to use Home Assistant, and have had so many problems. I'd love to see some lighterweight examples that actually work. I've downloaded a dozen GitHub projects based on various gateway chips I've bought, and they are all outdated. Compared to BLE, it's trickier to get ZigBee working, at least that's been my experience. Too bad because I like the idea of having a mesh rather than relying a -112 dB Rx BLE receiver in my gateway.
Its Home Assistant or nothing, which is frustrating because HA is so overweight for what I need to do.
- fghorow 3y agoMaybe have a look at nodered? It talks to zigbee2mqtt reasonably well...
- JoshuaRedmond 3y agoHave you considered Zigbee2mqtt[0]? You'd be running an extra program, but the docs are really good, it's pretty lightweight, and MQTT is incredibly easy to talk to from python or basically anything else. It's compatible with HomeAssistant (which is how I use it), but can be used standalone without having to run HA at all. It also means you don't have to handle the weird idiosyncrasies between different manufacturers. [0] - https://www.zigbee2mqtt.io/ https://www.zigbee2mqtt.io/
- stavros 3y agoThis is the way to go. Z2M makes interoperability trivial. Just publish to MQTT.
- demondemidi 3y agoI didn't play with it because I wasn't sure if every sensor out there is natively MQTT capable? ANd if it is, it still has to document the topics it responds to, right? For example, I have a Sonoff temp sensor, how do I know what topic it publishes to and how do I query it? The documentation said nothing about MQTT.
- JoshuaRedmond 3y agoZigbee2mqtt has a huge number of supported devices (here's their official list [0]), which can also be expanded if the existing mappings don't work. It took me a minute to find, but the full MQTT structure is detailed here [1], and then individual devices detail what they expose on their page (e.g. this [2] is a random Sonoff temperature sensor). This means that the topic "zigbee2mqtt/sonoff-temp-example" will just have a simple JSON message with '{"humidity":46.93,"temperature":21.73, ...}'. Hope this helps! [0] https://www.zigbee2mqtt.io/supported-devices/ https://www.zigbee2mqtt.io/supported-devices/ [1] https://www.zigbee2mqtt.io/guide/usage/mqtt_topics_and_messages.html https://www.zigbee2mqtt.io/guide/usage/mqtt_topics_and_messa... [2] https://www.zigbee2mqtt.io/devices/SNZB-02.html https://www.zigbee2mqtt.io/devices/SNZB-02.html
- vineyardmike 3y agoI’m happy to tell you that you are fundamentally misunderstanding. This is good because reality is even simpler. Z2M takes ordinary Zigbee devices, and generates MQTT messages from them. The devices are oblivious to this, and have no idea what MQTT is. They just act like Zigbee devices. Z2M just publishes messages on a dedicated topic per device, with all the relevant information in that message. Generally for battery powered devices like temperature sensors, you won’t “query” their state by asking the device - because they sleep with the radio off. Instead you just wait for an update (and store it as needed). Docs for your device : https://www.zigbee2mqtt.io/devices/SNZB-02.html https://www.zigbee2mqtt.io/devices/SNZB-02.html
- IdiranVibe 3y agofwiw I've had the same experience. Struggled for ages trying to build (in my case) custom ZigBee compatible smart devices running python and it seemed impossible. Bit the bullet and setup home assistant and I've not looked back - I can even send post requests to web servers to do literally anything as part of it, it's great .
- ErneX 3y agoNot python but zigbee2mqtt + node-red are pretty great.