Help with RM Rule Regarding Dimmers

Hi everyone - looking for ideas to how to make this work. Any help appreciated.

Here is the idea.

  • I have two virtual dimmers representing different volume levels. A "main" volume and a "music" volume. They are dimmers so I can control them on a dashboard or via google home.
  • I have a virtual switch for music on or off.
  • Then there is a third virtual dimmer, which is the active volume (determined by the above 2 bullets).

So when the music switch is on, changes to the music volume are mirrored to the active volume. Changes to the main volume are ignored.

If the music switch is off, changes to the main volume are mirrored to the active volume and changes to the music volume are ignored.

That's actually the easy part - I can build that using the track event dimmer in rule machine. What I can't figure out, is how to also trigger the action when the music switch is changed. So turning off the music switch makes the active volume equal the main volume and vice versa.

I tried evaluating and running the track dimmer rules on the switch change, but I think that fails because there is no event dimmer to track. I also can't find a way to directly set a dimmer to another without track event or to set it to a global variable. I can make the global variable equal to a dimmer, but not the other way around.

Maybe it is functionality that can be added to rule machine, but I want to make sure I'm not missing something before I request an enhancement.

@Cobra 's Speaker Central handles a TTS volume like this.

1 Like

@bravenel
Bruce - would you mind looking at the first post and see if it is possible to add an option to set one dimmer equal to another without track dim, or set a dimmer equal to a global variable?
In the meantime, I'll checkout speaker central.
Thank you!

This is supported in latest release, 3.0. Use %variable-name when setting the dimmer in Action. It will be filled in when the action runs.

You can also set a variable to a dimmer level. So just do those back to back...

Thanks Bruce! I had read about this in your rule machine post, but apparently forgot.

I did have a little trouble though. I believe the problem is the trigger I normally use for "if an attribute changes" doesn't seem to be working with Global Variables. I normally set a trigger for something like "dimmer level != -1" knowing that -1 is outside it's range and therefore it triggers on any change. Works well for devices, but apparently not for global variables.

Here is a rule that didn't work for me:

So I found another way to trigger it and now it is working. In the working example, I'm now triggering off the other rule that is setting the global variables.

Not sure if that is a bug or intended to work that way - but thanks for the help, it's now working!

Known bug with Variable in Trigger event. Fix is coming...

2 Likes

Could this also be implemented in custom commands and/or custom actions? Right now I have a lot of custom commands and corresponding RM rules for volume levels in increments of five. It could possibly be 1 action instead of 21 if the custom command could use a global variable.

Just to make sure I haven't messed something up:
I just tried creating a custom command for a command that should be a number using a string of %variable-name. It said the command succeeded (it didn't) and then said it saved the custom command, but it doesn't show in the list of saved commands. I'm hoping it just didn't save so that it isn't hanging out in the background causing issues.

I take that back - it shows, just in a new place in version 3.0. Instead of at the top of the list, it is in the list sorted by name.

You can't use GVs with Custom Commands, at least not now. You can use it with a string parameter in a Custom Action.

I'm going to look at extending the ability to set a Custom Action parameter for other GV types besides string.

1 Like

The next release after 2.0.9 is going to allow GVs to set any parameter of a Custom Action.

1 Like