RM PIPE DREAM or No?

Hi. New to Hubitat - trying to get the most out of it. This may not be possible but figured I'd ask. I have a ROUTINE in Alexa that TURNS off my TVs and lights in my man cave...(nothing to do with Hubitat but bear with me). At night, when i am going down the hallway from the man cave to head upstairs it's completely dark. I have smart lights in that hallway heading upstairs. Those lights will come up once i hit the 1st stair as I walk up, but that's takes a minute walking through the dark. Here's what I would like to happen....I voice command and turn off the lights - either that's the trigger OR something else, turn on the hallways lights for 5 min, then turn them off. Thoughts?

I do something very similar. I say “Alexa, goodnight” which turns off all of the lights downstairs, locks the doors, AND runs a Rule in Hubitat. That rule turns on hallway/stairway lighting for a few minutes at a dim level.

Here is the Virtual Switch that I use in the Alexa Routine to trigger my RM Rule. Note that I have enabled the automatic off feature, to make sure this switch is ready for the next time Alexa runs the routine.

And here is the rule

2 Likes

Oh wow, let me look at this, I'm supposed to be working but last night i tripped over something in the hallway and now i have to resolve this!!! Thanks so much! I'm new to this world so I'm sure I'll have questions for you.

1 Like

So at first glance - i didn't realize i could make virtual switches in Alexa. How did you do that? I already have the Alexa routine setup, is there something I do within Hubitat? I see the VIRTUAL DEVICE in there but not clear on setting up the virtual switch part.

In Hubitat, go to Devices, Click Add Virtual Device, give it a name, select “Virtual Switch” as the device type (driver). Then, set the automatic off feature to 1s. Click save.

Then, in the Amazon Echo Skill app on your Hubitat hub, add this new virtual switch device so Alexa can “see” it. You can then “turn on” this virtual switch as part of an Alexa Routine.

Thanks, that was super easy. So does the Virtual Device name imported into Alexa match the name of the Alexa routine you already had?

Not sure what you mean. You can name the virtual switch any name you’d like. Once it is exposed to Alexa via the Skill, it will show up in Alexa under smart home Devices. So, inside the Alexa Routine (any name you want), simple add an action to Turn On the Hubitat Virtual Switch.

This will then trigger RM to run whatever actions you decide you want. The advantage of this design is you can tweak the RM rule to do anything you’d like, without changing the Alexa Routine.

OHHHHHHHHH, sorry I'm an idiot. GOT IT! Doing it now.

I just realized this can solve a few other issues for me with Alexa routines!!!!!

1 Like

What does the 1s DELAY do? Keep the lights on for 1 sec? I want to have them on just a 1 min or 2 to give me time to walk down the hallway. Where is that set up?

The 1s Automatic off inside the virtual switch just makes sure that the switch is in the correct state for the next time you run the Alexa Routine.

When it goes to “on”, it will a Trigger the RM a Rule. Inside the rule I posted above, you will see where I have a 1 minute delay before my lights go back off. You can make that delay anything you want.

You could also set the (virtual) switch to automatically turn off right in the Device settings w/o needing RuleMachine to do it. I'd think this was Hubitat's clever way over getting around "cannot expose a button to Alexa, only a switch"

Ummm, please read post number 2. I did explain exactly what you’ve shown, as well as an image of the same. :wink:

The RM delay is to turn off his lights, not the virtual switch.

Got it. I think I should be good, I'm about to test this puppy out then actually go back to my actual job work, lol.

1 Like

Sorry, my eyes jumped right to your rule... i'm always fascinated by other people's rules to give me ideas

Apologies!

1 Like

Have fun! The basic building blocks you’ve learned today should help with many things in the future.

If you want Hubitat to trigger an Alexa Routine, that is possible as well. But, we need to use a different type of virtual device to do so. Only Contact and Motion sensors can trigger an Alexa Routine from Hubitat. Some user use virtual contact sensors to make Alexa speak a phrase. I have Alexa announce that the Mail has been delivered using a contact sensor on my mailbox, for example. Physical or Virtual contact and motion sensors work.

Uploading: Screen Shot 2020-03-30 at 11.36.43 AM.png...
It didn't work....Nothing in the HE logs except that the mancave lights are turning off.

Am I missing something?

Yes, you forgot to enable the Automatic Off feature in the virtual switch.

Also, we need to see your RM Rule and Alexa Routine to really help troubleshoot further, please.

Here's the actual RM rule I created. It's pretty straight-forward. I turned on debugging so I'm looking at that but dont see anything, not even an error. i fixed the Enable Auto Off to 1s now.

1 Like