Hi everyone!
Here's the power monitor I built for my lab in B4A.
Its fairly simple: if the device gets unplugged (power goes off), it waits for a moment and sends an SMS notification to the specified number. If the power comes back, it also sends a new SMS notification.
We use it in an old phone which we leave plugged to the same electric line as our sample freezers and servers, so we get notified if the building looses electricity, something quite common here during the summer.
The code is not perfect or thoroughy commented, but I think its pretty straightforward.
I'm attaching the B4A project. There is also Spanish version also in the repo in GitHub.
EDIT: 23/02/2021 code was corrected thanks to @Xfood
Here's the power monitor I built for my lab in B4A.
Its fairly simple: if the device gets unplugged (power goes off), it waits for a moment and sends an SMS notification to the specified number. If the power comes back, it also sends a new SMS notification.
We use it in an old phone which we leave plugged to the same electric line as our sample freezers and servers, so we get notified if the building looses electricity, something quite common here during the summer.
The code is not perfect or thoroughy commented, but I think its pretty straightforward.
I'm attaching the B4A project. There is also Spanish version also in the repo in GitHub.
- The code repo is in https://github.com/limnolab/Power-monitor
- The APK can be downloaded for free here
EDIT: 23/02/2021 code was corrected thanks to @Xfood
Attachments
Last edited: