To get the floorplan working in full screen mode (as a custom panel), you need to do the following:
Copy the HTML file to this location:
<path_to_home_assistant>/panels/floorplan.html
In the HTML file, change line 6 to this:
<dom-module id="ha-panel-floorplan">
And change line 24 to this:
is: 'ha-panel-floorplan',
In the HTML file’s onReady()
function, you need to create the this.stateObj
JSON object and copy your existing floorplan config, which means it needs to be ‘hard coded’ for now (until HA adds support for supplying these as attributes via the custom panel config - as we can already do for custom state cards):
onReady() {
if (!this.stateObj) {
this.stateObj = {
attributes: {
floorplan_image: "/local/custom_ui/floorplan/floorplan.svg",
password: "<some_password_here>",
stylesheet: "/local/custom_ui/floorplan/floorplan.css",
color_on: "#F8B9BE",
color_off: "#C4EDB1",
track_duration: 10,
last_motion_entity: "sensor.template_last_motion",
entities: [
"camera.front_door",
"light.kitchen",
"switch.doorbell",
"binary_sensor.front_hallway",
"binary_sensor.back_hallway",
"binary_sensor.kitchen",
"binary_sensor.master_bedroom",
"binary_sensor.theatre_room"
]
}
};
}
To get HA to display the panel, add the following to your HA configuration:
panel_custom:
- name: floorplan
sidebar_title: Floorplan
sidebar_icon: mdi:home
url_path: floorplan
And that’s it. After restarting HA, you should see a new ‘Floorplan’ menu item in the left sidebar. Selecting that menu item will display the floorplan such that it takes up the entire available space on the right. Collapsing the left sidebar will give you full screen mode.
As I mentioned above, it would be great if HA allowed you to configure the floorplan options within the panel_custom
section of the config. I will raise this as a suggestion. If that gets implemented, then we can remove the ‘hard coded’ JSON object from the HTML file.
In any case, at least this is a working solution. With very minimal effort, you can get your floorplan displaying as a custom panel.