Floorplan for Home Assistant

Still trying to get my floorplan up and running again. I have reverted to the default files from the repo and I am getting the following error which continually repeats:

Uncaught ReferenceError: moment is not defined
URL: http://192.168.1.165:8123/local/custom_ui/floorplan/ha-floorplan.html
Line: 163, column: 36
Error: {}

In the past I have found fleeting reference to this issue from others but nothing has helped me. I have reverted to the repo files as I said and cleared the cache by SHIFT-F5 but still the problem. Help?!

seems to be something to do with this:

// Store the time difference between the local web browser and the Home Assistant server
if (data.event && data.event.time_fired) {
let lastEventFiredTime = moment(data.event.time_fired).toDate();
this.timeDifference = moment().diff(moment(lastEventFiredTime), ‘milliseconds’);
}

Thanks I have sorted it. Somehow the files got corrupted when I pulled them down. Those errors are fixed.

I’m running into the same issue. Have you solved it?

I haven’t done exhaustive tests, but it seems to be much more reliable on Android. I haven’t found any configuration that keeps the Floorplan/Kiosk on Fire working properly.

I wasn’t able to resolve my issue. the icon just won’t show up in the rect I’ve created for it

No, I decided to move on to lovelace and work on implementing it there

Hi guys, is anyone else experiencing the ame problem with running floorplan in full screen since the button “<” got replaced with the hamburger button ON the top blue bar? I have set it up so when I load the Floorplan, the top blue bar hides away to make space to the floorplan then I used to click the “<” button to colapse the menu to the left , then with an F11 in Chrome have a nice full screen of my Floorplan. Now just having the hamburger button it is useless as when I load Floorplan the blue bar hides away with the button so I can no longer collapse the left menu… any thoughts on how to overcome this in Chrome? (Hass.io v 0.76.2 ) Thanks

Really like the look of this!

How do you do the isometric view? I’ve done my floor plan, but I’m not sure how to achieve this. Is this in SVG format?

Yup, I have the same problem. I couldn’t figure out a work around, so I rolled back to an earlier rev that still had the “<“ button. I’d be very interested in any other ideas for dealing with this.

I’ve just found a workaround right now. Try this:

  1. Go to Overview menu item
  2. Click on the hamburger icon to collapse the menu
  3. Head to the browser and type your link to HASS (mine is https) followed by “/floorplan” i.e https://hassio:8123/floorplan
  4. If in Chrome F11
  5. Enjoy

One day there might be an easier way.

Yeah, I had the same issue with my wall mounted tablet.
I simply call the floorplan directly via http://ha_ip_adress:port/floorplan
to get rid of the hamburger menu :wink:

Error after upgrade hass to latest version 0.77.3. When I click to floorplan I can see only first picture (can not click on it)?

ERRORS:
http://hass:8123/local/custom_ui/state-card-custom-ui.html:1:6099 Uncaught TypeError: Cannot read property ‘LOGIC_STATE_ATTRIBUTES’ of undefined

http://hass:8123/local/custom_ui/state-card-custom-ui.html:1:20198 Uncaught TypeError: Polymer.mixinBehaviors is not a function

http://hass:8123/local/custom_ui/state-card-custom-ui.html:1:13969 Uncaught ReferenceError: StateCardDisplay is not defined

i can not open my floorplan ,what it is the error?

Since the new authentication module my floorplan needs username and password everytime I reboot my display. Anyone got it working with chrome kiosk auto logging in? What am I missing?

Any good way to open up the map tab if you hit a icon on floorplan? Maybe in a window like with camera links?

I was having issues with floorplan. I kept getting a blank screen, so I’ve updated to the latest floorplan (version 1.0.13) and HA (version 0.77.3). This got floorplan to show up again.

However, I now have the issue where I constantly get the ‘more info’ dialog when I click on a room / light. I didn’t get this before.

I’m using floorplan as a custom panel. I know using ‘input_text’ fixes this, but how do I do this when using floorplan as a custom panel? This is basically my floorplan configuration:

panel_custom:
  - name: floorplan
    sidebar_title: Floorplan
    sidebar_icon: mdi:floor-plan
    url_path: floorplan
    webcomponent_path: !secret floorplan.path
    config:
      name: Floorplan
      image: /local/custom_ui/floorplan/floorplan.svg
      stylesheet: /local/custom_ui/floorplan/floorplan.css
      warnings:
      groups:
        - name: Light
          entities:
            - sensor.floorplan_living_room
          states:
            - state: 'on'
              class: 'layer-off'
            - state: 'off'
              class: 'layer-on'
        ...

Im having several issues which have stumped me. I believe they are fairly newb issues and should be simple to solve so hoping to get some help here. Ill post my issues first and then my code below and also voice my appreciation now for any help you guys provide! Thank you!!!

