Need help with Dim + and Dim - scenes via Hue Dimmer Switch

Hi everyone! I’m exploring Gladys further, with pleasure, well done to the whole team for this work!

I’m trying to create scenes so that my Hue Dimmer Switch V2 remote can control the bulbs in my living room as it did with the Hue bridge (which I want to get rid of, to use my Zigbee dongle instead).

I’ve paired my remote with Gladys. I’ve successfully set up the power button on the remote to turn my 2 bulbs on and off.

QUESTION

I want to be able to use the + and - buttons on the remote for short and long presses to dim + and dim - both lights at the same time. With a short press, I dim in steps, with a long press, I dim gradually until release, and the brightness stays at the value reached.
I don’t see any ready-made command for dimming? Any idea how I can proceed?

PS: For the ON/OFF here are my scenes, I don’t know if there’s a simpler way?
Bedroom: ON-OFF

When

Device state change

Bedroom Remote 1 (Button click)

Button On pressed

Then

Get last state

Bedroom Ceiling 1 (Lighting On/Off)

Get last state

Bedroom Ceiling 2 (Lighting On/Off)

Condition « If… Then… Else… »

Variable condition

Variable

Bedroom Ceiling 1 (Lighting On/Off)

Operator---------equalgreater than or equalgreater thandifferentless than or equalless than

Value: Active

Variable condition

Variable

Bedroom Ceiling 2 (Lighting On/Off)

Operator---------equalgreater than or equalgreater thandifferentless than or equalless than

Value: Active

Then

Turn off the lights

Bedroom Ceiling 1

Bedroom Ceiling 2

Else

Turn on the lights

Bedroom Ceiling 1

Bedroom Ceiling 2

Hi everyone! I’m still struggling with my Dim + and Dim - button issue.

Should I link my Hue Dim Switch v2 to 2MQTT? Or should I continue creating scenes in Gladys?

I want to use all four buttons on my Hue Dimer Switch:
-the « Power » button to turn the lights on and off
-the « Dim + » and « Dim - » buttons to dim
-the « Hue » button to cycle through different lighting modes (max light, natural light, relaxation, etc).

Hi!

For your first scene, there is a ‹ toggle › action that allows you to reverse the state of the lamp. If I understand correctly, that’s what you’re trying to do with your single-click scene

For your dimmer, you can use the ‹ control a device › block with a ‹ calculated value › that increments the previous value

Thank you so much! That’s what I already did for toggle, it’s what works!

I managed to dim with « retrieve the last state » and « control a device », thank you so much!

I’m having trouble seeing a long press that dims and stops dimming in a reactive way. Do you have any ideas?

We need to know if your button returns a value at the end of the long press.

Oh yes, it sends a release that I matched to a « stop » scene.

The remote is a Hue Dimmer Switch V2, to control 2 Hue E27 (white and color ambiance)

And here is the scene for Dim + long press for example (I have the equivalent for Dim - long press)

Use a ‹ repeat while › action, that should do it!

I’m really struggling with this simple thing. I couldn’t get it to work with « repeat while ». Could you clarify how to do it? Here’s the current state of my scene « Dim + long press » for example:

I have a scene per button « ON-OFF », « Dim - (short press) », « Dim - (long press) », « Dim + (short press) », « Dim + (long press) », « Dim (stop) ».

I tried to bind the remote in Z2M to my bulb group, but I have issues when I rapidly spam the + or - button, the actions stop at some point. Same when I long press + or -, it’s a mess, it stops in the middle, the next press on the remote does nothing, etc.

I managed to bind the remote to the 2 bulbs separately, and since then: On/Off works, Dim + and Dim - work, including with long press.

Strange that when binding the remote to a group of 2 bulbs, the long press is much more laborious.