Send command to all items in all sub locations

For example, I have certain locations here, which in turn have certain rooms, which in turn have certain equipments. The euqipments then have certain items and i want to switch all of them.

In the forum i have found one solution Grollo.members.filter to switch certain items which are member of a group.
i.e.:

    Grollo.members.filter[ m | m instanceof SwitchItem ].forEach[sw | sw.sendCommand(<switch command>) ]
    Grollo.members.filter[ m | m instanceof Location ].forEach[ lo | lo.sendCommand(<location command>) ]

However, I want the command to switch the last socket in the lowest level of a location. In this example, for example, I want to switch off all sockets within “Home”(Building).
Unfortunately, I did not get any further. Can anyone help me?

ok, solved with:

Grollo.allMembers.filter[ m | m instanceof SwitchItem ].forEach[sw | sw.sendCommand(<switch command>) ]