Lovelace mapping not allowed for glance card?

I’m using 0.75.2 and keep getting the following error:

mapping values are not allowed here in "/config/ui-lovelace.yaml", line 54, column 17

I’m using the custom tap action example on: https://home-assistant-lovelace-gallery.netlify.com/#demo-hui-glance-card

Below is the code. The offending line according to the error is the tap_action line (there are other cards working fine that I didn’t copy/paste here), and for the life of me, I can’t find the issue since my code looks identical to the example. Can anyone help?

- type: glance
        title: First Floor
        
        entities:
          - switch.driveway
          - switch.front_porch
            tap_action: toggle
          - switch.back_porch
          - light.kitchen_sink
          - switch.great_room
          - switch.office_fan
          - alarm_control_panel.simplisafe

From the example:

- type: glance
  entities:
    - entity: lock.kitchen_door
      tap_action: toggle
    - entity: light.ceiling_lights
      tap_action: call-service
      service: light.turn_on
    - device_tracker.demo_paulus
    - media_player.living_room
    - sun.sun
    - cover.kitchen_window
    - light.kitchen_lights

Please take one more look at it. :slightly_smiling_face:

EDIT: Sorry, wrong example, but the look is the same.

- type: glance
        title: First Floor # TOO MANY INDENTS, SHOULD BE IN LINE WITH THE WORD TYPE IN TOP LINE 
        
        entities: # TOO MANY INDENTS, SHOULD BE IN LINE WITH THE WORD TYPE IN TOP LINE 
          - switch.driveway 
          - switch.front_porch 
            tap_action: toggle
          - switch.back_porch
          - light.kitchen_sink
          - switch.great_room
          - switch.office_fan
          - alarm_control_panel.simplisafe

For those of you who didn’t see it, I wasn’t using the additional “entity:” at the beginning of each line in which I needed to add the tap_action. Seems like an odd design to require me to put entity: in front of a list of entities, but that’s how it’s designed and that was my issue.

1 Like

good catch. Yes, but that is covered in the docs and is a requirement for all of yaml when dealing with lists of objects.

Just take a look at services. When you list services inside an action, every listed service item requires a keyword.