Logic Machine Forum
Zigbee devices list from scripting - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Gateway (https://forum.logicmachine.net/forumdisplay.php?fid=10)
+--- Thread: Zigbee devices list from scripting (/showthread.php?tid=5418)



Zigbee devices list from scripting - jeeone - 16.05.2024

Hello!
Is possible to get zigbee devices list via script?
I needed to get battery status from all wireless zigbee devices.


RE: Zigbee devices list from scripting - admin - 16.05.2024

Like this:
Code:
query = 'SELECT * FROM zb_devices WHERE batterylevel IS NOT NULL'
devs = db:getall(query)

for _, dev in ipairs(devs) do
  log(dev.name, dev.batterylevel)
end



RE: Zigbee devices list from scripting - jeeone - 16.05.2024

WOW, many thanks admin!!!