Floorplan for Home Assistant

Just getting started with the SVG.
Can’t wait to add detail and my components.

Still deciding if showing all floors on one canvas or having a toggle button is idea.

I know i’ll have to toggle cameras/ sensors / media players etc to give them large enough hit-targets anyway

15 Likes

uhhh, I need you to design mine :wink: looks nice

1 Like

I used this very easy tool to create my .SVG floorplan:

Free option allows you to export an svg. I openend the .svg in chrome and inspected with dev tools to find the id’s of the objects I wanted to modify with sublime text.

Changed the text of the dimensions to the labels I wanted for my cameras and commented out the ones I didn’t want

I did find that If I have the zoom pan enabled then I cannot click through very nicely on a mobile device, On a PC it is excellent. Possibly because of touch/tap/click events interfering.

planningwiz also have a 3D option, hopefully in future we can do FPS type walkthroughs and turn our automations on and off… but that is a dream yet to become a reality

3 Likes

Not sure what I am doing wrong but I still cannot see my floorplan after the recent updates to HA.

I updated my frontend.yaml:

  extra_html_url:
    - /local/custom_ui/state-card-floorplan.html

  extra_html_url_es5:
    - /local/custom_ui/state-card-floorplan.html 

and also tried the:

  javascript_version: latest
  extra_html_url:
    - /local/custom_ui/state-card-floorplan.html

have F5’d it to death, and tried multiple browsers although Chrome is my default.

Any thoughts?

Have you cleared you cache?

Didn’t work for me till I did that! Try that and see how you get on

Yes I have, but no luck there either. I am not getting any errors that I can see, just blank space.

Does any of this make sense?

Hmm, i found that yaml.min.js was missing so I created it but now have:

I’m just starting out with floorplan but have already hit a snag that I can’t figure out. Is there anything wrong with the following steps that I’ve so far performed please? The error in Chrome on my Mac is:

URIError: http://<my IP>:8123/local/custom_ui/floorplan/lib/floorplan.js?_=1513339943023
cd /home/pi
git clone https://github.com/pkozul/ha-floorplan.git
cd /home/homeassistant/.homeassistant
sudo cp -r ~/ha-floorplan/www/ .
sudo cp -r ~/ha-floorplan/panels/ .
sudo chown -R homeassistant:homeassistant panels/
sudo chown -R homeassistant:homeassistant www/
cat floorplan.yaml
      name: Demo Floorplan
      image: /local/custom_ui/floorplan/floorplan.svg
      stylesheet: /local/custom_ui/floorplan/floorplan.css
      warnings:

Within configuration.yaml, I added the following:

frontend:
  javascript_version: latest

panel_custom:
- name: floorplan
  sidebar_title: Floorplan
  sidebar_icon: mdi:home
  url_path: floorplan
  config:
    hide_app_toolbar:
      config: !include floorplan.yaml

Permissions look ok:

pi@hassbian:/home/homeassistant/.homeassistant $ ls -al www/custom_ui/floorplan/
total 116
drwxr-xr-x 3 homeassistant homeassistant  4096 Dec 15 12:07 .
drwxr-xr-x 3 homeassistant homeassistant  4096 Dec 15 12:07 ..
-rw-r--r-- 1 homeassistant homeassistant  2261 Dec 15 12:07 floorplan.css
-rw-r--r-- 1 homeassistant homeassistant 61908 Dec 15 12:07 floorplan.svg
-rw-r--r-- 1 homeassistant homeassistant 32955 Dec 15 12:07 ha-floorplan.html
drwxr-xr-x 2 homeassistant homeassistant  4096 Dec 15 12:07 lib

pi@hassbian:/home/homeassistant/.homeassistant $ ls -al www/custom_ui/floorplan/lib/
total 180
drwxr-xr-x 2 homeassistant homeassistant  4096 Dec 15 12:07 .
drwxr-xr-x 3 homeassistant homeassistant  4096 Dec 15 12:07 ..
-rw-r--r-- 1 homeassistant homeassistant 86659 Dec 15 12:07 jquery-3.2.1.min.js
-rw-r--r-- 1 homeassistant homeassistant 51466 Dec 15 12:07 moment.min.js
-rw-r--r-- 1 homeassistant homeassistant 29809 Dec 15 12:07 svg-pan-zoom.min.js

pi@hassbian:/home/homeassistant/.homeassistant $ ls -al floorplan.yaml
-rw-r--r-- 1 homeassistant homeassistant 528 Dec 15 09:38 floorplan.yaml

Running version 0.59.2

From my point of view this seems to be an issue with the new version of Chrome (I have the same error if I install Chrome, but FF is working).

I think floorplan is trying to load some additional ressources, but the loading is blocked by Chrome, because the origin is not seen as safe anymore,

Secure origins are for example anything with https:// or localhost/127.0.0.1 or file://.

I think a fix is needed in floorplan for this to work again.

1 Like

Why is floorplan looking for floorplan.js in the lib folder? A search shows no floorplan.js in ha-floorplan.

Did you download floorplan-quick-start (or parts of it)? Because this includes floorplan.js and its version of ha-floorplan.html is using it.

ahh yes, I had tried floorpan-quick-start earlier so it had cached the page - a cache clear-out fixed the error!! Thank you!

I did some tinkering and noticed that it did load on my Fire Tablets again so I went back to my PC and of course got nothing on Chrome. I installed FireFox feeling very hopeful but was let down as Floorplan does not load on it either.

awesome - this REALLY helped. thank you :slight_smile:

Ive just upgraded to 0.60 and my problems have started all over again

If I use

extra_html_url:
    - /local/custom_ui/state-card-floorplan.html

  extra_html_url_es5:
    - /local/custom_ui/state-card-floorplan.html  

I just get a blue bar across the top and the rest of home assistant page doesn’t load at all

If I use - I get the same thing

javascript_version: latest
  extra_html_url:
    - /local/custom_ui/state-card-floorplan.html

If I load home assistant on an iOS browser it loads just fine with either config above. So this seems to be an issue with Safari!

If I comment out

#frontend: !include frontend.yaml

In my HA config home assistant loads again in Safari but obviously floor plan card now just shows blank!

Any assistance please?

Anyone?..

Did not yet upgrade to 0.60 and I have no Apple device…

I’m still scratching my head on 0.59 & Chrome… Can’t get it to load there.

Have you checked https://github.com/home-assistant/home-assistant/pull/11026
Try to set javascript_version: auto

Did that, didn’t work

  javascript_version: auto
  
  extra_html_url:
    - /local/custom_ui/state-card-floorplan.html

Thats all I see. Even cleared my history.

Works fine on iOS and Chrome for Mac and Windows. Safari Mac is the only problem I can see.

Is no one else experiencing or noticing this issue?

I seem to be the only one…?