[RELEASE] Auto Room Sorter — detect room names in device labels and assign devices automatically

Auto Room Sorter

For a long time I didn’t see much point in organizing devices by Hubitat rooms. Hubitat was never an interface for me — it was a programming backend. I used Google Home or SmartThings to actually control the devices sitting on the hub.

That changed with Modern Dashboard (mDash). mDash lays devices out from your Hubitat room assignments — pick devices, and the rooms and names come from the hub. Easy Dashboards use rooms too, though differently: Hubitat can generate an Easy Dashboard per room (Rooms → Generate dashboards) that stays in sync as you add or remove devices from that room, and the device picker can filter by room. Rooms suddenly matter.

The catch: organizing hundreds of devices by hand is a pain. I tried browser automation. It’s slow, cumbersome, and AI usually quits halfway through, misunderstands labels, and takes forever. Auto Room Sorter does the same job in a couple of minutes.

It reads device labels, detects room names already in them, creates any missing rooms, and assigns unassigned devices into those rooms. Already-assigned devices are never moved.

How it works

  1. Scan — Reads devices (including children) and existing rooms. Every hub room is already a match target, so Saadya's Room Light matches Saadya's Room with no setup. Catalog aliases are merged in (Outdoor … → your existing Outside room, LR → Living Room, and so on).
  2. Step 1 — Rooms — Review detected rooms. Existing rooms are reused (never duplicated, never renamed). New rooms can be created. Edit aliases; rename new rooms if you want.
  3. Step 2 — Preview & sort — Matches are grouped by suggested room. Override the target, skip a room, exclude individual devices, or bulk-assign leftovers that didn’t auto-match. Then Sort Devices.

There’s a one-level undo that restores each device’s previous room from the last sort (and can delete empty rooms created in that run). Unmatched child devices can inherit their parent’s room (on by default).

Matching

  • Uses the device display label, not the driver type name.
  • Longest / most-specific alias wins. Ties are flagged ambiguous in the preview so you can exclude or fix them before sorting.
  • Short aliases like LR / DR only match as capitalized tokens with a trailing space (LR Light), so they don’t fire on random letters.

Install (HPM — recommended)

  1. Hubitat Package Manager → Install → search Auto Room Sorter.
  2. AppsAdd User AppAuto Room Sorter.
  3. If your hub requires login, enter those credentials in the app.
  4. Check the safety acknowledgment before creating rooms or sorting.

Prefer a hub backup before a large sort.

Manual install

Apps CodeNew App → paste AutoRoomSorter.groovy (or Import from that URL) → Save. Then AppsAdd User AppAuto Room Sorter.

Caveats

Room create/assign is not in Hubitat’s public Groovy API. This app uses hub-local undocumented endpoints (verified on C-8 Pro firmware 2.5.1.143). Those can change with firmware. The app probes reads on open and runs a no-op write probe before the first write of a run.

This is a convenience tool for getting rooms in place so mDash has rooms to lay out, and Easy Dashboards can generate a dashboard per room. It is not a replacement for either.

Links

Feedback welcome. If something matches wrong, the preview and exclusions are there so you can fix it before you sort.

If you feel like supporting my work buy me a coffee.

3 Likes