Floorplan for Home Assistant

Is possible to control cover and show the position in floorplan ?
Thanks, Alberto

Good evening,
I managed the management of the shutters !!

But I have another problem !!
how can I view the weather icons.
When I insert a rectangle that refers to the darksky I see a half-icon hidden in a case position on the planimetry and not in the rectangle.
What can I do ?
Thanks, Alberto

You probably have solved this by now but this is done in the CSS file. This is mine:

.light-off {
  fill: #E0E0EB !important;
}

.light-on {
  fill: #FFFF99 !important;
}

Then in the floorplan.yaml

        - name: Lights
          entities:
             - light.pantry
             
          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

I got a problem with CSS I don’t see any changes in icons when I click and check my css
I don’t understand why. like the “fill” not recognized.
any suggestions?
I am on hassio 0.99.3

Untitled

I’ve got a PHP script that I pull the images off the BOM site and then animate them. Currently just in a new window from a link in the side panel. Let me know if you want the script.

I have a bunch of GU10 bulbs (Innr brand) in a group linked to a Hue hub. In my floorplan I have been using a touch on the room to TOGGLE the lights. However I have found that sometimes I have a light which gets out of sync and stays on.

I found this thread Automation to toggle light and decided to try and implement it in floorplan.yaml as follows:

        - name: Toggle meals room lights
          entities: 
            - light.meals_room
          states:
            - state: 'on'
              class: 'light-on'
            - state: 'off'
              class: 'light-off'
          action:                             # https://community.home-assistant.io/t/automation-to-toggle-light/54795
            service_template: >
              light.{% if is_state('light.meals_room', 'on') %}turn_off{% else %}turn_on{% endif %}

BUT instead of just turning on or off the lights it is popping up a dialog box for me to do it. I have checked in the template editor and everything looks ok. Anybody who can enlighten me as to why this isn’t just working as before. That is, turning the lights on and off based on the existing state?
EDIT: After much testing I can only conclude service_template doesn’t work in floorplan?

I have worked out how to get the service_template info in the file ha-floorplan.html but I can’t work out how to parse the template to get the result. If anyone has any ideas then please let me know. I’m actually a bit surprised no one has wanted to use a service_template before…? Here is my main thread where I have asked for help:

@ccostan, I was looking at your setup and noticed you have a sensor for Disney Circle. I’ve never seen anyone integrate it with HA, so I’d love to see how you used it.

I’m trying to implement the floorplan_speaker custom component and am getting error:

Platform error media_player.floorplan_speaker - Integration ‘floorplan_speaker’ not found.

My configuration.yaml is setup for the integration as below:

media_player:
  - platform: spotify
    client_id: !secret spotify_client_id
    client_secret: !secret spotify_client_secret
  - platform: onkyo
    host: 192.168.1.46
    name: Basement
  - platform: floorplan_speaker
    name: floorplan

I’ve checked the permissions on floorplan_speaker.py. It seems right:

I’m running HASS.io 0.101.3 on a RPi 3B+.

Does anyone have any thoughts on what I can check next?

Hi @Kayhold. My sensor for Circle is basically just a ping sensor to make sure it is still online. We also do some notifications when a new device is found by HA to remind us to add to circle. But the integration is pretty minimal.

1 Like

Looking for advice. I recently upgraded my HA from something like 0.93 to 101.x (.3 now) and I am having an issue with a previous floorplan iteration.

I had:

     - name: Sensors
       entities:
          - sensor.hallsensor_temperature
          - sensor.thermostat_temperature_current
          - sensor.bedroom_temperature
          - sensor.lr_temperature
          - sensor.bathroom_temperature
          - sensor.sanctum_temperature
          - sensor.office_temperature
          - sensor.bd_sensor_temperature
       text_template: '${entity.state ? entity.state : "unknown"}'
       class_template: '
         var temp = parseFloat(entity.state.replace("°", ""));
         if (temp < 65)
           return "temp-low";
         else if (temp < 75)
           return "temp-medium";
         else
           return "temp-high";
        '

I don’t care much about the temp css stuff but do want the “°”. I tried multiple versions of:

        - element: sensor.garage_temperature
          entity: sensor.garage_temperature
          more_info: true
          class_template: 'var temp = parseFloat(entity.state.replace("°", ""))'
          text_template: '${entity.state ? entity.state : "unknown"}'
        - element: sensor.master_bedroom_temperature
          entity: sensor.master_bedroom_temperature
          more_info: true
          text_template: '${entity.state}'

---- and none worked. Got anything from complete errors to no-change.

Any ideas?

1 Like

Hi, hoping someone can help… I have an inkscape produced svg floorplan, with object id’s mapped to home assistant entity ID’s. If i toggle the status of the devices, i can see floor plan re-acting as expected. However, when i click on the floor plan, nothing happens… I have added actions for each entity but nothing… any help will be greatly appreciated

I want to add media player (lg tv) to the floor plan. Switch, light, alarm successfully added. Someone can write an example. Thank you

text_template: '${entity.state ? Math.round(entity.state) + "°" : "undefined"}'
Small modification of the Github example.

Replicate the rules actions from https://github.com/pkozul/lovelace-floorplan/tree/master/www/floorplan/examples/simple
That worked for me.

2 Likes

I got it working… I had multiple entities in the same layer. As soon as moved each entity item to its own layer it worked fine

1 Like

Thank you @Saturnus - worked like a charm!

Hey there, so here’s a css template I made to allow for hue and saturation filters mapped to light entities. If you also use blend mode lighten, you can even control each light individually (if you render an image for each light)

hi Ron, how did you configure the temperature and humidity inside those rooms?

Found it… just add text in inkscape, click right mouse button on the text, select object properties and fill in the entity id at the id field.
image

Does anyone has an idea how to get the unit_of_measurement correct behind every sensor? I did found a line ( text_template: '${entity.state ? entity.state + "°C" : "undefined"}' ) wich will set for example degree C for all sensors, but not all sensors display degrees. There are also humidity and barometric pressure sensors. I just can’t get it right.

 - type: 'custom:floorplan-card'
    icon: 'mdi:floor-plan'
    id: system
    title: Floorplan
    panel: true
   # aspect_ratio: 70%   #does not work..
   # height: 100%   #does not work..
    badges: []
    cards:
      - config: null
        image: /local/floorplan/examples/simple/simple.svg?v=1.1.14
        rules:
          - entities:
              - binary_sensor.floorplan
              - binary_sensor.main_bedroom
              - binary_sensor.living_area
              - binary_sensor.double_garage
              - sensor.temperature1
              - sensor.temperature2
              - sensor.temperature3
              - sensor.temperature4
              - sensor.temperature5
              - sensor.temperature6
              - sensor.humidity1
              - sensor.humidity2
              - sensor.humidity3
              - sensor.humidity4
              - sensor.humidity5
              - sensor.humidity6
              - sensor.barometer1
              - sensor.barometer2
              - sensor.barometer3
              - sensor.barometer4
              - sensor.barometer5
              - sensor.barometer6
              - sensor.iaq1
            text_template: '${entity.state ? entity.state + "°C" : "undefined"}'
        states:
          - class: binary-sensor-off
            state: 'off'
          - class: binary-sensor-on
            state: 'on'
        stylesheet: /local/floorplan/examples/simple/simple.css?v=1.1.14
        type: 'custom:floorplan-card'
        svg: {}