Trigger Alexa Device from Hubitat

I have a number of Devices in Alexa that I can control via my Insteon hub. I would like to use Hubitat to turn on/off those devices.

When I set up the Alexa skill it does not find all the devices in my Alexa app.

Use case, I have a Zigbee motion sensor that I would like to trigger a light to turn on. I can turn on the light by saying "Alexa turn on entry way"

My goal is to trigger entry way with my Zigbee sensor

Have you installed the Amazon Echo Skill app in Hubitat? You need to do that and then within that app, authorize specific devices to be shared with Alexa. Next, discover devices on the Alexa side. You should then see sensors on the Alexa side that you can use it Alexa routines to control things that Alexa can control.

1 Like

Yes I have the Skill installed however it doesn't show all the devices that show up in Alexa. (i.e I have all my Insteon devices that Alexa controls)

FYI, Alexa doesn’t permit integrations where devices exposed to Alexa are exposed to third-party integrations.

Integrate your Insteon devices directly with Hubitat (if possible).

3 Likes

Yeah, you may be thinking the reverse of how you need to look at it. You can surface (most) devices from Hubitat to Alexa, not the other way around. However, in doing so, and in using tricks like virtual switches (combined with sensor for the Alexa side) you can accomplish bi-directional communication and control devices known to either from the other side.

Install Echo Speaks app. It is a bit of an involved one time process, but post that...it is pure bliss.
E.g. then, in your Rule, you can just call a custom action "voiceCmdAsText('voiceCmdAsText('') on Echo Kitchen') on Echo Kitchen"

So, the command will send whatever you would have otherwise said to Alexa. I use this, to make Hubitat say "turn off all lights" when I leave the house.

1 Like

I'll second the Echo Speaks app. Since it's functionally the same as actually speaking to Alexa, you can also use it to trigger Alexa Routines or specific Skils. I also use it to respond to questions with variables (something Alexa doesn't natively do) like which bathrooms are occupied or if I've left any doors open as I'm climbing into bed.

3 Likes

Expanding on this, @creativedata it sounds like what you want to do is;

  1. Expose your zigbee motion sensor from Habitat to Alexa
  2. In Alexa create a routine that turns on your Insteon light based on the zigbee motion

I don't want to hijack this thread so if need be we can take it outside this post. I am curious as to what you are doing and how this works. I do have the Alexa app installed and use Alexa to turn on/off devices, turn on/off rules, etc. I do not have Echo Speaks installed yet as I wasn't sure if what I would do with it so am curious what your implementation usage is using variables.

make a virtual switch in HE for what you wish to control in alexa
add that switch to alexa
then make a routine in alexa that states when your virtual switch turns on turn on the alexa device you wish to control

1 Like

Probably the primary use for me is part of a bedtime routine. "Alexa, good night" sets off a routine that turns off all the lights, ceiling fans, etc that might still be on, drops the temperature on the thermostat, arms my security system, and starts playing some white noise to sleep to. That's all handled within Alexa. But it also sends a web request to HE; that acts as a cloud point trigger and activates an RM Rule.

The Rule goes through and checks the status of all my door sensors and leak detectors. If the doors are closed and the leak detectors are dry, the Rule ends with nothing happening. If any of the doors are open, though, it activates the Echo Speaks in my bedroom to say %device% is still open; if any of the leak detectors are wet, it says %device% is still detecting water.

In theory, I would've been alerted to any of these events previously (which is why I include "still" in both statements) but it acts as a kind of failsafe for me to catch any potential issues before I go to sleep, in case I got distracted or accidentally dismissed a previous alert or anything.

1 Like

@creativedata
The way I do it is set up the routine in Alexa then use my virtual switch to contact sensor in HE. I then use alexa to monitor that sensor. So he activates the switch which changes the status of the sensor to open or close as I want and that sets off alexa to do it's routine. So you would set up alexa
to do whatever with your insteon device and then he to control the trigger

Put this in your drivers code and and create the driver

metadata {
definition (name: "Virtual contact with Switch", namespace: "cwilson08", author: "cwwilson08") {
capability "Sensor"
capability "Contact Sensor"
capability "Switch"
}
}

def on() {
sendEvent(name: "contact", value: "closed")
sendEvent(name: "switch", value: "on")
}

def off() {
sendEvent(name: "contact", value: "open")
sendEvent(name: "switch", value: "off")
}

def installed() {
}

2 Likes

I like that idea with the Echo Speaks and %device%. I had been considering adding some kind of check to my sleep routine as well and this would make it a bit more descriptive. Nice idea.

1 Like

I recalled another use case that I don't use as often: finding out where my wife is in the house so I don't have to wander around shouting for her.

I've got a rule that checks a variety of sensors around the house to determine my wife's (probable) location. If the pressure sensor under the mattress is activated, she's in bed; if the motion sensor in the master bathroom is active, she's there; if a power monitoring plug is spiking, she's using whatever device is plugged into it, etc... When H.E. knows where she is, Echo Speaks announces to me her location, and then I know where she is and possibly whether it's even worth my getting up to find and talk to her. (I don't know about you, but I'm usually not keen on having extended conversations through a bathroom door!)

It's not 100% but I've written the rule to prioritize some elements over others. The pressure mat in the bed takes precedence over all of the motion sensors, for example, since the dog can trigger the motion sensors but isn't heavy enough to register as being on the bed. And obviously any sensors that are active in the same room I'm in (determined by which device I use to trigger the rule) are ignored.

The rule doesn't get into using the %device% variable much, but the logic involved (lots of ELSE-IFs) is far more than can be handled within Alexa Routines.

Crap!

You just integrate it using virtual switches

I did. Thanks

1 Like