RM Capture and Restore Switches

@bravenel, is there a way to capture specific attributes of a switch rather than the whole shebang.
I have a Rule that I use to reset the color temperatures of all my color bulbs in the house. Works great on my Lifx bulbs but my Hue bulbs turn on when the temp request is received. The plan is to have the following:

Capture on/off state of switches
Apply Color Temp settings
Restore on/off state

This way any bulbs that were off when the command was sent, would turn off after they were applied.

This is what I'm using now, but of course if the bulb was off and the color was red...it would turn on, set the color temp to 3600 and then restore it to red before shutting off.

I'll take a look at it. This sort of feature can get really messy when generalized as you suggest.

Understood. Do you have any suggestions on how to accomplish this using RM in it's current state?

How about this:

Condition: Switch on
Rule: Switch on
Action for true: set color temp
Action for false: set color temp, turn off after short delay (millis? long enough to be sure temp is set)

If it's already on, all you are doing is setting color temp. If it's off, you set color temp and then turn it off. You'd need a short delay so that it doesn't run the off() command until after the color temp command. Might have to play with that timing, depending on how fast the switch actually does its thing.

I actually don't want it to do this every time I turn the light on. Only when I explicitly request it (or in one case when it is called by another rule based on a certain set of circumstances).

Then use a triggered rule, triggered by whatever you want. Same rule as above, just put a trigger in front of it.

Ahhh..I was reading your example as a triggered rule (ie when Switch changes to on).

I'll give it a shot...seems like I was overthinking this as usual.

I created a rule but it is only able to evaluate any or all on. So let's say Bulb A is on and Bulb B is off....in this case (whether evaluating Any or All) corresponding T/F action will be applied to both bulbs..correct?

I need Bulb A to set color temp
And Bulb B to set temp and turn off after the delay.

I have a set of Hue color bulbs. I have one switch to red when the laundry is done. And then it's supposed to go back to the previous captured color/level after 1 minute. But it doesn't. It goes to a different color instead. Not sure if this is a user or Hubitat issue.

See if you can figure out a way to add a one sec. delay to the bulb action. I remember having a similar situation. I believe the capture was executing just after the color/level action had started. Iā€™d post an example rule, but unfortunately Iā€™m not home.

I added a delay (I had to set up a separate action called from the main trigger to add the delay).

In watching the attributes change, it looks like the capture/restore doesn't set the Hue colorMode properly - it always sets an RGB value even if the previous setting was CT. I think this is likely a bug.

But there is another colorMode issue too. I'm going to make a separate post.

1 Like

Yes, we have seen this. I will look into it. When it captures the bulb it is not catching that the bulb is in CT mode vs RGB mode.

2 Likes