SOLVED - Nested If statements in RM - how to convert this WC rule to RM?

I am trying to figure out how to recreate this webCoRE piston in RM? Not sure how to create nested/multiple IF statements??

I have recreated virtual switches HE that are activated via WeatherFlow and IFTTT, but now I now need to figure out how create the actual rule, where If a button is pressed, the correct TTS will be announced?

I am sure this must be simple, but not sure how to do it?? :slight_smile:

UPDATE - SOLUTION
Thanks the help of @vjv, @marktheknife, and @ritchierich I used the following solution.
Turns out there isn't a nested statement in RM like there is in WC. Needed to create a separate Triggered Rule in RM for each of the desired announcements.

I expanded the original 3 statements to 5 - keeping in line with the Australian Beaurea of Meteorology (BOM) classification.

Steps (for other noobs like me)

  1. Created Virtual Switch for each UV category: 1-2, 3-5, 6-7, 8-10, 11+
  2. Created Rule for each UV category where if Virtual switch is on, turn the others off (5 rules)
  3. Created IFTTT applet for each category step change (connecting WeartherFlow Increase/decrease of UV index Above/Below X, Y, Z, to turning ON the respective Virtual Switch. (8 applets)
  4. Created Triggered Rule (x 5) where if Button 1 is pressed, if Virtual Switch is ON, play message.

What keypad it is?

You have to create 3 rules for that, and I'm creating a rule to test because I think the keypad, if it's Iris or Centralite, doesn't support button presses yet, only codes or states in RM are supported.

It is a Xiaomi Aqara Button

Since it’s just a button controller, make three triggered rules in RM, for each of those three conditional statements.

The trigger for each is the same, pushing the button.

But each triggered rule will have its own condition; virtual switch one, two or three is on.

And then each triggered rule’s actions can be set to speak one of those three messages.

What’re you doing to turn those virtual switches on and off?

He use his weather integration to turn on and off the virtual buttons. And yes, 3 separate rules is the way.

  1. Create the 3 virtual devices
  2. Create 3 RM actions that speak the verbiage. Set the switch to disable rule to the proper virtual switch.
  3. Use the button controller app, link it to your keypad and the select the 3 actions to execute on button 1.

The action restrictions will be evaluated and the right action should execute.

Thanks @marktheknife, I went ahead and created it this way.

@vjv is correct, I created 5 (I expanded it from the original 3) virtual switches. If #1 is ON, 2-5 are OFF. If #2 is ON, 1, 3, 4, 5 are OFF, etc etc.

@ritchierich, thanks for the suggestion, @marktheknife got in first so I tried it first.

1 Like

I will update the first post with the solution I used.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.