batteryLastReplaced in Webcore for 10+ sensors


I am trying to get a notification to my phone when any of my battery sensors batteryLastReplaced variable is greater than 2 years. I now how to do it for single sensor but looking for some smart solution for 10+ sensors.

Could you please show some example?

You can create an array of devices, and then either loop through them or use an “any” on the event condition.
It may be worth sharing the code you have at the moment, so someone comment on how to amend it,

Screenshots below.
As you can see on the second one I don't have an option to choose 'greater than'.

I’m not sure that battery replaced would work as a trigger and wake up the piston. However, if it did, you can use the $currentEventDevice variable to access the device which caused the trigger.

I think I would approach this by writing a piston to run once a day, then simply have a for loop go through and test each device in turn

1 Like