Is there a way to Trigger a Rule when Device State doesn't change?

You could create a virtual switch, then use either a Dashboard tile, Alexa voice command, or a Z-Wave Central Scene (button push/etc. from a dimmer) to turn on that switch, then use that switch to trigger whatever automations you want. You could utilize the "automatic off" feature of that switch after a few seconds to turn it off automatically after it gets turned on, so it would functionally still act similar to a button and be able to get turned on again and trigger whatever rule you're doing. So, for example, every time button 1 on your Central Scene Dimmer is pushed or an On command is issued to that device, you could turn on the virtual switch. It would then be the trigger for...whatever it is that you are trying to do.

This may be a bit of extra work for you, so perhaps you could explain a specific scenario and what you want to happen, and someone may suggest other ideas.

Multi-taps are triggers in Rule Machine speak, not actions, but I'm assuming you were just using lay terms? Turn On is an action, not a trigger, but switch state changing or turning on or turning off could all be triggers that could result from an action somewhere else (but an "on" trigger won't usually fire unless the state is different than it was before, which is where the "secondary" virtual switch idea may work for you). Not trying to be picky, but just wanting to make sure you have the right things in the right spots. :slight_smile:

Can't use a Virtual Switch because RM will only trigger when the switch changes from On to Off or Off to On. I need RM to trigger when the switch is told to Turn On or Off. So even though RM will fire every time you push a Central Scene Switch Button 1 (ON), you can't check it switch to see if ON was pressed.

My assumption is that you would use the auto-off feature and use a different virtual switch for each automation, with auto-off enabled so successive "on"s are never a problem. But again, you might want to explain what you are trying to do in case there's a different approach you could take that would be less messy to set up.

Hubitat groups do not support the startChaningLevel and stopChangingLevel commands. So, you could not have ever done this.

No, RM cannot do double taps from a PIco because Picos don't support double tap.

Add the group device to your dashboard. If they are in a Hubitat group, they can be controlled by the group device they are part of.

In-wall dimmers control a load. They are not button controllers. That's why this won't work.

I do something similar to this with Inovelli switches. I turn off local control of the relay and only allow remote control. Now I use the button presses to control the lights.

In your case:

IF upButton pressed THEN
   turn on light 1
   turn on light 2
END if

In this scenario you aren't looking at the state of the switch or dimmer. Just reading the button presses.

Here is the issue that I'm trying to solve.

I want to use a Dimmer (Physical or Virtual) to control a group of Dimmers. We can use RM, Mirror, Hubitat Groups, Alexa Groups, Google Rooms etc. to accomplish this grouping in one form or another but these all suffer from the same issue.

For example, if your "master" Dimmer (Physical or Virtual) is ON and one or more of the "slave" Dimmers are OFF, you must first turn the master Dimmer OFF and then back ON again in order to get the slave Dimmers to come ON. Here is just one of many examples of where we see this.

You have a motion sensor that turn the lights off in the Family Room when there hasn't been any activity. You walk by the Family Room and see that two of the lights are ON so You say "Alexa, turn OFF the family room lights", nothing happens. So you try it again, nothing happens. So you say "Alexa, turn ON the Family Room Lights". This time the other lights come On so now all the lights in the Family Room are On. Now you say, "Alexa, turn Off the Family Room lights" and this time all the lights turn Off.

What's worse is trying to Dim a group of Lights. Lets say you want to Dim a group of lights to 25%. You see that one light is at 99% and another light is OFF. Problem is the "master" Device is already at 25% so the only way to get all the lights to 25% is to first move the master dimmer away from 25% and then back to 25%.

So how do we solve this.

  1. we use "stateless" device drivers. Basically every time the device receives a command it tells hubitat it's state changed. This is a good workaround but has some flaws one of which having to use custom device drivers.

  2. Another approach, the genesis of this question, would be to evaluate when a Dimmer (physical or virtual) receives an ON, OFF or DIM command.

Today I'm using option 1 "stateless" drivers with Virtual Dimmer, Switches and Fans and they work perfectly, totally eliminating the issue described above. I would like to extend the capability to some physical dimmers, switches and color bulbs but don't want to create customer device types for each of these.

Hope that makes sense.

This works great in many scenarios but 1) requires several dashboard button tiles to accomplish what one dimmer tile would accomplish and 2) doesn't work with Alexa or Google.

It is a single Inovelli switch. It is one control and would be one dashboard icon. You certainly can control it from Alexa.

This is the post I was referring to:

The rule could be as simple as:

You press the on button and both bulbs (or dimmers) get set to 100%. You press the off button and both bulbs get set to 0%. You can have as many dimmers, bulbs, groups, or switches in there as you want. Every time you press the on button it will set them all to 100% regardless of previous state.

The issue isnā€™t the actions itā€™s the trigger. Youā€™re triggering the rule here with a button, which may actually be a switch or dimmer with button capability. This works fine if youā€™re turning on the physical switch but if you want to control it from Alexa or Google it wonā€™t work and if you want to control it from dashboard you have to use a bunch of buttons.

FI donā€™t know why you say you need a bunch of button but where Echo falls down is triggering the event as I see the skill doesnā€™t support buttons.

No worries, hereā€™s another approach I just tested through the dimmer and Echo.

