How do you get rule to trigger when ON or OFF is pressed and the device is already ON or OFF?

You can choose to do it however you want but you can't say it's less maintenance. If you are syncing the lights to Alexa anyway, the work is done. If you have to swap out a light, you sync it to Alexa and assign a room. If you do that with your implementation, you would have to do that and then add it to Mirror.me. So, your method has more steps. You can't say it's simpler or shorter if it has more steps involved.

Why would you have groups just to turn lights off? You realize that having a light in a group adds extra overhead to your hub even when you are not controlling the group, right? If you have the group set to indicate if any of the lights in it are on, the group subscribes to all of the devices in it. So, if any change, then the app has to handle it. This is unnecessary extra work the hub is going to do just so you can turn off the lights by a group rather than by a rule or letting Alexa do it. That will likely cause ALL your automations to run slower, including this one. And groups of groups? Why would you ever do such a thing? You should only create a group if you want all of the lights in that group to match each other all the time. Otherwise, if you're only using it to turn lights off, it's just a waste of hub resources.

You can choose to do it that way...but you can't argue that it is simpler or uses less resources or has less steps. It just doesn't.

Nobody is right or wrong here as nobody can quantify with empirical evidence what resources are used by the hub for each individual action. Therefore anyone’s argument of being right or wrong here is mood.

Do not get me wrong, I don’t say argumentation is flawed! It is not, it is just that we don’t know what the impact is therefore you can argue that his way uses anymore or resources than yours.

2 Likes

No...but if one thing has 1 action and another has that one plus four more, the second one ins going to use more resources. Period. In both cases you have the messages going out to all the lights. It's just a question of how many hops to get there. With Alexa it's one. Done. With the virtual switch and a group it is 4 or 5.

Alexa would be doing multiple calls for each device vs making one call and let the hub do things locally. We don’t know what each call takes therefore no one is correct, not me, not you....

1 Like

Complicated adjective

  1. consisting of many interconnecting parts or elements; intricate.

So, if one thing is more complicated than another, that means it has more parts right? And 5 is more than 1, right?

And then you have the group apps which have to spin up every time a light turn on or off to update themselves. How can you say that all that unnecessary message processing doesn't use resources? And in that case, when it doesn't actually do anything. At least the multiple Alexa calls are actually doing something. You'll have that group app (and the group of groups app, don't even get me started) spinning up all day long over and over and over again when it is doing nothing other that making sure the switch is on or off. That's completely wastes resources.

Take a look at the app properties page for your group app. See how many device subscriptions it has. That means that every time one of those devices broadcasts one of those events, the app spins up to process it.

I am out, this conversation had no benefit to anyone as it is pure speculation

3 Likes

Don't you have that backwards?

Suppose you have 5 lights you want to control as a group.

You say "Alexa, turn off the family room lights"

Alexa Group to control all 5 lights:
Alexa sends 5 off commands over the internet to your HE hub.
HE hub sends an off command to each light.

HE Virtual Dimmer
Alexa send 1 command to HE
HE hub sends an off command to each light.

If you put 5 lights into and Alexa Group

1 Like

If you configure a virtual dimmer to control a group of lights and one of those lights changes there is no effect on the Virtual Dimmer or any of the lights in the group.

Thank you @dan.t - I have just given up trying to accomplish this with a stateless on/off switch, but it didn't trigger as expected. Your switch just saved me from insanity!

1 Like

That makes 2 of us!

Daniel

Would you happen to know the Virtual Always Fan code would be or point me to the documentation where I could figure it out.

The Virtual Always Dimmer works to control a group of Fans but then Sharptools sees the Virtual Fan as a dimmer and I can use the Fan Tile.

Thanks Again.

Thanks for this virtual switch as well. I spent a good 2 hours trying to get the ST stateless virtual switch with no success. This works nicely. I should have known better and ask for help. It looks so early so you coders!

There is no official Hubitat driver to look up, I wrote these drivers..... Fan devices, especially virtual once are always a bit more tricky..... By definition, a Fan Controller only supports the "setSpeed" command. However, I know that there are difficulties with that when it get's shared with Alexa/Google Home and some people also need the setLevel command and/or on/off commands. So, my question is what do you actually need? I don't use Sharptools, what happens when you press on a Fan tile? Does it show you a selection of speeds to set?

SharpTools has a special tile for Fans. You can configure the tile to 1) cycling through the speeds 2) select a speed or 3) configure the tile for a specific speed.

The tile also shows the fan spinning when the fan is running.

1 Like

I realize this is an old topic, but I just found it and it saved me. I don't really see the point of the argument above, but @dan.t's method above definitely worked for me. Thank you!

2 Likes

There wasn’t much of a point. Since it’s so old, this thread should probably be closed.

@bobbyD

1 Like