Creating a Smart Home Floorplan: A Step-by-Step Guide

In this tutorial, we'll walk through the process of creating an interactive smart home floorplan using Sweet Home 3D and Home Assistant. This advanced method allows you to visualize the state of your smart home devices in a clean, intuitive layout.

Step 1: Creating the Floorplan in Sweet Home 3D

  1. Download Sweet Home 3D from their website (free version available).
  2. Draw your floorplan using the wall tool and rough measurements of your home.
  3. Add furniture and decor from the built-in library or import custom assets.
  4. Place light fixtures, ensuring they're at the correct elevation:
  5. Set all lights to 0% brightness initially.
  6. In the 3D view, find an angle that shows all devices you want to be able to control.
  7. Right-click and select "Store Point of View" to save this angle.
  8. Create your base photo:
  9. Save this image as your "Base" image.
  10. For each light:
  11. To create an "open garage" effect:

Step 2: Setting Up in Home Assistant

  1. Upload all images to your Home Assistant instance (e.g., in the www folder).

  2. Create a new panel dashboard called "Floorplan" or "Floorplan Test".

  3. Add a new card using the Manual card type.

  4. Use the provided custom code as a template.

    New dashboard code:

    views:
      - title: Floorplan
        type: panel
        path: first
        badges: []
        cards:
          - type: horizontal-stack
            cards:
              - type: picture-elements
                image: /local/
                panel: true
                elements:
                  - type: image
                    entity: <entity>
                    style:
                      left: 50%
                      top: 50%
                      width: 100%
                      mix-blend-mode: lighten
                      filter: >-
                        ${ "hue-rotate(" +
                        (states[‘entity’].attributes.hs_color ?
                        states[‘entity’].attributes.hs_color[0] : 0) +
                        "deg)"}
                      opacity: >-
                        ${states[‘entity’].state === 'on' ?
                        (states[‘entity’].attributes.brightness / 255)
                        : '0'}
                    state_image:
                      'on': /local/
                      'off': /local/
                    tap_action:
                      action: none
    
                  - type: state-icon
                    entity: <entity>
                    style:
                      left: 5%
                      top: 55%
                      opacity: 
                    tap_action:
                      action: toggle
    

Step 6: Configuring the Floorplan Card