edit: trying to get it to format properly so you guys arent disgusted with me :smiley:

  1. Using examples from the floorplan GitHub i have the weather icon and temperature to be posted on the floorpan.
    1-A. The icons are svg, but appear different sizes in different browsers and are usually too small to be effective.
    1-B. The temperature text is not displaying. The background changes appropriately, and hover shows the temperature and i can click to view the sensor, but other than that the area is blank. Ill attempt to add a screenshot.

  2. I would like to show the moon phase icon and pihole sensor and weather card as well, but none are appearing. Again hover shows them and i can click on them to view details, same as issue 1, but no visual.

Code and screenshots:
floorpan.yaml

name: Floorplan
image: /local/custom_ui/floorplan/floorplan.svg
stylesheet: /local/custom_ui/floorplan/floorplan.css
# warnings: 
# These options are optional
# warnings:                  # enable warnings (to find out why things might ot be working correctly)
# pan_zoom:                  # enable experimental panning / zooming
# hide_app_toolbar:          # hide the application toolbar (when used as a custom panel)
# date_format: DD-MMM-YYYY   # Date format to use in hover-over text

last_motion_entity: sensor.template_last_motion
last_motion_class: last-motion

groups:
  - name: Sensors
    entities:
      - sensor.dark_sky_temperature
    text_template: '${entity.state ? entity.state : "unknown"}'
    # An example of rounding up a number, i.e. a temperature of 90.1 becomes 91
    text_template: '${entity.state ? entity.state : "unknown"}¡F'
    class_template: '
      var temp = parseFloat(entity.state.replace("¡", ""));
      if (temp < 33)
        return "temp-very-low";
      else if (temp > 32 && temp < 69)
        return "temp-low";
      else if (temp > 68 && temp < 90)
        return "temp-nice";
      else if (temp > 89 && temp < 100)
        return "temp-high";
      else
        return "temp-very-high";
      '

  - name: Fans
    entities:
      - fan.ge_14287_fan_control_switch_level
      - fan.ge_14287_fan_control_switch_level_3
    states:
      - state: 'on'
        class: 'fan-on'
      - state: 'off'
        class: 'fan-off'
    action:
      domain: homeassistant   # This optional parameter allows you to use other services such as homeassistant.toggle like here.
      service: toggle

  - name: Lights
    entities:
      - switch.ge_14292_inwall_smart_toggle_switch_switch
      - switch.ge_14292_inwall_smart_toggle_switch_switch_2 
      - switch.ge_14292_inwall_smart_toggle_switch_switch_3
      - switch.ge_14292_inwall_smart_toggle_switch_switch_4
      - switch.ge_14292_inwall_smart_toggle_switch_switch_5
      - switch.ge_14292_inwall_smart_toggle_switch_switch_6
      - switch.ge_14292_inwall_smart_toggle_switch_switch_7
      - switch.ge_14292_inwall_smart_toggle_switch_switch_8
      - switch.ge_14292_inwall_smart_toggle_switch_switch_9
      - switch.hank_hkzwso03_smart_plug_switch_3
      - switch.hank_hkzwso03_smart_plug_switch_2
      - light.ge_14295_inwall_smart_toggle_dimmer_level
    states:
      - state: 'on'
        class: 'light-on'
      - state: 'off'
        class: 'light-off'
    action:
      domain: homeassistant   # This optional parameter allows you to use other services such as homeassistant.toggle like here.
      service: toggle

  - name: Switches
    entities:
       - switch.doorbell
    states:
      - state: 'on'
        class: 'doorbell-on'
      - state: 'off'
        class: 'doorbell-off'

  - name: Alarm Panel
    entities:
       - alarm_control_panel.alarm
    states:
      - state: 'armed_away'
        class: 'alarm-armed'
      - state: 'armed_home'
        class: 'alarm-armed'
      - state: 'disarmed'
        class: 'alarm-disarmed'

  - name: Binary sensors
    entities:
      - binary_sensor.front_hallway
      - binary_sensor.kitchen
      - binary_sensor.master_bedroom
      - binary_sensor.theatre_room
    states:
      - state: 'off'
        class: 'info-background'
      - state: 'on'
        class: 'warning-background'
    state_transitions:
      - name: On to off
        from_state: 'on'
        to_state: 'off'
        duration: 10

  - name: Cameras
    entities:
      - camera.hallway
      - camera.driveway
      - camera.front_door
      - camera.backyard
    states:
      - state: 'idle'
        class: 'camera-idle'

  - name: TV
    entities:
      - media_player.samsung_living_room
    states:
      - state: 'on'
        class: 'tv-on'
      - state: 'off'
        class: 'tv-off'
  - name: PiHole
    entities:
      - sensor.pihole_ads_blocked_today

  - name: Moon
    entities:
      - sensor.moon

  - name: Dark Sky Weather
    entities:
      - weather.dark_sky

  - name: Dark Sky Sensors
    entities:
      - sensor.dark_sky_icon
    image_template: '
      var imageName = "";

      switch (entity.state) {
        case "clear-day":
          imageName = "day";
          break;

        case "clear-night":
          imageName = "night";
          break;

        case "partly-cloudy-day":
          imageName = "cloudy-day-1";
          break;

        case "partly-cloudy-night":
          imageName = "cloudy-night-1";
          break;

        case "cloudy":
          imageName = "cloudy";
          break;

        case "rain":
          imageName = "rainy-1";
          break;

        case "snow":
          imageName = "snowy-1";
          break;
      }

      return "/local/icons/weather_icons/animated/" + imageName + ".svg";
      '

  - name: people
    entities:
      - device_tracker.girl
      - device_tracker.guy
    text_template: '${entity.state ? entity.state : "unknown"}'
    class_template: '
      if (entity.state == "home")
        return "clear-foreground";
      else
        return "graying-foreground";
      '

