← all posts
Wed 02 Dec 2026 · 8 min read

A Live Floor Plan for Home Assistant

Home Assistant is great, but I find its overviews of what’s going on in my house very hard to take in at a glance. There are a fair number of devices in my Home Assistant instance now: lots of Zigbee devices including lights and switches, door sensors, temperature sensors in most rooms and the air con on a Zigbee IR blaster, as well as Wi-Fi and cloud devices, even the 3D printer. I’ve seen other people use floor plans for this before, but every time I tried I got stuck in the weeds drawing the SVGs and never got anywhere.

So, as a throwaway project, I thought I’d see if I could get good enough results using Claude. I spent an afternoon1 going back and forth with it, starting with a simple question: is there anything you can work out the layout of my house from?

A dark Home Assistant dashboard showing floor plans of the ground, first and second floors and the garden buildings side by side. Rooms are labelled with their temperatures, the office is lit yellow, and the kitchen, craft room and bedroom have furniture drawn in.

Where it ended up: the Floor plan dashboard, live.

Finding a Floor Plan

I didn’t have architect’s drawings to hand, but Claude found that the house’s old sales listing is still online, with the estate agent’s floor plans on it. One image per floor, with room names and dimensions. That was the main source for everything.

Claude then calibrated each image. A wall with a known length gives the scale in pixels per metre, the top-left corner of the house gives an origin, and the front wall is a cross-check. After that, every wall, door, light and sofa is just a position on the listing image.

FloorOrigin (px)Scale
Ground(586, 92)60 px/m
First(632, 96)73 px/m
Second(612, 100)81.7 px/m
GardenIts own centimetre grid100 px/m

Generate, Don’t Draw

Rather than draw an SVG by hand in Inkscape, the plan is generated by a Python script, build.py, that Claude wrote and maintains2. It holds a handful of plain tables:

  • Rooms: the outline, the label, and which lights count as “this room’s lights”.
  • Devices: every entity on the plan, with a kind: ceiling bulb, lamp, temp, ac, motion, fan, tv, printer and shelf (a lit bookcase or cupboard).
  • Furniture: the sofa, bed, desks, worktops and so on, which don’t change.
  • Doors and windows: hinge and latch points, which way they swing, and a contact sensor if there is one.
  • Stairs: generated treads.

From those it builds three things: home.svg, the drawing, where each element’s id is its Home Assistant entity id; home.css, with all the states (light-on, shelf-on, a spinning fan-on, doors open and closed, AC modes, unavailable); and the card’s YAML. Generating the YAML from the same tables means the drawing and the config can’t drift apart.

It can also render a preview from a file of made-up states (python3 build.py states.json), so Claude checked every change as a PNG before it went anywhere near the real dashboard.

A preview render of the floor plans with the kitchen under-cupboard lights and the office lights on, shown as soft yellow light spilling from the cupboards and shelves into each room.

A local preview with the kitchen under-cupboard lights and the office lights on.

Making It Live

Claude picked ha-floorplan (v1.1.5) as the card to do the work, installed through Home Assistant’s Marketplace. It sits on a new “Floor plan” dashboard with a single panel view, which Claude created and saved over Home Assistant’s WebSocket API rather than by clicking through the UI.

The script generates a bunch of rules that drive the whole thing, using ha-floorplan’s floorplan.class_set and floorplan.text_set services with small JavaScript templates:

  • Lights glow when they’re on, and a tap toggles them.
  • A room’s floor is tinted when any of its lights are on.
  • Lit shelves and cupboards spill light into the room.
  • The kitchen extractor spins when it’s running.
  • Doors with contact sensors swing open (red) or show closed (green).
  • The air con units show whether they’re cooling, heating or off.
  • Each room shows its temperature.
  • The 3D printer pulses while it’s printing, and motion sensors light up when they trigger.
  • Anything unavailable is greyed out.

This is one of the rules, as generated, for the lit shelves and cupboards:

yaml
1- entities:
2    - light.office_bookcase_level_on_off
3    - light.office_shelves_light
4    - light.lumi_lumi_switch_n3acn3_on_off_2   # kitchen under-cupboard lights
5  tap_action: toggle
6  state_action:
7    service: floorplan.class_set
8    service_data: '${(entity.state === "on" ? "shelf-on" : "shelf-off") + (["unavailable","unknown"].includes(entity.state) ? " unavailable" : "")}'

Scribbling on Screenshots

Claude’s first version was rooms and dots. Improving it became a loop of explaining to Claude what I wanted, and it making the changes. To do this I took a screenshot of the dashboard, scribbled on it, and sent it back, and Claude turned each scribble into a few edits to the tables, a preview, and a push to Home Assistant. It’s much quicker than trying to describe where the sofa goes in words.

An early version of the dashboard with red and green scribbles over it: TV written on the living room's left wall, a green box marking the sofa, an arrow up the wall between the living room and the snug, and a circle by the master bedroom door.

