I'm stuck at the beginning of home_simple. ERROR /local/floor plan/home simple/home simple.css?_=

I can’t get past this part, it seems to me that the system can’t read the CSS file or the SVG file.
ERROR /local/floor plan/home simple/home simple.css?_=1690925319635: Error fetching resource (See console for more info)
To test it, I tried changing the path of the files inside the yaml from /local/floorplan/home_simple to /config/www/floorplan/home_simple.

But the error changes to "WARNING CONFIG Cannot find ‘light.hueXYZ_light’ in Home Assistant entities " which is normal because I don’t have this entities registered, however the image that appears is of the Home Assistant Logo and not the image from the example that comes inside 1_getting_started_with_ha-floorplan

After all, is the /local path an alias for /config/www?
I spent like 12 hours behind the solution lol :sweat_smile:

Welcome. I’m sure we can help you out!

First I notice in the original error there are spaces in the URL. is that right? /local is mapped by HA to /config/www so that should work. You have it working with the long form of the url though which is good.

The CSS file is just the style rules to be used with the SVG. If you aren’t seeing an image then that indicates your SVG can’t be loaded. If you paste in and format with the </> button your YAML then we can see more about what might be going wrong.

One thing to try with these issues is put the path to your files in your browser address bar and you should see them appear. If they don’t then you either have the wrong path, the file doesn’t exist or there is a permission problem.

The spaces were a mistake at the time of posting.
My YAML is a copy of the first example found on ha-floorplan’s github.

title: Anton Floorplan
views:
  - title: Sample Entities
    path: sample-entities
    icon: ''
    badges: []
    cards:
      - type: entities
        entities:
          - entity: light.hueXYZ_light
            name: Test Light 1 (light.hue1)
          - entity: light.hue2_light
            name: Test Light 2 (light.hue2)
        title: Test Entities
  - title: My First Floorplan
    path: floorplan
    theme: Google Dark Theme
    panel: true
    type: panel
    badges: []
    cards:
      - config:
          console_log_level: info
          defaults:
            hover_action: hover-info
            tap_action: more-info
          image: /local/floorplan/home_simple/home_simple.svg
          log_level: info
          rules:
            - element: light.hue1
              entity: light.hueXYZ_light
              state_action:
                action: call-service
                service: floorplan.image_set
                service_data: >-
                  /config/www/floorplan/home_simple/home_simple/light_${entity.state}.svg
              tap_action: toggle
            - element: light.hue1.button
              entity: light.hueXYZ_light
              state_action:
                action: call-service
                service: floorplan.class_set
                service_data: button-${entity.state}
              tap_action:
                action: call-service
                service: homeassistant.toggle
            - element: light.hue1.text
              entity: light.hueXYZ_light
              state_action:
                action: call-service
                service: floorplan.text_set
                service_data: ${entity.state}
              tap_action: false
          stylesheet: /config/www/floorplan/home_simple/home_simple.css
        full_height: true
        type: custom:floorplan-card

Note that I changed the CSS path to /config/www/ and kept the SVG path /local/

I believe I should start by correcting the fact that HA does not find the /local/ folder, because if I change the SVG path to /config/www/ it can read the file, but without showing the image.

How do I fix the /local/ link to work?

Captura de tela 2023-08-02 062643

When I use the path /local/floorplan/home_simple/home_simple.svg

And when I use the path /config/www/floorplan/home_simple/home_simple.svg

Are you running HAOS?

I’m running on a Rapisberry Pi and installed it following the instructions in this url Raspberry Pi - Home Assistant

image

I am not sure why the local mapping is not working. Let’s not worry about that for now. Change the paths to /config/www

It looks like in one screen capture you provided that you are trying to edit the floorplan in the GUI. Make sure you are only editing the raw yaml.

You could have a caching problem. Try Shift-F5 or better yet if using Chrome open the developer tools, selectt the network tab and ensure disable cache is selected and then keeping that open refresh the page.

If it still doesn’t work put this in your address bar http://<YOUR_HA_IP>:8123/local/floorplan/home_simple/home_simple.svg and you should see the basic floorplan

I did a fresh install of HAOS on VMWare and the path /local/ was found, with that everything worked perfectly.

Still on VMWare, I changed the path to /config/www/ and the same error happened with the Rapisberry Pi server, so I came to the conclusion that it is necessary to have the link /local/ working.

Do you have any tips for me to fix this? Or should I reinstall everything from scratch?

OMG! I restarted the raspberry and everything worked!

HAOS needs this to map the /local/ folder.

Great. Glad you sorted it out. Have fun setting up your floorplan.

I was experiencing almost the exact symptoms that this post described. Turns out, my *.css file was empty, and needed at least one newline added. Everything showed after that. Yikes, hours lost to the void.

1 Like