Controlling Unsupported Devices on Hubitat via Homeassistant with Apple HomeKit Controller

I recently managed to get unsupported devices on Hubitat to work by connecting through Homeassistant (utilizing HA’s HomeKit Controller.) The end goal was to simply get Amazon Echo/Alexa to voice control their operations. I’m providing my steps below in case anyone else is in a similar situation.

This will probably work similarly with Google Home/Hub devices too, but I went with Homekit instead.

Background:
One of my products (Velux with Netatmo Skylights) is uncommon* but is HomeKit and Google Home integrated/supported. Problem is that my house was initially set up with Alexa/Echo devices in every room. Velux said at one point that they would roll out Echo/Alexa support but they never did.

Now, for voice control I could just directly use HA and subscribe to the cloud services for an additional cost, but money adds up. There’s also a AWS method for free, but I thought there’s likely a way to use Hubitat to talk to Alexa/Echo via a HA integration. Turns out there is.

Here are my Homeassistant steps:

  1. Install Homeassistant. I just detailed how I installed Homeassistant on a QNAP NAS here. It’s probably very similar to a Synology install and also other virtual machine options.
  2. On an Apple device, you should have the ability to use it as a HomeKit Hub. In my case, I only have iPads. My wife often doesn’t use hers and it’s always charged so I went into her \Settings\Home\ Use as a HomeKit Hub.
  3. In HA \Settings\Devices and Services\ add Integration and choose Apple HomeKit Controller. Note that the Controller is different than the other plain HomeKit option. Configure. You may also have to restart HA.
  4. IMPORTANT NEXT STEP: I wasn’t able to see the devices in HA’s Homekit Controller until I actually removed them in the Apple HomeKit (on the iPad) completely. Then reload HA.
  5. Test the operations of your newly imported device in HA to make sure they’re working.

Here are my Hubitat steps:

  1. Next, I wanted to import devices from HA into HE. There are a few options, but it turned out most didn’t work for my particular devices but may work for you.
  2. Option 1 (works for some things): HADB - Home Assistant Device Bridge. I installed this using Hubitat Package Manager (easy way.) I won’t go into setup here. In my case, HADB saw all the devices I wanted to import, but in HE Devices only some of the VELUX Temp and Humidity devices showed up. But actual controlling my skylights was not possible AFAIK. *Note: HADB needs those devices you want to integrate to be activated first in HA in order to display.
  3. Option 2 (works for some things): Homebridge V2.0. Easiest install is through Hubitat Package Manager. Again, this unfortunately did not pull in the specific devices I wanted to control (my skylights.)
  4. Option 3 (WORKING): add the built-in HE App Maker API. Allow control and Ignore SSL Certificates. You will add Virtual Devices later that we will import back into HA later. Note the digits after the /api/ string in the bottom section for later. Also be prepared to copy the access token number in the bottom string too.
  5. Option 3 continued: Under HE Devices, add a device and make sure it’s virtual. In my case I found that Virtual Switch worked best for skylight blinds and opening/closing. Give it a name. I appended HE to it so I could easily spot it back in HA. I wasn’t able to get other virtual methods to work. There may be other virtual options which would allow for partial opening and closing increments but I was low on spare time to try them all.
  6. Option 3 continued: back to HE Apps\Maker API, now select the virtual devices you just created and we’re going to import them into Homeassistant.

Setting up Homeassistant to import Hubitat devices:

  1. Back in HA, we will add the Hubitat integration via HACS\Explore and Download Repositories\Hubitat.
  2. In HA \Settings\Devices and Services\ add Integration and choose Hubitat. You will need to enter the Strings copied from HE MakerAPI now (from step 4 above.) Now you should be able to see the HE devices populate into HA. Keep in mind, you may have to reload the HA Hubitat integrations regularly. You also may have to restart HA when first installing the integration in order to see everything.

Setting Up Homeassistant to activate Hubitat Virtual Switches (allowing Hubitat to control devices within Homeassistant):

  1. Now you’ll want to create “Automations”within HA. This will allow a virtual device being controlled by Hubitat to send a signal to Homeassistant which will then operate the Homekit Integration device(s) we initially set up.

  2. Automations in HA are found under: \Settings\Automations and Scenes\Create Automation.

  3. My example automation:


    First trigger is the imported virtual switch from HE.
    Bottom Action is the imported Homekit device in HA.
    Please note: I don’t know if it needs to run in parallel. All I know is that it’s working for now. Feel free to experiment on your own.

  4. Repeat these steps for all the virtual switches and separate functions. I had one skylight for example, but I added separate open/close automations for the blind AND window opening for a total of 4. Maybe there’s an easier way, but for now this worked for me and I’m done.

Amazon Alexa/Echo integration:

  1. back in hubitat, I already had the Amazon Echo App installed. Selected the new Virtual Switches in that and had it sync back up to Alexa where they were discovered (as lightbulbs incidentally…)
  2. Now I renamed the devices in Alexa to be simpler, and can control them accordingly (using on off commands.) Open and close might work as well (haven’t tested it yet.) I could always add a custom Alexa Routine with it’s own command that opens and closes depending on what I want to say.

Congratulations.

As a side note about these skylights in case anyone is interested, when we bought this house we needed a new roof and the skylights had to be replaced because they were leaking. The Federal solar credits applied to these and brought down the price to cheaper than regular (non-smart) skylights.

3 Likes

You might also be interested in this integration written for Hubitat.

I think it’s cloud-based. Not sure if going through HomeKit gets you local integration.

Personally I would suggest linking Hubitat with HomeKit via either the Homebridge app you mention above, or there’s also a Homebridge method that uses the Maker API.

This method should work though, and perhaps would make the most sense when the user has several other devices that are all able to integrate with Home Assistant.

And you never know when Hubitat might add direct HomeKit support…

I spent time debugging with him. That doesn’t fully work with the skylights as it doesn’t allow you to open or close them.

It requires having to decompile code or intercept/hack an apk to obtain values. It does import the devices into he, but Velux security prevents you from directly operating them. It will provide temps, status, humidity and a few other items from the sensors. I probably could’ve figured it out, but honestly I also wanted to test Homeassistant for the first time and see what others were talking about.

However, that code you linked works with other Velux with Netatmo devices which I don’t own.

That code doesn’t go through Homekit.

I also tried Homebridge on HE (see section 2, step 3 above where i mentioned it) and it doesn’t work to import or control my skylights.

As for direct Homekit integration, I wouldn’t hold my breath. I’ve had these skylights for three years and wasn’t able to control them until I put a google home next to an Alexa dot and had them chatting with each other…

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.