I am missing something, I have read multiple threads where individuals are now using their motion sensors or virtual switches status to trigger Alexa to speak a specified message from a routine. I can't for the life of me figure out how to make this happen.
I have updated the skill, I have virtual switches running in routines that turn on/off the switch that triggers rules etc... However, I want to be able to have an Alexa routine speak when motion is detected or certain virtual switch states change within HE.
Any assistance you can provided would be greatly appreciated.
It would be setup in the routines in the Alexa app. Motion and contact sensor support was added a little while ago. There have been reported issues with routines in the Alexa app the last few days. I have no idea of the specifics or if they even still exist.
Expose a motion sensor in the Alexa Skill and you should be able to just use it. For a switch to trigger, a regular virtual switch isn't supported by AWS. Only motion sensors and contact sensors are. So you need to use this simple custom code.
Copy this code from Chris Wilson @cwwilson08 and create a new virtual device using this driver. Then expose it to the Alexa Skill. It will mimic a motion sensor output when a switch is digitally turned on within HE
When I access the Alexa app on my phone, I choose "When this happens" from the routine creation I do not see my motion sensor, I have added it to the skill
Normally it will show up immediately. However you may need to do another device discovery to make them show up. If it's in your list of devices, it's available to the routine.
Works, thank you. I have been a complete fail at getting alexacookie.js to work for me on the pi. Manually renewing the cookie was getting tedious. No longer a need with this.
No doubt about that. But, there is a really simple fix for this issue. Simply restart AlexaCookie.js once a day. It doesn't even have to be reconfigured.
FWIW, I removed the line "runIn(12....)". That makes the Alexa routine easier. The switch in Hubitat starts motion which triggers one Alexa routine. Turning the switch off stops motion which triggers another routine. With that line, motion stops automatically in 12 seconds.
I created a virtual switch that triggers a virtual contact sensor to trigger a routine in Alexa β¦ I don't know why Amazon limits "SmartHome" triggers to motion and contact events.
Thanks β¦ I'll have to check it out. Still have about 30 devices to finish migrating (plus a few new ones to add!) Looks like Christmas is Cancelled and I'll be working on Rule Machine over the Holiday break to tweak everything!
Hi @markj - welcome to Hubitat. I probably wasn't clear in what I wrote. You don't control one with the other.
It's an alternative for the use case described by @Tim-in-Ca, who triggered an Alexa routine by using a virtual switch that changed the status of a virtual contact sensor (which triggered the routine). This single virtual device (virtual contact sensor with switch) can do both - meaning one would have to create a single virtual device on HE instead of two.
Whatβs cool about this is a switch and sensor both show up in Alexa. I have Simple Lighting rules which change the switch and an Alexa routine triggers on the sensor to control my WiFi outdoor lights. A switch also shows up under devices in Alexa if you want to use that.