Early scribbles: the TV, the sofa, where the air con really is, and a dimmer switch outside the ensuite.

That’s how I got the air con units onto the right walls and the furniture in (just enough to get your bearings), and had the stairs pulled in so the treads don’t run over the walls. The kitchen extractor is a light.* entity in Home Assistant3, so Claude first drew it as a bulb. After a scribble from me it became a fan icon that spins when it’s on.

Filling in the Gaps

Not everything was on the listing. The garden has a timber building split into a workshop and a shed, with no plan at all, so I marked it up on an aerial photo instead4 and Claude traced it from that. The kitchen had an outline but no units. Asked if it knew where the worktops went, Claude said no, and offered a typical layout clearly labelled as a guess. So I took two photos on my phone, one of the back wall and one of the bay, and Claude worked out the layout from those: the hob on the back wall, the sink and dishwasher down the right, and the fridge by the bay.

The kitchen on the plan, drawn from photos: the hob on a worktop along the back wall, the worktop turning down the right-hand wall with the sink and dishwasher, and the fan and fridge in a short run on the left by the bay.

The kitchen, worked out from two phone photos.

Neither was right first time, so I sent corrections (“the doors should face left”, “the workshop and shed are the other way round”), but those are trivial fixes for Claude when a building is a few lines of data.

Doors That Open

As I have door open sensors on a bunch of my doors, I asked Claude to add open and closed states for them. Claude drew all the doors, each with both a closed leaf and an open leaf with its swing arc, and the CSS shows one or the other. Three of the doors have Aqara contact sensors5 (the French doors, the snug to garage door and the garage door) and show their live state; the rest are drawn closed.

A preview of the three floors with every door closed. The French doors at the top of the living room, the snug to garage door and the garage door are drawn as solid green lines.

Doors closed…

The same preview with the doors drawn open on dashed swing arcs. The French doors and the snug to garage door are red and open, and the garage door is a dashed red line.

…and open. Only the three red ones have sensors.

Shelves That Light the Room

The office has a bookcase and a run of shelves with LED strips in them. Claude’s first go made the units themselves glow, like a pair of giant light bulbs. I told it that’s not what they look like in real life: they light up the room.

Two crops of the office on the plan side by side. On the left the bookcase and shelves are dark brown; on the right they're bright yellow and glowing.

The first go, off and on: the shelves lit up like bulbs.

Claude’s fix was to draw the units in wood colours that never change, and add a soft gradient of light from each unit’s open face into the room. The gradient is clipped to the room outline with an SVG clipPath, so the light never leaks through the walls, and the shelf-on class turns it on.

The office on the plan with its bookcase on the left wall and shelves along the top wall drawn in brown, and soft yellow light spreading from both into the room, fading out towards the desk on the right.

Much better: the shelves stay wooden and light the room instead.

The kitchen’s under-cupboard lights use the same trick, with one twist. I scribbled on which cupboards have lights, and pointed out that the light shouldn’t wash over the cupboards next to them. They’re all on one switch channel, so Claude changed it so one entity drives several runs of cupboards, each shining from its own face, and drew all the light first and the cupboards on top, so the units block it.

The kitchen, lights off and on. With the lights on, light falls from the back wall cupboards and the top of the right-hand cupboards over the worktop, and from the left-hand cupboards over the fridge, without crossing other units.

The kitchen’s under-cupboard lights, off and on.

Uploading the Files - Unneeded Pain Points

Getting the files into Home Assistant turned out to be harder than drawing the house. But mostly because I was being lazy6.

Claude started off putting the SVG and CSS into /config/www/floorplan/ through the VS Code add-on, but that kept dropping its connection through my reverse proxy, and saves failed silently7. Switching to the official File Editor add-on fixed it, and the files are back in /config/www/floorplan/ where they belong.

Final Thoughts

I still need to tidy a bunch of this up. There are places where I would like better labels, and some of the devices could be better located, but it’s reached the point that it’s good enough for now.

If you want to try it yourself, give it a go with Claude or another agent. You might be surprised how far you get.


  1. Well, a little more than an afternoon, but spread out over a couple of days. ↩︎

  2. I’ve not even looked at the code for this yet. ↩︎

  3. Which I really should fix in Home Assistant, rather than working around it in the floor plan. ↩︎

  4. I’ve left that one out of the post, as it’s a nice clear photo of exactly where I live. ↩︎

  5. I’m sure I used to have more than three, so I should find out when the others broke. ↩︎

  6. I allowed Claude to work around it, but using the VS Code add-on was the wrong choice. ↩︎

  7. For a while Claude got round it by not needing a file at all. ha-floorplan loads its image and stylesheet with fetch(), which is happy with data: URLs, so the SVG and CSS went into the dashboard’s config as base64. It worked, but left me with a huge dashboard config that was no fun to edit by hand. ↩︎

search.exe
esc to close