This is a short guide to creating your own floorplan-file, based on your own home.
Recommended resources:
- Inkscape for editing your floorplan
- the Noun Project for neat looking custom icons
Download, install and open Inkscape.
I've set the size of my floorplan-file to match the resolution of a full-screen iPad Air (1024x768).
- Click File > Document Properties
- Ensure the top right corner says "px" as display units. There is another one under "Custom size" that should also read "px".
- Set the width and height of Orientation/custom size to 1024 by 768.
- Make sure scale = 1
- Set view box x, y, width and height to: 0, 0, 1024, 768.
- Close the document properties and save the file as floorplan.svg
Start drawing your house/apartment using rectangles. Add two placeholders for lights using the circle tool (or download and insert more classy looking ones from the Noun Project). Also add a text string that we will be using for showing the temperature. These steps have been taken in the image below.
To link an object in the floorplan-file to Home Assistant, you first set its object id to the name of the entity in Home Assistant. There are two lights: light.hall_1
and light.hall_2
as well as a temperature sensor sensor.forecastio_apparent_temperature
.
- To link an entity, right click one of the circles and select "Object properties". You will see something along "ID: xzyy3212".
- Set the ID to light.hall_1 as shown in the image below. Click "Set".
- Click outside of the circle and click inside it again and make sure Inkscape hasn't added "_" to the end of the ID.
- Do the same for the other light and also with the text.
Add the following lines to your floorplan.yaml file:
- name: temp_forecastio
entities:
- sensor.forecastio_apparent_temperature
text_template: '${entity.state ? Math.ceil(entity.state) + "°": "undefined"}'
class_template: 'return "static-temp";'
- name: Lights
entities:
- light.hall_1
- light.hall_2
states:
- state: 'on'
class: 'light-on'
- state: 'off'
class: 'light-off'
Upload and overwrite the floorplan.svg file with your own, customized, file.
You need to do this in order to pick up the changes you made to the floorplan.yaml-file.