|
|
@@ -30,11 +30,17 @@ ZigBeeDeviceCritical=$(expr $ZigBeeDeviceCritical + 0)
|
|
|
ZigBeeDeviceBattery=$(curl -S -m 5 http://172.30.80.246:8087/getPlainValue/zigbee.0.${ZigBeeDeviceID}.battery 2>/dev/null)
|
|
|
|
|
|
if [ $? -ne 0 ] ; then
|
|
|
- echo "ioBroker-API not available or wrong Zigbee-ID or no battery present."
|
|
|
+ echo "ioBroker-API not available or wrong Zigbee-ID or no battery present"
|
|
|
beenden 3
|
|
|
fi
|
|
|
|
|
|
-ZigBeeDeviceBattery=$(expr $ZigBeeDeviceBattery + 0)
|
|
|
+ZigBeeDeviceBattery=$(expr $ZigBeeDeviceBattery + 0 2>/dev/null)
|
|
|
+
|
|
|
+if [ $? -ne 0 ] ; then
|
|
|
+ echo "Unknown: Got unknown value from ioBroker"
|
|
|
+ beenden 3
|
|
|
+fi
|
|
|
+
|
|
|
|
|
|
if [ $ZigBeeDeviceBattery -le $ZigBeeDeviceCritical ] ; then
|
|
|
echo "Critical: Battery is at ${ZigBeeDeviceBattery}%, which is below Critical-Value (${ZigBeeDeviceCritical}%) | battery_percent=${ZigBeeDeviceBattery}"
|