Control Hubitat using Alexa

I am slowly moving my smart home over to Hubitat, and I was curious: what is the best way to trigger automations in Hubitat using Alexa voice? Currently I am using virtual locks and when I speak to the Alexa, the Alexa routine triggers the lock which triggers the Hubitat rule. Any better solutions?

Most users simply use a Virtual Switch on Hubitat, that is then passed over to Alexa.

The built-in Virtual Switch driver includes a user preference to automatically turn off the switch. This makes sure the switch is ready to be used by Alexa again without having to worry about turning it back off.

1 Like

I use a virtual dimmer. That is like having 98 virtual switches/locks, etc all in one device.

The Alexa routine sets the virtual dimmer to a level for an action. On the Hubitat side, you use rules or whatever to react to the level change event when the dimmer changes to a certain level. I use custom apps so the subscription to the dimmer is coded into my apps to run a method based on the level change, but Rule Machine or Webcore can also trigger off the level change, same a virtual lock or switch changing states.

Just something like:
If alexa dimmer changes to 15%, do X

The driver I am using then returns the level to "99" which is my idle code. I use dim levels 1-98 for actions on the Hubitat side. I return it to 99 so the next event will trigger, even if it is using the same dimmer code again.

This is the driver I am using for the virtual dimmer:

1 Like

When I was initially setting things up I tried a switch and it didn't work. It seems to be working now though. That makes things a little less complicated since the switch has an auto off. I have been creating that for the locks lol

This is a good idea. I might have to give it a go.

Do note that we are specifically talking about triggering something in Hubitat from Alexa.

You can also trigger an Alexa routine from Hubitat, but the mechanism is different. Many threads here other than this one are talking about that scenario instead.

1 Like

Okay dumb question, but how exactly do the drivers work? I went ahead and installed the one you attached and I see that I have in now, but where do I go from there?

It is just a virtual dimmer driver, so add a new virtual device and choose that driver. In preferences, you choose what level to use for idle, and how long before it returns. I use 3 seconds.

Then share it with Alexa, and use it in routines to set a level for an action that will trigger on the Hubitat side for that level change.

Yes, many methods for that. I use the Echo Speaks runRoutineID(). Voice Monkey can also be used, as well as virtual locks, contact sensors, and motions sensors.

That is so cool. That gives me a new project when I catch up with every thing else going on. Thanks for the idea.