Get a Room

Does anybody know how to get and set the room for a device?
It's not documented, but it's 'relatively new', i've tried the obvious with no luck.

You can set the room on the device page itself. That said in the HE app, only switches and bulbs will show. I primarily use the room section of the device page so I can identify locations of devices.

I was wanting to pick it up in code. So I can use it in this task driver I am writing.

Ahh... I know it can be extracted from maker api but not sure how to do that locally.

@damianm You can use the browser inspect to see the attribute name of a field on the device form. Room is "roomId" so then in code you can use that to get the Room number:

log.trace "Device ${settings.device.displayName}, Room: ${settings.device.roomId}"

Outputs:

2023-03-07 08:41:34.188 AM traceDevice Switch3, Room: 1
5 Likes

Thanks

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.