Which virtual device type for alexa?

I think I’m having a device type problem.
I haven’t found one yet that will trigger an Alexa routine.
I have been trying for days.

A motion sensor in HE
A virtual device in HE with type “Virtual Contact Sensor”
An HE rule toggles the Virtual Contact Sensor with the motion.
It works every time.
Alexa discovered the Virtual Contact Sensor just fine.
It toggles open and closed from HE to Alexa every time.
I lift my motion on HE and the Virtual Sensor over on Alexa toggles every time
Put this virtual sensor into an Alexa routine and nothing.

What is the right device type to use?

ST keeps whispering to me… you should come back… they smell funny.

Try this one:

https://raw.githubusercontent.com/stephack/Hubitat/master/drivers/Virtual%20Contact%20Sensor%20with%20Switch.groovy

As far as I know only a contact sensor will trigger a routine in Alexa...I use virtual contact sensors to trigger routines in Alexa and they work well to control home automation systems that aren't supported in HE. I use this method to replace IFTTT now they are charging....I did have to name them something like "Amazon - Lounge Contact" if I didn't put contact in the name Alexa would not add it as a contact sensor.

Hope this helps.

Also a Virtual Motion switch in this thread

Contact Sensors and Motion Sensors can trigger Alexa Routines.

1 Like

Thanks for responding :slightly_smiling_face:

I just got Stephan Hackett's drivers code and made this;

Then updated my rule;
Screenshot from 2020-10-29 16-58-26

Updated App/Amazon Echo Skill then discovered with Alexa.
This is it responding when I wave at my motion sensor on Hubitat.

This is my routine on Alexa,

but it doesn't run
Can you see anything wrong?

I still have a bunch of these routines running on ST and they work somehow.
maybe there is something wrong at Amazon... I dunno.

if anyone has an idea.. please do tell :slight_smile:
thanks

I once had an issue early on in the Hubitat days, when their Alexa Skill was changing frequently with each Hubitat firmware release. At one point in time, I had to start over because I could not get ALexa Routines to trigger, just like you're experiencing.

Here is what I did

  1. Disable the Hubitat Skill in the Alexa App on your mobile phone
  2. Delete any leftover Hubitat "Smart Home" devices via alexa.amazon.com
  3. On the Hubitat hub, remove the "Amazon Echo Skill" app (you should not be using the deprecated "Amazon Echo App" app, as that is only for countries that do not yet support the newer skill)
  4. In the Alexa App on your mobile phone, enable the Hubitat Skill
    a) Log into the Hubitat Portal to select your Hub
    b) Select the devices you want shared to Alexa

That should get things working again, hopefully.

Quick question - What country are you in? I am not sure if all features work in all countries or not.

Hope this helps.

3 Likes

I'm US east coast.
You know... over the last few days as I have been searching and googling this problem... I did see where someone commented that he had to go back to the beginning and start over. That was an ugly thought and I kinda made a face and moved on. but it seems like it really isn't working as it should.
ok.. gonna do the start over dance.. thanks a bunch and I'll post back later on how it goes :slight_smile:

Before scorching the earth .. is that "Huibitat ST Motion active [sic]" not already a motion sensor? If so, there's no need for a virtual switch at all. Just surface that sensor to Alexa and trigger your routine on that.

Side note having nothing to do with your issue .. you are using Say in the routine. You might find Messaging/Announce more flexible.

1 Like

I've tried using a virtual motion sensor in Alexa and it didn't work. I got around this by sending a virtual switch to Alexa, then in HE activating a virtual motion sensor when the virtual switch is enabled

1 Like

I followed the steps you listed... and everything just started working... just like that.
and it works without the virtual device at all... I saw the other post below and the virtual really wasn't needed after all. just plugged in the motion directly and now it works.
so the skill was somehow disconnected.

It's kinda remarkable really. a total non-event after days of hunting and reading.

it would have been better with the loony toons theme song :slight_smile:

thank you.. you made my day

3 Likes

it does work perfectly now... which is good since I have so many of them :slight_smile:

thanks

2 Likes

Has anyone using this "contact trick" to trigger Alexa routines found that you need to introduce a Delay on the Hubitat side (i.e. "Open Contact" ... "Delay __ seconds" ... "Close Contact")?

Reason I ask is that a Routine that had been working fine seems to have stopped firing, and I wonder if it's because I close the virtual contact after only 1 second. Could that be too quickly for Alexa?

Gonna test this theory tonight (it's part of my "Lights Out" routine, part of which only Alexa can do -- namely, turn off the screen of an Echo Spot -- literally no other method other than me audibly speaking the words "Alexa, turn off the screen" can manage).

Thoughts welcome.

You can see the state change in the Alexa app. If you don't see it change before 1 second, then there may be something slow on either your network or the Alexa cloud.

However, I did notice just now (since I'm not actively using virtual motion as switch or virtual contact as switch devices with Alexa for the time being), that it was around three seconds the first time it triggered, but only a one second delay each subsequent time. Perhaps a caching on their cloud that is thrown out when the device isn't used for a very long time, or reactivated as I just did.

1 Like

I have Alexa turn off the virtual contact with switch.

2 Likes

i tested it like last year to help me integrate more with Alexa, and it worked. i created a virtual switch, when i turned it on it opens the contact. then in Alexa, i have the contact opening be a trigger for something (in my test, i had her tell a joke)

while it did work, i found i wasn't doing much with it in Alexa that i couldn't do in Hubitat, so just scrapped the idea

1 Like

Are contact and motion sensors still the only device triggers for Alexa Routines in 2022-09?

Where are the Alexa Routine compatible device types documented?

Contact sensors, Motion sensors, and Lock devices are the three device types that I know of that can be used to trigger an Alexa Routine. This is an Amazon decision, as far as I am aware.

1 Like

I didn't ask my original question correctly.

I was attempting to understand which device types can integrate with Alexa and trigger Hubitat Rules.

I believe @ogiewon answered my question correctly but if you're aware of other ways to trigger Hubitat Rules via Alexa utterances, please share.

1 Like

Wait, you want to trigger a Hubitat Rule? Then simply add a Virtual Switch device to Hubitat, configure it to automatically turn off after 2s, share that with Alexa. Then use that virtual switch as a trigger to whatever Hubitat Rule you'd like.

1 Like