Button controller - fan speed step up/down

I use Pico remotes with button controller. Currently I have the shade up/down buttons set to turn a fan on/off.

I see cycle fan speed, but can I have it step up and down using two seperate buttons?

ie, hit up once and turn on low, hit it a second time go to medium, a third time go to high. Hit down once and go back to medium.

You could do it with a Rule Machine rule that keeps the current fan speed in a variable.

You don't really need to even use a variable because fan speed state is easily queried by a RM conditional.

Trigger: UP Button Pushed

Action: If fan is off, set speed to low
if fan speed is low, set speed to medium
if fan speed is medium, set speed to high

Then just do reverse for DOWN button.

I use that logic in Node Red currently but did it with RM before switching to Node Red

I must be thick in the head. I've never successfully made a rule machine rule. Surely I'm making it more complicated than it is.

Why is is OR and not AND?

This will cycle the fan up using Simple Conditionals.

When you start your Actions, don't select Fan Speed, choose a Conditional Actions. Then, from resulting drop-down box, you choose a Simple Conditional Action in this use case.

I think I got it. The simple conditional action is what I was missing.

I built two rules. One to step the speed up, and another to step it down.

Curious why you have an icon besides the device name, but it's not in mine.