2019-11-06 22:07:26 +01:00
|
|
|
#!/bin/sh
|
|
|
|
PATH=$PATH:/usr/local/bin
|
|
|
|
#
|
|
|
|
# Easy invocation of python script
|
|
|
|
# Add the following to crontab:
|
2019-11-06 22:18:42 +01:00
|
|
|
# @daily /<path-to-your-script>/wrapper-sensors-battery.sh
|
2019-11-06 22:07:26 +01:00
|
|
|
#
|
2020-05-07 16:13:45 +02:00
|
|
|
result=$(/home/mischa/hue/get-sensors.py bridge1 -b 20)
|
|
|
|
result2=$(/home/mischa/hue/get-sensors.py bridge2 -b 20)
|
2019-11-07 00:36:13 +01:00
|
|
|
|
2019-12-27 15:47:49 +01:00
|
|
|
if [[ -n "$result" ]]; then
|
2020-05-07 16:13:45 +02:00
|
|
|
echo "${result}" | mail -s "Hue Battery Status bridge1" $(cat /home/mischa/hue-email)
|
2019-12-27 15:47:49 +01:00
|
|
|
fi
|
|
|
|
if [[ -n "$result2" ]]; then
|
2020-05-07 16:13:45 +02:00
|
|
|
echo "${result2}" | mail -s "Hue Battery Status bridge2" $(cat /home/mischa/hue-email)
|
2019-11-07 00:36:13 +01:00
|
|
|
fi
|