6 votes

How standardised are Z-Wave/ZigBee device APIs? Can I directly control off-the-shelf hardware?

I'm looking to get a couple of remote controlled dimmer sockets for a quite specific use case (heat lamps in a tortoise enclosure), and I'd like to control them directly from a Raspberry Pi. I've found a couple of decent looking fairly generic options - examples from Trust and TKB - and there seem to be several appropriate radio modules, either USB or GPIO.

Detecting and pairing with devices seems (hopefully) straightforward. My sticking point is trying to figure out how standardised the actual messaging is; there seem to be several brands of hub and device that can be used interchangeably, but a few that can't. In my case, of course, the RasPi will be taking the position of the hub and speaking to the devices directly.

I'm having trouble finding reliable info on whether a command like "dim to 70%", or "read output power" will be the same across all devices, whether it will follow some kind of standard but it may be one of several competing formats, or whether it's completely proprietary.

Any insight on how easy it is to programatically talk to these things would be very much appreciated!

7 comments

  1. [2]
    vord
    Link
    I don't know much about Zigbee, but I do know that parts of the Zwave specification are open source If you get a USB controller that is supported by Home Assistant or OpenZwave, you should be able...

    I don't know much about Zigbee, but I do know that parts of the Zwave specification are open source
    If you get a USB controller that is supported by Home Assistant or OpenZwave, you should be able to plug that into a Pi and control it programmatically...if not directly.
    I also have an engineer friend that reverse engineered some of the messaging and hand coded for a specific device, so if you've got an electronics background that may be an option as well.

    4 votes
    1. Greg
      Link Parent
      That OpenZwave link looks very helpful - there seems to be a list of devices and capabilities, so that should be a good jumping off point to find which models make use of the open spec. Thanks for...

      That OpenZwave link looks very helpful - there seems to be a list of devices and capabilities, so that should be a good jumping off point to find which models make use of the open spec. Thanks for that!

      2 votes
  2. [2]
    Comment deleted by author
    Link
    1. Greg
      Link Parent
      Good to know, thank you! I'm getting the impression that the formalism of ZWave might be helpful in my case to ensure things consistently do what I'm expecting them to.

      Good to know, thank you! I'm getting the impression that the formalism of ZWave might be helpful in my case to ensure things consistently do what I'm expecting them to.

      1 vote
  3. [3]
    spit-evil-olive-tips
    Link
    I recently set up Home Assistant plus a handful of Z-Wave devices and I'd recommend it highly. Their support for Z-Wave is full-featured, and they have a REST API for whatever external control you...

    I recently set up Home Assistant plus a handful of Z-Wave devices and I'd recommend it highly. Their support for Z-Wave is full-featured, and they have a REST API for whatever external control you want to do. Just from reading the debug output of the HA Z-Wave module, Z-Wave doesn't seem like a fun protocol to try to interact with directly.

    You can also do some really nifty stuff, for example I have a Z-Wave temperature sensor, I enabled the InfluxDB integration with a few lines in the config file, and now I've got a Grafana dashboard showing the measured temperature over time.

    4 votes
    1. guywithhair
      Link Parent
      InfluxDB is great! I'm on a team using it for some sensors out on a preserve doing environmental sensing, and it's really interesting how all the patterns change over weeks and months!

      InfluxDB is great! I'm on a team using it for some sensors out on a preserve doing environmental sensing, and it's really interesting how all the patterns change over weeks and months!

      2 votes
    2. Greg
      Link Parent
      Excellent, this all seems to be coming together very nicely! I'd initially thought it was mostly a user facing UI, but it looks like Home Assistant ties in as a very solid piece of middleware...

      Excellent, this all seems to be coming together very nicely! I'd initially thought it was mostly a user facing UI, but it looks like Home Assistant ties in as a very solid piece of middleware between disparate hardware and the actual control commands.

      I'd also been somewhat concerned about how a lot of the device capabilities were laid out in the OpenZwave GitHub, but if I'm reading the Home Assistant docs correctly it looks as though the devices' base functions are self describing, so only additional functionality is explicitly documented.

      1 vote
  4. Greg
    Link
    A side note, and a small rant: why must special-purpose devices so often be so poorly made‽ I currently have what is considered to be one of the top of the range temperature controllers. It costs...

    A side note, and a small rant: why must special-purpose devices so often be so poorly made‽

    I currently have what is considered to be one of the top of the range temperature controllers. It costs £130. It has one dimming output and an on/off output, an unreliable resistive touchscreen, buggy software that lags for seconds at a time and regularly forgets its own settings, no way to synchronise multiple units, no way to log >24 hours of data or export anything at all, and no external connectivity that would allow a computer to handle all of this.

    For context, a mains voltage PWM dimmer costs £5 individually, and much less in bulk. A RasPi Zero W or equivalent costs around £10. They could have had an extensible, optionally networked device with four dimming outputs and enough horsepower to run even a full desktop OS (not that it should be doing so in this situation) without appreciably changing the price.

    The only reason I'm going wireless is that I'm over-cautious when it comes to mains voltage and I'd rather work with sealed units than my own soldering. Even then, the overall spend will be similar to a single off the shelf unit for something drastically more capable and totally expandable.

    I quite enjoy doing things myself, I'm just frustrated that the professionals seem to have done half a job and called it good enough.

    2 votes