Instead of recreating the weels and since scripting is not my thing, does anyone have a script that checks for a set of lights i.e. All basement lights and update a virtual device?

Thanks,
Aldo