[How to] recreate Philips Hue Dimmer Switch functionality with RuleMachine

Hi Guys,

I thought I make an example rule to recreate the Hue Dimmer Switch functionality with RuleMachine.

Functions are:
-Turn on a scene
-Tap through multiple scenes (as many as you want)
-Turn on last scene (by pushing + or - while light is off)
-Dimm step wise +/-
-Dimm on button hold +/-
-Turn off

Important: You have to create a local Variable that counts the button pushes to tap through the scenes.
In my example it's called pushCounter.

Have fun.

Important note: this method does NOT work with groups. Only with individually selected bulbes.

Additional tip: You can set the first button press to "color temperature and level per Mode" to create a dynamic first scene.

9 Likes

Hi Mike,
I found a small bug you should know. In the rule above, the held and the release command don't work if I chose a group, but it does work when each bulb is selected individually. If you need more information, let me know.

edit: untagged mike

Startlevelchange and stoplevelchange are only supported commands for individual lights.

so, not a bug... just a technical limitation?

1 Like

Ideally it wouldn't allow you to choose grouped devices, but not really a bug, just not a supported command. Once you know you can't really do that, no more errors, but not ideal.

1 Like

You can do something like this with Advanced Button Controller and select scenes to cycle through.

yeah, but I prefer rule machine when ever possible. It's such a powerful tool.

2 Likes

I get it. You can also do this with RM using scenes instead of CT, which is what I did because it's faster than ABC and the lights I used are in a zigbee group. Still have to choose individual lights for dimming up and down unless you do +/- X%, then you can use the group device.

So is there a way to ask hubitat developers for the feature request to allow startlevelchange and stoplevel change for hue bulb groups. It works great with runlesswire switches. This would allow dimming of groups with newer switches, such as inovelli red series

1 Like

This has been requested a few times in the past and they haven't commented on whether it is in the plans.

K, thanks. Got your inovelli driver working. Works awesome for 3 hue bulbs. When you hit 4 bulbs chaos ensues. Just need hubitat to update the group dimming. Would be great

FYI, I recently released a custom Hue Bridge integration that supports startLevelChange and stopLevelChange on groups:

1 Like

Do you think could provide or point me in the direction on how to do the first part of that rule? Best I could do is create the local variable but can not seem to get it like you have.

Sure, where does it hang exactly?
I started with removing all the button functions I'm not useing. So it's not that confusing anymore.
I think you have oroblems with button no 1? right?

I actually think I just worked it out. Was not using the button device option and had a search around as the other thing that was hanging me up was how to get the ELSE-IF option, but also found that. Thanks though :slight_smile:

1 Like

Hi all, I'm new to Rule Machine, and can't seem to find where/how to base actions on my device button presses.

I set OR triggers for each button press (1-4), but then for actions, I want to define these for each button. Can't seem to navigate to that :slight_smile:

Can anyone help?

Are you sure you used a "Button Device" trigger instead of just "Button"? (If the screenshot above is yours, you did, but I'm asking because I'm not sure if you were showing that as an example of what you did want.) "Button" makes you set regular triggers; "Button Device" will radically change the UI and give you separate actions section for each button event/number you specify, with no need to create triggers manually.

Yeah, found this thread: Found the fix here: Button Device Disappears From Trigger Menu It looks like button device is only in the trigger menu when you create a brand new rule.

All good now :slight_smile:

Hi,
Anyone can explain how to configure the PushCounter to add 1 when push the button? I can't find it anywhere....
Thanks

First, you need to create a local variable (the name "pushCounter" is arbitrary but just as good as any). That's what the "Create, set or delete local variables" section does in the screenshot above. Then in your rule actions, you can manipulate the value of this variable (so what you're specifically asking about) using Set Mode or Variables, Run Custom Action > Set Variable.

Also, I hate to use this thread to plug yet another custom app I wrote, but Dimmer Button Controller can do this for you without needing to use RM or "track" a variable's value, though RM would give you more power. I wrote it to emulate the behavior of a Hue Dimmer on Hue (with a few optional extra features) if that's what you're after. If you use Hue groups, you'll need to pair it with CoCoHue (or, in general, devices that support startLevelChange and stopLevelChange, which individual Hue bulbs with the stock integration can still do) to get the full effect, otherwise you're stuck with "stepping" up or down by a specific percent on groups. So, one or two options that might help you with this if you're not opposed to custom code or are RM-averse. :slight_smile:

1 Like