Floorplan has a great guide to get started and add it into an existing HA installation. The part I struggled with the most was how to actually create my floorplan graphic.
The HA community suggests using Inkscape to create an SVG for this purpose, which is great and is very useful for adding entities, but doesn’t seem to be very easy to actually create the floorplan itself.
I’ve been playing with the Sketchup application for a few months now. Mainly to design plans for woodworking projects that I want to build. During this learning process, I ended up jumping down a rabbit hole and designed a layout of the bottom level of my house.
With all of the work I put into this design, I thought it would be great if I could take that image, convert it to SVG and use it as my floorplan in Home Assistant. Unfortunately, Sketchup does not have a way to export to SVG.
There are a multitude of ways to go about creating floorplans, even out of Sketchup. For the purposes of this post I will focus on what I find to be the fastest and easiest method. The resulting SVG size will depend on the size image you embed, but I went from about 18KB with a very bad wireframe wit no color to about 800KB with several icons and the background image. YMMV.
- Create a floorplan in Sketchup.
- Export your floorplan as a PNG file and save it somewhere you will remember.
- (Optional) – Open the image in an editor such as The GIMP to remove the background and crop the image.This also cuts down on size of the final SVG (I went from 1.4MB down to ~700k)
- Open Inkscape
- Go to the document properties
- Create a new layer on your project. Let’s call it “Background”.
- Browse to the file location of your exported floorplan PNG
- Drag and drop the PNG into Inkscape.
- Review and modify the default import settings to your liking (or accept the defaults), and you will now have an image layer in your SVG!
- Drag the image around to position it as you prefer
- Create a second layer for your actual entities
- From here, you can take any SVG icon (or make your own), and import them into this design using the same method as the PNG import. A great resource for SVG icons is The Noun Project.
- To wire up an entity to an element on the image,
- Select the object
- Open Object properties
- Set the ID to your entity_id (e.g. sensor.light) This must match the entity_id in HA.
- I typically set the Label to match the ID, as it makes it easier to track down objects in the list later.
- Click ‘Set’. Don’t forget to do this! It will cause much pain during troubleshooting 🙂
At this point, you’re ready to upload your SVG to Home Assistant! If you haven’t done so already, be sure you’ve completely followed the Floorplan Installation Instructions.