Making a driver for a WiFi device (or bribing someone to do it)

Hi Community,

I am still in my Hubitat infancy, so forgive me if this is a silly request. I've also made a lot of mistakes on my journey, as there isn't a lot of information on how to go about building a new installation from scratch as opposed to working with one single device at a time. But I suppose that's the subject of a different thread :slight_smile:

Here is the thing: I want to automate certain things with in-wall relays. And I haven't been able to find good solutions for doing that; most relays where I live are either too bulky, don't support the right standards, or aren't fitting my needs (strong enough).

Now I stumbled over a polish company called blebox. They have a bunch of nice products (on paper at least), so I purchased a switchboxd to test it out. So far so good. App and specs are as advertised.

I selected products from this company because, while a lot of the homepage is only in Polish, they do nice things like publishing the API specifications online - which is more than I can say about a gazillion other devices out there.

Hubitat also has a lot of documentation. Awesome. But I am missing a sort of "making your first driver" page. Or "making your first wifi device driver" page. Or perhaps even a page where I can bribe community members (with a box of chocolate ... or bunch of Zigbee in-wall relays to do the work on... and keep when done).

Where do I go from here?

You can search for some drivers to use as examples. A lot of it really depends on how complicated the API is though. For example, I have a BUNCH of API drivers now for everything from Cloud API weather stations, Local to network aquarium controllers, the Blink API, and most recently working on my local network Unifi API.

You can take a look at a couple of those drivers to get a basic idea. Otherwise, asking like this is also a good way to get people that might be able to make one for you interested. I have made a couple drivers for other APIs that I do not personally have devices for (as an example).

My recommendation is that if you are interested in learning, look at some examples to create your own because it can come in handy as you add more to your system over time. If you decide not to, let me know and I will try to help make a driver for you.

Their API does not look too bad at all.

2 Likes

I'd say "all of the above".

  1. I'd suggest spelling out exactly what you are looking for, and posting about it in Developers to see if your 'bribe' could convince anyone to take up your cause or point you to a similar app/driver out there you could easily modify. I'd error on spelling out what you know (e.g. I would like to be able to trigger this exact API call, etc.)

  2. I'd also look at the sample apps and drivers out there to get a sense of what you could do.

  3. If your device has pretty straightforward Rest APIs and all you need to do is push commands to it, you could easily write an app, RM rule or even use the awesome Momentary HTTP Switch (instructions) to do this. For example, I use this to have Alexa Routines and some automations in Hubitat call rest APIs when the switch is pushed and includes a JSON payload for the command. Looking at the API, this might be your first starting point to get a sense of what you want to do with simple switches.

Lot's of options.

1 Like

This also may help you get started....

1 Like

Hey @SplatMan, welcome.

I'm wrapping up my current project and would be potentially interested in helping out. What is the minimum set of hardware to have meaningful functionality for what you're trying to do? Maybe we could develop it together as a way of ramping your knowledge up on development for Hubitat.

1 Like

There are a couple of US-based distributors:


They look like cool little products. It's a little bit unfortunate that they each have a separate API, but the documentation is good and none of them are very complicated.

They also look a lot like Shelly devices, many of which are already supported by built-in Hubitat drivers. Have you looked at any of those to see if they might meet your needs?

EDIT: just noticed that @djgutheinz has shared some bleBox code. Check it out: bleBox Device Integration. And note that it appears to be supported by Hubitat Package Manager.

1 Like

You're awesome @tomw, I'll check it out and see how far I can get.

The first project is to have the dual-relay boxes control a bathroom fan and a towel warmer in each bathroom. There is only one wall box, so I prefer to use a dual-relay unit if possible since this eliminates the need for making holes in the ceramic tiles for more wall boxes.

There is a Zigbee moisture sensor in the room. I want to start the fan whenever moisture levels are above a certain threshold (and turn off when its below another). I also want to mount a Zigbee (or z-Wave) button that allows me to turn on the towel heater for 30 minutes, then shut it off again. Both bathrooms will have identical installations.

I have Hubitat and Zigbee repeaters, but I discovered too late that WiFi devices are a bit of a pain to work with (along with other stupid n00b errors, but as mentioned the "start from nothing guide" doesn't exist).

I use a pfSense appliance for all my networks, so I can easily control DHCP assigned IP addresses to the WiFi devices (thereby keeping them static so they never change over time). The MAC is not listed on the device (my only grievance with them so far) but I can see them in my address pool and just re-assign.

What do you use for this? It sounds amazing.

Nothing fancy. It's a simpel thing, like this one:

Warming the towel immediately after a bath makes it dry faster. This reduces the amount of bacteria growth in it, which increases hygiene but also saves a bit on the environment because the towel can be used longer before washing is needed. The heat is not wasted because we mostly use this during winter.

I wouldn't exactly call it "high tech" though. :slight_smile:

1 Like

@tomw and @SoundersDude I am sad that I can't mark both your posts as "answers". They were both very helpful. Tom for providing a link directly to the blebox code, and sounders for pointing me in the direction of the proper place to get started.

2 Likes

If the WiFi device is IFTTT, Alexa, WebHooks or other 3rd party integration is possible, you can use a Universal Virtual Switch uDTH to be able control it and maintain status in Hubitat.

Download the Hubitat app