Is there an input type/capability for selecting one or more rooms?
Alternately, is there a function/API I can use for get the current rooms as a starting point for a custom picklist?
Is there an input type/capability for selecting one or more rooms?
Alternately, is there a function/API I can use for get the current rooms as a starting point for a custom picklist?
I dont have an answer for you but I strongly second Hubitat having this functionality, especially to provide a filtered list of devices in the device selector.
Crossposting the solution provided by @Bloodtick_Jones in Are APIs available to Custom App Developers for leveraging Rooms and the Devices therein? - #10 by WesMC.
The app-object doc fails to mention the available functionality.
app.getRooms()
This command provides a map keyed by Room ID and values name (room name) and deviceIds (the devices in the room).
Perfect, that's exactly what we were both looking for. For anyone else interested:
myList = app.getRooms()
log.info ("myList is: $myList")
will get you:
[[id:10, name:Attic, deviceIds:[2489]],
[id:3, name:Basement, deviceIds:[4134, 4135, 2328, 2425, 2457, 2330, 2458, 3226, 2331, 3227]],
[id:6, name:Bathroom (Main), deviceIds:[2360, 3228]],......... etc, etc.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.