Log duration of switch ON for notification

I am attempting to add to one of my device charging rules a notification that will tell me the duration of time the switch was on. I was using webcore previously for this with a piston I found years ago, would like to do this in RM.

The rule is based on wattage so it can vary depending on the amount of juice left in the device when the switch turns on.

Ultimately, looking to see the duration of charge time in my charging complete notification. Anyone know the correct way to log this within a rule?

I'm about to clock-off for the night (as much as that is true for me... ), but am I right in thinking you are wanting to limit the charge you supply to a device like a tablet or phone to around 80%? Could you not use a smart plug and something like Tasker to report the battery percentage? If you are using an Android device...

Thank you for looking into this. I already have the rule turn off based on wattage drop. I'd just like to be able to tell me how long the plug was on for each time it turns on to charge. For example

"Scooter battery charged in 4 hours and 5 minutes or 4:05 hours"
"Pool vacuum charged in 3 hours and 30 minutes or 3:30 hours"

I just remembered the modified "Usage and Count Table" app from Bruce having hub variable and resetting options. Will be looking into this...

1 Like

That's where I was heading as well .... :slightly_smiling_face:

1 Like

RM has a math function to calculate a time difference in minutes. You just need to define the start and stop times and run the function. Here's a simple example.



0:02:30 was rounded to 3 minutes but hopefully that's good enough.

1 Like