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.
Upload all images to your Home Assistant instance (e.g., in the www folder).
Create a new panel dashboard called "Floorplan" or "Floorplan Test".
Add a new card using the Manual card type.
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