List all groups

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

List all groups

Post by EddyG »

What is wrong with this part code? I thought I should get all group devices, but non are printed.

Code: Select all

   execute = function(domoticz)

                local groupDevices = domoticz.devices().filter(function(device)
                        return (device.deviceType == "Group")
                end)

                groupDevices.forEach(function(groupDevice)
                        print(groupDevice.name)
                end)
   end

dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: List all groups

Post by dannybloe »

Groups is a separate collection. domoticz.groups() and domoticz.scenes()

Rtfm :p
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: List all groups

Post by EddyG »

Sorry, OEPS. :oops:
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest