Multi State Virtual Switch That Can Trigger Alexa Routines

Hi,

I can trigger Alexa Routines with my C8 Pro by using virtual contacts, but could do with multi state switches or any other multi state devices that can trigger routines. Any one know of any? I can use many virtual contacts to achieve what I want (ie multi states), but it would be neater to use 1 devices with multiple states.

Thanks

This depends on what Alexa can actually "trigger" an Alexa Routine on, but unless they (Amazon) added something recently, I don't think so. It's pretty basic.

1 Like

What @bertabcd1234 said. Also, does Hubitat support multi-state switches? From the documentation:

So, I'm a little curious how you plan to create a multi-state Hubitat switch to share with Alexa?

Blind, temperature sensor anything that has multiple states that could trigger an Alexa routine when set to a certain setting.

So you meant a device with multiple states, and not a switch with multiple states. Got it!

AFAICT, for now Alexa only seems to use devices with binary states as a trigger. Irrespective of the integration.

A few years ago, I used a virtual dimmer to get 4 states; 0-25, 26-50, 51-75, 76-100. If you have an OCD, you can add an action immediately after you move slider that will move it to 12.5, 37.5, 62.5 or 87.5. (I did it)

Based on which quarter of the scale I was on, it triggered a different action.

I don't use it anymore.

I think I've tried everything, and you just can't trigger off of virtual dimmer, temp sensors, volume controls, blinds or thermostats. Locks do have three states, if you want to use "jammed" as the third state.

I stopped using virtual devices for triggers, and I am now using Echo Speaks to trigger my routines, using the executeRoutineId command, using any echo device. You can get the id for a routine from Echo Speaks settings under Routine testing. In automations, you just use the custom command and put in the routine ID.

This is if you by chance have Echo Speaks installed, or want to try it. The voiceCmdAsText command is also pretty powerful for unique devices in Alexa, as you can just tell Alexa to do something using the device, by building a text string.

Also Voice Monkey is free, if you don't mind sending a web request to trigger a routine. Voice Monkey can also send a speak command to an Echo, like the Echo Speaks app does.

1 Like

Strange, I've never had Alexa offer me up a dimmer to use as a routine trigger. I do use a virtual dimmer going the other way, to have Alexa trigger something in Hubitat from a routine, so I can do stuff in Hubitat using voice commands from an Echo.

That's not what mine was doing. Depending on which state I move the dimmer to, the automation either called a routine in Alexa or it used the custom phrase option. I use node red instead of rule machine so I don't rely on Echo Speaks

Ah, thanks for clarifying. There are lots of ways to trigger routines, but Echo Speaks is there and it is a reliable method, so I use it instead of adding something else. My automations are all coded in Groovy, so it is easy to just add an echo device to my app in settings, and use the execute command directly when it is needed.

You mean something like this?

New to Hubitat having moved from Ezlo. Echo Speaks sounds interesting. I started installing and Heroku is asking for a credit card and seems to cost to run. I am struggling to understand how much it will cost me. Are you able to help with how much it will cost?

The alternative is to run the Echo Speaks server somewhere within your LAN. @jtp10181 has provided detailed instructions on how to do so:

I've always wondered why a multi state switch isn't available as a virtual device. There have been a few times over the last couple of years where I've had a need for something like that. My use would be a dashboard tile showing the current state - off, 1, 2, 3. Clicking the tile I'd change the value, that change cancelling the previous. Unlike a button, the state would be permanent until changed. When I've needed something like this I've had to use a virtual thermostat and set actions in rules when the 'temperature' is 1, 2, 3 etc.

The last time I needed to do that was for my cameras and I'm using a Hub Variable. When lux is 0 - 15 the HV is set to 0, when lux is 16 - 300 the HV is set to 1 and 301 and above sets the HV to 3. 0, 1, and 2 set the cameras modes to lowIllumination, custom and normal using node-red, altering the gain and exposure to suit.

Intereting, but still only provides 2 staes ie on or off.

So playing with Voice Monkey and trying to set up Echo speaks. I am following the instructions and it is Heroku that is proving my downfall. I press deploy in step 4 and I get a totally different screen to the instructions in step 5. It has sections about "Add this to a pipeline", "Deployment method" and "Deploy using Heroku Git". Any help much appreciated.

If you want to use Heroku and pay for it, you will need to follow these instructions: Echo Speaks - Heroku new deployment workarounds - #40 by jtp10181

I use Heroku, and have from the very beginning when I started using Echo Speaks. It's $5 a month. Several have set up a local option (RPi, docker, etc. - as noted above) and avoid a cloud option and the cost.

Ah ok. The Echo speaks seems a bit beyond me and the cost puts me off. I have Voice Monkey set up, but when I call the url from rule machine it changes the TTS from "The%20dishwasher%20will%20turn%20on%20tonight." to "Thenull20willnull20on%20tonight."
I have found a post that apparently solves the issue using a variable, but I really don't understand that. Any help?

You need to let the rule do the URL encoding for you. Like this:

Then you can use the coded variable in the url.