Why won't this rule work

The reason I've set this up (or am attempting to) the way I have is to simplify it, as and when I need more notifications. With one virtual switch for each notification, one variable that goes true/false if any switch is on and one variable for the notification text itself; it should be relatively quick to amend. One rule and one virtual switch for each individual event and I'd simply need to add one. line in the main rule.

Good logic for sure.

Here's an example of some WHILE/END-REP and the private boolean used with required expression... kind of a busy rule but you get the idea. This particular one does a safety check of sorts of my security system and confirms that HSM, Envisalink, and the keypads remain in sync. Sorry for the eye chart. You'll have to read it before a few cocktails.

1 Like

I'll try adding the PB. It's a complete pain as when you try and insert a conditional at the head of a rule it'll let you insert the If but not the Then which has to be inserted separately and the indentation goes to pot. Easier to start from scratch. Thanks for everyones help/advice - it's appreciated.

use the required expression instead...

1 Like

Update Rule should fix that, or close action editing, re-open action editing, and it should fix indentation. I’m OCD about that, too.

2 Likes

Or you can use the one-line simple conditional and not worry about the THEN/ENDIF

Right so the below works great - thanks. The active switches now scroll in order regardless of the order I turn them off and on again while the rule is running/repeating.

The %time% however is just a real time clock. It's just updating on every displayed string to show the time of the last trigger for even while in the repeat loop. I'd like it show either:

  • the time that the individual virtual switch triggered on (which is what I expected to happen) or
  • alternatively the time that the rule fired that caused the virtual switch to be turned on

A bit complicated maybe, but all I can think of is that in the rule that causes the virtual switch to turn on, I add a line to store that time in a separate variable. Then somehow I put in this main rule to prepend the notification with the content of that variable storing the triggered time.

@brad5 Update - I think I've found a way to correctly show the time from the individual event.

I'm doing away with the virtual switches that are in each notification rule and replacing them with variables:

1 - Each individual rule has a string variable - e.g notificationWasher, notificationDishwasher, notificationRatTrap etc
2 - When triggered, the individual rule will set it's associated string - e.g notificationWasher will be set to '%time% - Wash Cycle Complete'
3 - notificationOn that previously triggered when any virtual switch was changed, will now trigger when any of the notification specific variables change - going True if any is populated and False when all are null
4 - notificationActive will trigger, as before when notificationOn changes. The while loop will now contain statements like this:

It looks as though that will copy the string previously generated in the notification specific rule variable into the notificationActive variable. That will keep the time showing correctly for the triggering event.

Wow ok! Sounds good! Complicated but good! If I run into any variable questions I'm calling you.

1 Like

haha - I still find it a nightmare to try and work out how to do things but enjoy the learning curve!

1 Like