Floorplan for Home Assistant

I used Inkscape and I believe that’s the one most people use (it’s free). You can create your floorplan SVG from scratch, and/or import some existing SVGs (such as icons to represent your cameras, switches, etc.).

Some useful info:

http://wiki.inkscape.org/wiki/index.php/Drawing_a_Floor_Plan

And a video:

https://www.youtube.com/watch?v=8dCyaGT2708

5 Likes

Worked like a charm!

Hi I love this, tried my own setup got it working perfectly one question is it possible to have different colours for different entities. Also would be great to displaying temperature/ humidity readings

Wow this is super cool, I can see a ton of uses for this not just a floor plan.

I agree, if sensor values could be overlayed somehow then would open up a lot of possibilities.

Thank you for your code and example, I will give it a try

1 Like

Yes, I’ve been thinking about allowing more control over the display/behaviour of each entity. I think I will enhance the configuration, so that each entity will have its own set of options.

As for temperature and humidity, I guess they should appear as text somewhere on the image, possibly with some colour as well to indicate the level. Maybe we could use SVG <text> elements for this. So, for example, on your floorplan SVG, you could create <text> elements for your temp and humidity readings, and the text could then get automatically updated to reflect the current states in HA. Would that sound like a good option?

3 Likes

I’m glad I moved this into Share Your Projects; it really seems to be taking off!

3 Likes

HA is so well designed and flexible, it was just begging to move in this direction :slight_smile:

1 Like

One thing I have had problems with the cache on all browsers and I use the iOS app and the Electron desktop app. These don’t have a cache clear so every time I redesign the floorplan.svg I have to clear the cache.

Excuse me if im missing something obvious, but is there a way to get a sensor working with this that isnt binary? I have a motion sensor that is not “on” or “off”.

This is an awesome addition though :smiley:

Hi there CommonBob. What are the two states of your binary sensor? Currently, the code supports ‘on’ and ‘open’ as the ‘on’ states, for example.

I am working on a new version that will allow you to control a lot more of the behaviour via configuration. It will be flexible enough so you can add different states yourself, and define how they should be displayed, etc.

2 Likes

I like the sound of that.

Just wanted to share my most recent floorplan. Thank you to everyone for pitching ideas and sources.

6 Likes

@Corey_Johnson I hope you don’t have those pink and green carpets at home :grin: Just kidding; you’ve created an amazing SVG floorplan. Thanks for sharing.
@pkozul Very nice work! You are awesome! Thanks for this addon. It was one feature that I missed in HA when I switched from Domoticz one year ago. Since I’m very conservative (and lazy) I’m still with 0.36.1 but going to upgrade just to test this. Thanks again!

2 Likes

Really nice Corey. Great work.

Just a quick update. To support just about any type of HA entity, I’ve done a bit of a rewrite. I’ve been learning quite a bit along the way myself, so always looking to improve it.

I have the new version running on my machine, but want to do some more testing before putting it up on GitHub. With this new version, you will be able to configure just about everything yourself. Below is an example showing what I have in my setup:

    binary_sensor.floorplan:
      custom_ui_state_card: floorplan
      image: /local/custom_ui/floorplan/floorplan.svg
      password: <some_password_here>
      stylesheet: /local/custom_ui/floorplan/floorplan.css
      last_motion_entity: sensor.template_last_motion
      groups:
        - name: Sensors
          entities:
             - sensor.melbourne_now
        - name: Switches
          entities:
             - switch.doorbell
          states:
            - state: 'on'
              fill: '#F8D2B9'
            - state: 'off'
              fill: '#B9BFF8'
        - name: Binary sensors
          entities:
            - binary_sensor.front_hallway
            - binary_sensor.hair_salon
            - binary_sensor.back_hallway
            - binary_sensor.kitchen
          states:
            - state: 'on'
              fill: '#F8B9BE'
            - state: 'off'
              fill: '#C4EDB1'
          state_transitions:
            - name: On to off
              from_state: 'on'
              to_state: 'off'
              duration: 10
        - name: Cameras
          entities:
            - camera.hallway
            - camera.driveway
            - camera.front_yard
            - camera.front_door

As you can see, the new style of config lets you create groups of entities, so you can define bahviours at a group level. You can create as many groups as you want, and split up your entities into whichever groups you want, as long you want them to share the same colours, transitions, etc. I have my binary sensors in the same group, as I want them all to show the same ‘on’ and ‘off’’ colours, but you can easily split them into multiple groups to have different colouring schemes.

Also, the new version supports SVG <text> elements, so you can now display any textual information on your floorlplan (i.e. weather, as in my example).

Below is what my floorplan looks like, using the new version and the config I showed above:

Will let you know when this is on GitHub, and when I’ve updated the documentation, etc.

BTW, on more thing I would like to add to the new version is the ability to (optionally) specify which CSS classes to apply to different states. Currently, the code changes the fill colour based on an entity’s state, but it would be good to use CSS to change the appearance, as you can do a lot more with it, and you have plenty of flexibility in managing this yourself.

And another nice thing with the new version. The same HTML file can be reused for both custom panels and state cards, so no need to copy it and make those few changes. A single file is now used, for those who want to display the floorplan in both places.

10 Likes

Trying the new HTML file and use the updated Yaml, but I’m getting an error online 165 in the HTML file, any ideas are my doing something wrong.

Hi Andy,

What is the error you are getting?

How did you get the pattern to load
I am getting
wood-pattern-small.jpg:1 GET https://xxx.duckdns.org/inkscape/wood-pattern-small.jpg 404 (Not Found) classico-ceasarstone-6600-nougat.jpg:1 GET https://xxx.duckdns.org/inkscape/classico-ceasarstone-6600-nougat.jpg 404 (Not Found) Miitomo-Placeholder15-Floor.png:1 GET https://xxx.duckdns.org/inkscape/Miitomo-Placeholder15-Floor.png 404 (Not Found)How did save the svg with the patterns embedded.

Everything was created with or imported into Inkscape then saved as floorplan.svg. Then I defined the path IDs to link them to my devices.

I may not be understanding your question. I did use ‘layers’ to separate the floorplan itself from the icons.

You don’t have a link to the guy who did your floor plan do you. There are quite a few people doing them on Fiverr.

1 Like