Mapping values are not allowed here in "/home/homeassistant/.homeassistant/ui-lovelace.yaml

Hi all,

Just tried my frist steps with Lovelace and for some reason I keep getting the following error:

mapping values are not allowed here in “/home/homeassistant/.homeassistant/ui-lovelace.yaml”, line 30, column 17

The line producing that error is:
icon: mdi:temperature-celsius

All other Icon lines produce the same error. However I already tried a name: instead of icon:, still the same problem.

Any ideas?

title: Title
views:
     # Specify a tab icon if you want the view tab to be an icon.
  - icon: mdi:home-assistant
    # Title of the view. Will be used as the tooltip for tab icon
    title: Home
    id: home
    theme: dark-mode
    cards:
        # Entities card will take a list of entities and show their state.
      - type: entities
        # Title of the entities card
        title: Lichter
        # The entities here will be shown in the same order as specified.
        # Each entry is an entity ID or a map with extra options.
        entities:
          - light.wohnzimmerlicht_boden
          - light.wohnzimmerlicht_decke
          - light.schlafzimmerlicht
          - light.esszimmerlicht_2
          - light.gastezimmerlicht_2
          - switch.osramplug1

        # The markdown card will render markdown text.
      - type: glance
        title: Wohnzimmerklima
        show_name: false
        entities:
          - sensor.bme680_temperature
            icon: mdi:temperature-celsius
          - sensor.bme680_iaq
            icon: mdi:chart-bubble
          - sensor.bme680_humidity
            icon: mdi:water-percent
          - sensor.bme680_pressure
            icon: mdi:balloon

If you put the title line first, then the icon line?

So something like this:

title: Home
views:

  - title: default_view
    icon: mdi:home

and see if the error goes.

I notice all the icons have underscores or dashes, do you still get the error if you use icons without either of those. Also I didn’t think the mdi icons name convention used undescores, thought they were all dashes.

The error is produced further down in line 30, the title was working fine. Also initially I didn’t have any icons, but names, but this produced the same error. So the error is in all of those lines respectively:

  - type: glance
    title: Wohnzimmerklima
    show_name: false
    entities:
      - sensor.bme680_temperature
        icon: mdi:temperature-celsius # <--- Error is produced here. name: Temperature produces the same error

Aha, think I see it, change that by adding ‘entity’ to all the sensor lines, so:

  - type: glance
    title: Wohnzimmerklima
    show_name: false
    entities:
      - entity: sensor.bme680_temperature
        icon: mdi:temperature-celsius

Ah damn it, such an easy error :smiley: For some reason YAML is really good at hiding syntax errors…Thanks!

Is including entity: documented anywhere? I have never seen that and never used icons in my Lovelace file… I use customize for that.

Using it in Lovelace lets you override the icon set elsewhere. Not sure why you would want to…

Actually I suspect the Lovelace yaml is going to do away with groups and customize but the docs are a bit light on. Will be nice when Lovelace is out of beta as then I think it will be more clear. 0.84 I think Lovelace will be the default.

I use customize like that too, sometimes though it can be meaningful to change icons depending on the group, tab or purpose for the information.

Plus it’s handy to have the icon set within lovelace rather than check the customize.yaml which I’ve let grow to a huge size at this stage.

Reminds me as well… the other reason to use Lovelace instead of customize is that when you edit Lovelace you don’t need to restart home assistant to see the changes… that is a big benefit of Lovelace.

1 Like

Oh yeah, how did I forget to mention that!

Won’t miss the customize.yaml if that’s where we’re all going with lovelace, and I hope we are :slight_smile:

1 Like