Log DeviceID from RM rule to Global Vairable for Pushover Notification

I am trying to create a RM rule which will log the device ID of switches that aren't turning off after repeating rule sends several times the command to turn OFF, but the switch remains on.

I'd like to track that event switch and send the device ID to to a global variable. I'm then sending a pushover message with a link to the cloud-endpoint of that specific device(s) to command them off.

Example:
Lamp (DEVICE ID: 412) left on.  
   Global Variable: %switchID% sets to 412. 
      Pushover notification includes html link to "https://cloud.hubitat.com/api/074a5084-05a5-4146-8701-xxxxxxx/apps/674/devices/%switchID%/Off/?access_token=XXXXXX-XXXXXX-XXXXXX"

My questions are can a device ID be logged from within RM rule? How do I get the RM rule to set the global variable for the event switch that was left on?

1 Like

How confident are you that the Maker API call will complete the "Off" task that RM somehow failed to do? (Mainly asking, because I have at least one rule that regularly leaves one or more devices – mostly cantankerous Hue bulbs – ON despite multiple OFF requests.)

And have you considered creating a Group in RL for the switches in question, such that a WHILE loop in RM could repeatedly check the group's Activator status until it reports "Off"? (Just thinking out loud here, for ways to avoid such a roundabout, manual work-around...)

I'm not confident at all tbh. I would be nice to send a link to turn it off using the command link and then a link underneath it to view the devices status.

The group didn't work out well in RL. I think it's due to the different types of switches and bulbs the group consists of. I even tried Bruce's ALL-OFF app, but still came home to lights staying on.

I definitely want to incorporate the notification link of the devices that didn't turn off after several attempts. The links are useful to me to see if it'll address that particular device without going into app while i'm out and about and having to navigate to that specific device to troubleshoot. Just a convenience feature added to the rule since the modified Pushover driver allows for links.

1 Like

Would you be willing to pre-populate a (local) String variable in RM, listing the comma-separated IDs all of the switches involved? That's the only approach I know may work. (Can't think of a brute-force way to extract a random device's ID as you initially requested.)

How long after the main RM rule runs would you like to test each switch?

PRO TIP: If you are an Alexa user, make sure her "Hunches" mode is disabled.

1 Like

If deviceID isn't extractable, I am leaning towards making a new rule that's triggered by a virtual switch. That VS switch will be triggered at the end of the original repeating rule finishes.

Once the rule is triggered, it'll look at each and every individual devices IF statements to see if the device has been ON for longer than X amount of time and then send that devices specific link that I'll need to populate for each device the if statement and the command/status links to send. TG RM has a copy/paste feature to speed it up a bit.

Just seems time consuming... I was hoping it would be easier to track and extract the culprit device from within RM rule.

1 Like

Exactly where I was headed before my RM crashed while building the rule to show you. Brilliant minds think alike! :slight_smile:

Here's a rough mockup of what I was shooting for as your helper rule...

... with DELAY 00:00:05 as an optional 2nd step, to give the switch time for compliance. Repeat/modify actions shown for each recalcitrant device. Could even enshroud entire rule in REPEAT - END-REP loop for multiple attempts.

1 Like

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