Multiple Device control with Alexa: Alexa or Hubitat?

My goodnight Alexa routine turns off several lights, turns on a couple of lights and turns off my tv. 2 minutes later it is to turn off the 2 lights it had turned on.

All of the lights are in the Hubitat Alexa app.

I’ve found the results to be very erratic. Sometimes some lights don’t turn off, or do so after a huge delay, or one or both of the ones that are to turn on either don’t come on, or do so after a huge delay. And sometimes one or both of them don’t then turn off. The TV always works as that is controlled between Alexa and Harmony directly and doesn’t involve the Hubitat at all.

I’ve tried introducing delays and playing around with the order of the commands, but it is still spotty. I’m guessing that perhaps Hubitat can’t handle the commands coming so quickly.

I’ve been wondering if I should create a room or a virtual button, or something like that, in Hubitat that would control all the devices, except the tv, and just have Alexa turn that on or off (or I might need 2 items, one for the lights that just turn off and one for the ones that turn on and then off).

So, 1). Would that make the process more reliable?
2) If, so, can someone please give me some tips on how best to set this up.

Thanks,

You can create a virtual switch in Hubitat and share it with Alexa. I called mine "Good Night Activator" & set it to auto-turn off 1 second later. Then, your Good Night routine on Alexa just turns that switch on. You can also just say "Turn on Good Night Activator".

Back to Hubitat, create a rule triggered by turning that virtual switch on that does all of the light switching you want including turning the lights off 2 minutes later. If there are a bunch of ZWave switches, it helps to add a 50-100ms delay between commands OR you can query a switch to determine if it is on and only send OFF command if switch is on.

2 Likes

This functionality can also be done easily with a scene if you group all the devices in there. Activation optimization and metering.

1 Like

I use Node Red for all of my automations and I forgot that was added to RM. :grinning:

I use webcore for most of my automations. A little overkill for someone who doesn't already use webcore.

My Goodnight rule runs as described as above.
This is the Rule

The trigger is a Virtual Switch that is enabled in the Alexa Skill.
Where (Off: Things to turn off at night) is a scene where most of the lights are controlled.
The Alexa Routine looks like this

When I tell Alexa Goodnight all she has to do is turn the Goodnight Virtual Switch to ON and that runs the rule in Hubitat.

2 Likes