In this tutorial we will show how to set up sensor low battery alarm in EasyIoT server automation function. We will be notified by email when one of sensors batteries is low.
Battery powered sensors can report it's battery level from 0 to 100%. Checking all battery statuses of all sensor nodes to determine flat battery in user interface is not practical. We will show how to automate this function in EasyIoT server automation module.
We want to be notified for low battery status once per week on Friday at 15:30 by email. Before configuring EasyIoT server automation function we recommend reading following tutorials:
EasyIoT server automation - part I
EasyIoT server automation - part II
EasyIoT server automation - part III
In EasyIoT server automation module we add new automation program. We will name program "Module battery check" and set CRON to 30 15 * * fri. CRON 30 15 * * fri means program execution every Friday at 15:30. Next we will write program - press button edit.
Because we will execute program periodically, we will keep Setup() function empty and add our program in Run(). In program we loop trough all modules and read property Status.Battery. If property exists we check its value. If value is less than 5 we send email notification. Change email addresses and password to suits your account. And don't forget to enable automation program.
It's also very easy to change program to send SMS message instead of email notification with SmSHelper function.
See more tutorials at http://iot-playground.com/build
RSS feed for comments to this post