3 state switch

I'm guessing this is simple and I'm just missing it.

I need a 3-state switch, ON, OFF, and anything else.

A virtual switch is 2-state. A virtual dimmer seems to behave with the issues I've run into with my dimmer drivers. When Alexa sends an ON...it goes back to the "anything in between" state, it doesn't become "ON/100." You can't say ON and it goes to 100.

Maybe there is a better way...but I want to be able to use a virtual device to "toggle" a set of lights. However, from ON to OFF alone doesn't work. I may say OFF 9 out of 10 times but want ON to work when I say it. The lights in this group could be any state prior to the rule running.

I haven't tried it yet, but I'm guessing I could just use a dimmer and IF statements matching a value anything greater than X instead of "ON." but just curious if there's anything virtual that works with Alexa where ON is ON...not last value?

I want to be able to set it say 50 in the rule after it runs and the trigger by saying ON or OFF via Alexa....match ON or OFF in the rule.

I'm trying to understand what you're asking for, without much success. I am really uncertain as to why you need a virtual switch to have more than ON and OFF states.

What does "However, from ON to OFF alone doesn't work" mean in the context of a virtual switch acting as a toggle on a set of lights?

Is the issue that controlling your virtual switch doesn't always control ALL of your real lights? If that's the case, it cannot be fixed by adding more states to your virtual switch. You will need to find out why your physical devices are not responding as anticipated.

1 Like

If a switch is already ON, even though I see an ON come in...in the log. I guess since the event engine doesn't see a change...going from ON to ON doesn't seem to trigger my rule.

The application is to turn on or off a group of lights that can be in any state when I issue the voice control....I don't want to use two different names to control 1 group ON/OFF.

If this is all you are after it can be accomplished with either custom driver code, or possibly Room Lighting / Rule Machine.

Zooz devices have this built in, you can set the default ON state to be 100% if you want.

That's not a state change, so it would not trigger anything. Tell Alexa to set to 100 if you want it at 100. Example "Alexa set the kitchen lights to 100", I use this often when cooking if the lights are dimmed.

1 Like

I think you could do this using Room Lighting with an Activator device.
Still not totally clear what you want to do, seem to be asking multiple different things all at once.

However if Alexa already thinks the activator is On, because the lights are all on, then telling it to turn ON, may get ignored by Alexa, not totally sure, would need to test. If Alexa does not pass it to HE there is not much else you can do.

You guys are awesome! Always there!

I'll look into the Room Lighting stuff. I get the 100 thing,... just would like everything to behave the same and not have to remember for each device type what to say.

Thanks!

My 300 series HS switches have a driver that can have them go to 100 if manual. My 200's do not. The interface between Alexa and Hubitat sends a "last" value for an ON is what an owner said a while back in reply about it. I may have misunderstood.

Yes Alexa sends "on" and not 100, unless you say 100. The best practice for a driver in HE the ON command would be sent to the device in such a way you are telling the device only turn on, and not setting a specific level. The device can decide what it does from there based on its settings / firmware. Some drivers will even force the prior "level" to the device but I avoid doing that in my code.

A custom driver could however give an option for force the on command to be a specific level. If this is something you really want to pursue having a custom driver with a few minor tweaks to the code might be the way to go.

Thanks for the time and quick responses.

I'll give a couple things a shot and see what works best. I know it's a "to each his own" kind of thing, but I wish there was a selectable option/switch for how Alexa responds to ON commands in the included app. I'm just a creature of habit I guess...and used to it working that way on a previous platform.

Again, you guys are awesome ...thanks for the recommendations!

I'll think a bit about the driver approach.

It would just be a lot simpler if Hubitat could differentiate/trigger on anything between 1 and 100 and ON when using Alexa without the user being forced to change what they say per device.

It can, with a driver that has that as a feature.
Although would not have to change what you say "per device"
"Set to 100" on Alexa, on any light will set it to max brightness.

Thanks...got that. Please don't get me wrong. I understand that obviously many people want a light to return to the same dim value, but it'd be nice to be able to trigger off the response on a virtual device that could be in any state. IE-If it received a new ON command to be considered a change.

Especially, if the current value was something like 50.

Might work with with a custom virtual device driver that forces the switch on event as a state change.

Thanks. I will start working on that as soon. I'm going to have to move on for a bit to get HVAC/AV/sprinklers/geofencing/and my recording studio set back up so that at least the main parts of those that I depend on are functional again.

I'm sure I'll get stuck again and you guys always help me out....thanks!

1 Like

If you use the activator device to turn on, make sure the activation settings are 100%, and set the "Activate Even if Already Activated" and maybe "Command devices On/Off irrespective of reported state (Force)" settings in room lighting, this should accomplish what he is looking for. It works with Google (I don't use Alexa). I can still change the settings manually at the switch. But, if I tell Google to turn on the {name of the activator device}, it turns on with the activation settings I have set in the table. (Make sure you name the activator device something OTHER than the physical switch you would control with manually)

Example

2 Likes

jtp & tray

Awesome! This is exactly what I needed! This completely solves Alexa not setting lights or virtual devices to 100 when saying ON when I want it to.

THANKS!!!

3 Likes

IMO all dimmer drivers should have a settable โ€˜onโ€™ - to a set percentage or the previous level. I put 75 watt equivalent fixtures wherever I can, but I donโ€™t want that to be the default. The system Lutron drivers all have this capability.

Agree. My Homeseer switches do as well. My problem was that the command that came back from Alexa was ON...which if it was anything but completely OFF would not trigger a change....so it cannot be used to trigger a rule.

To me ON means 100 (99). If you want any other level, you define that in a rule or in what you tell Alexa.

I now have a workaround so it's fine. But I do wish the Alexa control app had a behavior setting that could solve this issue in one easy built in "click." :upside_down_face:

To be fair, thatโ€™s an arbitrary and personal definition. Traditionally, for a dimmer, on is any state when the dimmer is not off.

3 Likes

Ok :slight_smile:

And OFF should always be "0". Anything else would be arbitrary.

That would solve my problem too. Traditionally, of course.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.