Floorplan for Home Assistant

Found the individual notes in the post already, but this should make it pretty clear and straight forward for anyone to follow. Recommend adding that to the repo as well :slight_smile:

Question though, can’t get custom-state-card to work … it only shows it as a sensor, doesn’t replace show the svg’s until I click on the sensor (should be something small) but I think I spotted people adding multiple floors under the state card, is that possible?

yes I managed to set it up but due to a new job I haven’t had much time to extent it to cover 4 floors and the outside buildings…

I have the floor plans set up as seperate panels to show them on a wall mounted tablet per floor and I have them in cards as that is just nicer to display on my handy/tablet

4 Likes

what tablet are you using on the wall? That’s my next step in this process.

1 Like

cheap android tablets as it only has to display the floor plan and hass :smiley:

1 Like

I need more info… :slight_smile: I’m considering the new Fire tablets for 50 bucks. Not sure if I can get away with something cheaper. I’ve noticed that my old iPads won’t run the new Floorplan code so I didn’t know how ‘cheap’ I could go.

Do your tablets go to sleep and wake up on motion?

I have a Fire 7" HD that I bought last year. I run WallPanel on it. The Floorplan works fine on it.

3 Likes

Can anyone let me know how to make state condition of one entity based on another entity

Ie. change class if another sensor is on (such as movement detection will go red if alarm entity is on and green if not.

Got the Fire Tablet. Had to rework a lot of the floorplan since monitor to 7 inch tablet is much different. Here’s my work in progress.

Next update will be in the form of a blog post. :slight_smile:

2 Likes

Got the same tablet. Will have to try that as well. Good work!

BTW, are you using HTTPS? Also, have you tried using the floorplan on your tablet while outside your home network?

Hi @pkozul, I am using SSL. No issues… works perfect. I haven’t tried the tablet outside the network but I’ve hit Floorplan on my IOS and other devices outside the network without issues.

My new issue I am running into is with the Kitchen and Living room groups. groups doesn’t seem to toggle the lights on and off… Have you done any groups yet?

BTW: For the fire tablet - download wallpanel to run floorplan.

OK, HA groups are now supported, so if you already have your entities defined as groups within HA, then you can simply include those groups in your floorplan config rather than include a potentially huge list of individual entities.

  - name: Light Groups
    entities:
      - group.office_lights
      - group.hallway_lights
      - group.kitchen_lights
      - group.outdoor_pool_lights
      - group.outdoor_front_lights

    states:
      - state: 'on'
        class: 'room-on'
      - state: 'off'
        class: 'room-off'

Also, the floorplan is a bit smarter now in that it will log error messages if any specified groups do not exist within HA. It also logs errors if the SVG file doesn’t contain any of the elements it is supposed to. Error handling of other scenarios will be added where appropriate, which will make it easier to find any typos or other issues that may not be obvious.

Latest version is now ready on GitHub.

3 Likes

A bit of experimental functionality added. If you want your floorplan to support panning and zooming, simply add pan_zoom: to your floorplan config:

      name: Floorplan
      image: /local/custom_ui/floorplan/floorplan.svg
      stylesheet: /local/custom_ui/floorplan/floorplan.css
      pan_zoom:

You also need to grab the file www/custom_ui/floorplan/svg-pan-zoom.min.js and include it in the floorplan HTML file:

www/custom_ui/floorplan/ha-floorplan.html

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://momentjs.com/downloads/moment.js"></script>
<script src="svg-pan-zoom.min.js"></script>

The GitHub repo has been updated to reflect all of this.

If you try this for yourself, let me know how it goes.

3 Likes

Great… I can confirm that HA and floorplan are working fine on my Amazon Fire tablet. I am running HA with HTTPS, and am able to access it all from a remote location without issue. All good!

1 Like

This looks amazing. As a feature suggestion for the future (also mention on HAD thread), it would be amazing if this were integrated into HADashboard too.

You can use iframe widget, works like charm.

1 Like

Perfect, I’ll give it a try.

OK, this might sound simple to people, but took me some time figuring out. Using the first method wasn’t working for me, basically because I already have a lot of views. I ended up fixing my 2 floorplans by using:

# groups.yaml
floorplan:
  name: Floorplan
  view: true
  entities:
  - group.floorplans
floorplans:
  name: Floorplans
  view: false
  entities:
  - sensor.last_motion
  - binary_sensor.groundfloor
  - binary_sensor.firstfloor

Not doing so and only the part ‘floorplans’ with the view on true gets me two sensors and svg’s inside the modal popping up. Glad I fixed it know (and yes I am using both methods). Nice work @pkozul, I really like this addition to my setup.
Will need to play with the group thing though :slight_smile:

4 Likes

It would be great if we can add the logging as a debug option.

Sometimes I like to add more entities into the yaml file since it requires a reboot before actually adding them into the svg file. It would be great to have the missing svg entries be optional.

Maybe a
Warnings: entry in the yaml?

1 Like

Yep, warnings: is now an option in the config. GitHub repo updated to cater for this.

2 Likes

In my configuration.yaml I have the following -

binary_sensor:

  • platform: mqtt
    state_topic: “home-assistant/window/contact”

How would I go about visualising this sensor in floorplan?