I donā€™t have any physical dimmers so I tested with a virtual one. Still would work the same way. May not be the most elegant but it works in a single rule. Instead of sending an on command you send a level = 99.

"Alexa, set a vDimmer to 99" sets the bulbs every time. No offs needed in between.

Of course you can add a routine in Alexa so that you donā€™t have to say 99 every time. "Alexa, turn on super dimmer" would set the device to 99.

You would set up any number of triggers you needed.

I appreciate the help on this so I want to be clear again about the issue. Itā€™s not with Alexa (just using that as an example) or with the Action part of RM. The problem is with the Trigger part of RM.

In the example you provided, what happens when the vDimmer is already dimmed to 99?

Ok, I see your full use case. There are several ways to solve this, depending on what kind of wall switch you want to use. (Or if you want to use one at all)

However, itā€™s early in the morning. Iā€™ll type up my answer after Iā€™ve had some coffee. But rest assured, you do not need custom drivers for all your devices.

Ok, can I ask a couple clarifying questions about your use case? Answers to each of these will help me choose the correct grouping mechanism for you.

  1. How many switches do you want to have grouped together?
  2. Do they all have physical smart wall switches? Or are some of them smart plugs?
  3. Is it important that they always be all synchronized together? Or do you need to be able to control them individually too?
  4. Is it important that there be a "master" switch? Or was that just a side-effect of using Mirror Me, and you don't really care about a single switch being the master?
  5. You have mentioned controlling everything via wall switch, via Alexa, and via HE Dashboards. Are there any other control mechanisms you'd like to use?

With answers to these 5 questions/requirements, I can list out about 6 different ways of implementing this, and how many of the requirements each implementation will satisfy.

And I showed you a trigger that works. I even went to the trouble of creating triggers and rules to test it. If that isnā€™t good enough then the solution is quite simple:

What you want to do canā€™t be done.

It should never be at 99 as the rule changes it to 100.

In any case you asked if it was possible. It isnā€™t elegant but it is possible.

There is one more solution:

IF (magic) THEN
      Something Something 
      Dark side
END IF
  1. How many switches do you want to have grouped together?

Varies depending on Room or Zone. I use grouping with Virtual Switches, Dimmers and Fans quite extensively. For Example, I have Virtual Dimmers called Family Room Lights, Patio Lights, Yard Lights, Hallway Lights, etc. I also have groups that group some Virtual Dimmers together, for example, First Floor Lights control Family Room Lights, Dining Room Lights and Kitchen Lights. I then use these groups with my other automations, dashboard, Alexa, etc.

All this works perfectly because I'm employing custom device types that always send a state change to the hub when a Turn On, Turn Of or Dim Level is received, regardless of whether the actual state of the Virtual Device changed.

So I want to employ a similar approach with some Physical Switches, Dimmers, Fans and even Color Lights. The workaround above works for 3 virtual device type but isn't feasible for a bunch of physical devices.

  1. Do they all have physical smart wall switches? Or are some of them smart plugs?

All the "masters" are Z-Wave Plus In-Wall Dimmers, Switches and Fan Controls.

  1. Is it important that they always be all synchronized together? Or do you need to be able to control them individually too?

Need to be able to control them separately.

  1. Is it important that there be a "master" switch? Or was that just a side-effect of using Mirror Me, and you don't really care about a single switch being the master?

I'm using the word "master" to describe one device having the ability to control one or more "slave" devices, but as asked above, the "slave" devices can be operated on their own, ie. not looking for a group of dimmers to always be in sync.

  1. You have mentioned controlling everything via wall switch, via Alexa, and via HE Dashboards. Are there any other control mechanisms you'd like to use?

Yes, I use the groups with my other automations. For example, I have an automation that turns off the patio lights when there hasn't been any motion. In this automation I simply use the "Patio Lights" Virtual Dimmer. I also use these groups with Alexa, rather than Alexa groups. I know some may disagree with this approach but it works great for me and allows for much easier management. For example, let's say I swap out the Patio Lamp for something different. I only have to go to one place not 10 to track down the places I've grouped the Patio Lamp.

FYI, what I'm asking, being able to trigger a rule on a command being received, not just when the state changes, is available in other HA platforms. Now obviously if a device doesn't have the capability to inform its hub when it received a command there is no getting around that, but most z-wave plus and zigbee devices will do just that.

Hope that help shed some light. Do appreciate the guidance.

Thanks, Glenn

@lairdknox I'm sorry if I offended, I appreciate the help you're providing.

Just one final comment on this topic and we can close it out.

I spent some time using OpenHAB where I was able to trigger rules on devices receiving commands. This was quite common in OpenHAB so I assumed it was something Hubitat could do and I just hadn't uncovered the right combination of Triggers.

In any case, here are 2 common Triggers used to fire rules.

Item <item> changed [from <state>] [to <state>]
Item <item> received command [<command>]

The first Trigger works just like the RM state change Trigger.
The second Trigger is what I was looking for in RM.

I've been told this doesn't exist in RM, which I now know and fully accept. I'm also being told there is no reason it should exist and what I'm asking is magic. This I'm not so sure I can agree with.

Once again, thank you to this fantastic community who advise, share, and help each other.