Version: 2020.2 (build 13058)
Build Hash: 066f3f261-modified
Compile Date: 2021-03-08 16:27:50
dzVents Version: 3.1.5
Python Version: 3.7.3 (default, Jul 25 2020, 13:03:44) [GCC 8.3.0]
This scripts runs for many years now and runs as it should be.
Code: Select all
local BATTERY_THRESHOLD = 10
return {
active = true,
-- active = false,
on = {
-- timer = { 'every hour' }
-- timer = { 'every minute' }
timer = { 'at 08:09' }
},
execute = function(domoticz)
local message = ''
-- first filter on low battery level
local lowOnBat = domoticz.devices().filter(function(device)
local level = device.batteryLevel -- level is 0-100
return (level ~= nil and -- not all devices have this attribute
level <= BATTERY_THRESHOLD and level ~= 1 and level ~= 0 )
end)
-- then loop over the results
lowOnBat.forEach(function(lowDevice)
message = message .. 'Device ' ..
lowDevice.name .. ' is low on batteries (' .. tostring(lowDevice.batteryLevel) .. '), '
end)
if (message ~= '') then
domoticz.notify('Low battery warning', message, domoticz.PRIORITY_NORMAL)
domoticz.log('Low battery warning: ' .. message, domoticz.LOG_ERROR)
end
end
}
In the domoticz database on all 3 devices of this switch and in the the zigbee2mqtt logging the battery percentage is 100 (%)
It's a new added device with a NEW battery.
So no error there too.
But now (only on the switch device itself) I get this error message every day.
Code: Select all
2021-03-17 10:21:00.739 Error: dzVents: Error: (3.1.5) Low battery warning: Device Zigbee - Wallmote (action) is low on batteries (-1485883288),