floorplan.css

/* SVG shapes */

svg, svg * {
  vector-effect: non-scaling-stroke !important;
  pointer-events: all !important;
}

/* Hover over */

.entity:hover {
  stroke: #03A9F4 !important;
  stroke-width: 1px !important;
  stroke-opacity: 1 !important;
}

/* Bootstrap succsss */

.success-text {
  fill: #3c763d !important;
}

.success-background, .success-text-background {
  fill: #dff0d8 !important;
  fill-opacity: 1 !important;
  stroke: #d6e9c6 !important;
  stroke-width: 1px !important;
}

/* Bootstrap info */

.info-text {
  fill: #31708f !important;
}

.info-background, .info-text-background {
  fill: #d9edf7 !important;
  fill-opacity: 1 !important;
  stroke: #bce8f1 !important;
  stroke-width: 1px !important;
}

/* Bootstrap warning */

.warning-text {
  fill: #8a6d3b !important;
}

.warning-background, .warning-text-background  {
  fill: #fcf8e3 !important;
  fill-opacity: 1 !important;
  stroke: #faebcc !important;
  stroke-width: 1px !important;
}

/* Bootstrap danger */

.danger-text {
  fill: #a94442 !important;
}

.danger-background, .danger-text-background {
  fill: #f2dede !important;
  fill-opacity: 1 !important;
  stroke: #ebccd1 !important;
  stroke-width: 1px !important;
}

/* Last motion entity */

.last-motion {
  stroke: #808080 !important;
  stroke-width: 1px !important;
  stroke-opacity: 1 !important;
}

/* Alarm Panel */

.alarm-disarmed {
  fill: #3c763d !important;
}

.alarm-armed {
  fill: #8a6d3b !important;
}

/* Camera */

.camera-idle {
/*  fill: #B9CEF7 !important; */
  fill: #6FAECE !important;
}

/* Light */

.light-off {
  fill: #757070 !important;
  fill-opacity: 1 !important;
}

.light-on {
  fill: #f9f936 !important;
  opacity: 1 !important;
  fill-opacity: 1 !important;
}

/* Doorbell */

.doorbell-off {
  fill: #C3B7F4 !important;
}

.doorbell-on {
  fill: #F8D2B9 !important;
}

/* Temperature sensor */

.temp-very-low {
  fill: #6133FF !important;
  fill-opacity: 1 !important;
}

.temp-low {
  fill: #3396FF !important;
  fill-opacity: 1 !important;
}

.temp-nice {
  fill-opacity: 1 !important;
}
.temp-nice-text {
  font-family: Helvetica !important;
  font-size: 22px !important;
}
.temp-nice-background {
  fill: #33FFF6 !important;
}

.temp-high {
  fill: #FFB833 !important;
  fill-opacity: 1 !important;
}

.temp-very-high {
  fill: #FF7433 !important;
  fill-opacity: 1 !important;
}

/* Media player */

.squeezebox-off {
  fill: #8AA8A7 !important;
}

.squeezebox-on {
  fill: #2baaa6 !important;
}

@-webkit-keyframes rotation {
		from {
				-webkit-transform: rotate(0deg);
		}
		to {
				-webkit-transform: rotate(359deg);
		}
}

#fan\.ge_14287_fan_control_switch_level_3, #fan\.ge_14287_fan_control_switch_level {
  transform-origin: center;
}

.fan-on {
  fill: #ff8a65 !important;
  transform-origin:  center;
  transform-box: fill-box;
  -webkit-animation: rotation 2s infinite linear;
  opacity: 1 !important;
}

.fan-off {
  fill: #424242 !important;
}

.graying-foreground {
  opacity: 0 !important;  
}

.clear-foreground {
  opacity: 1 !important;
}

thank you ; this is great idea
i have a question
i want buy raspberry with a screen ; is it possible to show the floor plan only in the screen and control lights ON/OFF ?

Hi,

I followed all the instructions to put a second floorplan on the side panel, but it only shows the main floorplan, the second one with the modified html file didn’t work, although it works if I set it as a custom card.

The only difference I see is the next text:

   <script>
      Polymer({
        is: 'ha-panel-groundfloor',

This is how it appears on your repo:

<script>
     class HaPanelFloorplan extends Polymer.Element {
     static get is() { return 'ha-panel-floorcontrol'; }

Any help would be appreciated