Can anyone help with my YAML Configuration please?

Sorry in advance if I’ve asked this wrong or included stuff I shouldn’t. I’m a bit confused by all of this, but I’m trying :slight_smile:

I have been trying to fix this for way too long… I’m a new user and learning as I go. I’ve read, watched and used AI to try and find a fix, but just find myself going deeper into the rabbit hole

Every thing seems to work, as in will show the state etc on my floorplan, however the only entity (room) I’m able to operate from the floor plan is Dans Light (room)… I tried to adjust the position for each entity/room, but that makes the associated images not aligned…


views:
  - type: panel
    title: Floor Plan
    path: floor-plan
    icon: m3o:home-and-garden
    cards:
      - type: picture-elements
        image: /local/fpbase.svg
        dark_mode_image: /local/fpbase.png
        elements:
          - type: conditional
            conditions:
              - condition: state
                entity: binary_sensor.morning_picture_mode
                state: 'on'
            elements:
              - type: image
                image: /local/fplights/morning.png
                style:
                  width: 100%
            title: Morning Mode
          - type: conditional
            conditions:
              - condition: state
                entity: binary_sensor.afternoon_picture_mode
                state: 'on'
            elements:
              - type: image
                image: /local/fplights/noon.png
                style:
                  width: 100%
            title: Afternoon Mode
          - type: conditional
            conditions:
              - condition: state
                entity: binary_sensor.night_picture_mode
                state: 'on'
            elements:
              - type: image
                image: /local/fplights/evening.png
                style:
                  width: 100%
            title: Night Mode
          - type: conditional
            conditions:
              - condition: state
                entity: light.dans_light
                state: 'on'
            elements:
              - type: image
                entity: light.dans_light
                image: /local/fplights/dan.png
                style:
                  left: 50%
                  top: 50%
                  width: 100%
                tap_action:
                  action: toggle
            title: Dan
          - type: image
            entity: light.dans_light
            image: /local/fplights/blank.png
            style:
              left: 75%
              top: 50%
              width: 100%
            tap_action:
              action: toggle
          - type: conditional
            conditions:
              - condition: state
                entity: light.laundry
                state: 'on'
            elements:
              - type: image
                entity: light.laundry
                image: /local/fplights/laundry.png
                style:
                  left: 0%
                  top: 0%
                  width: 100%
                tap_action:
                  action: toggle
            title: Laundry
          - type: conditional
            conditions:
              - condition: state
                entity: light.garage
                state: 'on'
            elements:
              - type: image
                entity: light.garage
                image: /local/fplights/garage.png
                style:
                  left: 60%
                  top: 90%
                  width: 100%
                tap_action:
                  action: toggle
            title: Garage
          - type: conditional
            conditions:
              - condition: state
                entity: light.coco
                state: 'on'
            elements:
              - type: image
                entity: light.coco
                image: /local/fplights/coco.png
                style:
                  left: 50%
                  top: 70%
                  width: 100%
                tap_action:
                  action: toggle
            title: CoCo
          - type: conditional
            conditions:
              - condition: state
                entity: light.elliss_room_light
                state: 'on'
            elements:
              - type: image
                entity: light.elliss_room_light
                image: /local/fplights/ellis.png
                style:
                  left: 55%
                  top: 30%
                  width: 100%
                tap_action:
                  action: toggle
            title: Ellis
          - type: conditional
            conditions:
              - condition: state
                entity: light.ensuite
                state: 'on'
            elements:
              - type: image
                entity: light.ensuite
                image: /local/fplights/ensuite.png
                style:
                  left: 70%
                  top: 45%
                  width: 100%
                tap_action:
                  action: toggle
            title: Ensuite
          - type: conditional
            conditions:
              - condition: state
                entity: light.lounge
                state: 'on'
            elements:
              - type: image
                entity: light.lounge
                image: /local/fplights/lounge.png
                style:
                  left: 50%
                  top: 30%
                  width: 100%
                tap_action:
                  action: toggle
            title: Lounge
          - type: conditional
            conditions:
              - condition: state
                entity: light.light_front_door
                state: 'on'
            elements: null
            title: Entrance
          - type: conditional
            conditions:
              - condition: state
                entity: light.manaia
                state: 'on'
            elements:
              - type: image
                entity: light.manaia
                image: /local/fplights/manaia.png
                style:
                  left: 50%
                  top: 50%
                  width: 100%
                tap_action:
                  action: toggle
            title: 'Manaia '
          - type: conditional
            conditions:
              - condition: state
                entity: light.darcy
                state: 'on'
            elements:
              - type: image
                entity: light.darcy
                image: /local/fplights/darcy.png
                style:
                  left: 50%
                  top: 50%
                  width: 100%
                tap_action:
                  action: toggle
            title: Darcy
          - type: conditional
            conditions:
              - condition: state
                entity: light.bathroom
                state: 'on'
            elements:
              - type: image
                entity: light.bathroom
                image: /local/fplights/bathroom.png
                style:
                  left: 50%
                  top: 50%
                  width: 100%
                tap_action:
                  action: toggle
            title: Bathroom
          - type: conditional
            conditions:
              - condition: state
                entity: light.office
                state: 'on'
            elements:
              - type: image
                entity: light.office
                image: /local/fplights/office.png
                style:
                  left: 50%
                  top: 50%
                  width: 100%
                tap_action:
                  action: toggle
            title: Office
          - type: conditional
            conditions:
              - condition: state
                entity: light.hallway
                state: 'on'
            elements:
              - type: image
                entity: light.hallway
                image: /local/fplights/hallway.png
                style:
                  left: 50%
                  top: 50%
                  width: 100%
                tap_action:
                  action: toggle
            title: Hallway
theme: synthwave 

https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

Sorry, as mentioned this is still very new to me. I think I may have fix the code, but not sure as I’m not used to using code and/or this format for writing.

To format your code, click on the </> icon and paste your code.

1 Like

Thank you, I have tried to do it that way several times with the same outcome… Not sure if it’s right or not? If it’s not I’ll delete the post and give up trying to work out the problem… Thanks

Don’t delete the post, it looks fine.

I’ve been using Home Assistant for years but never dared to accomplish what you have with the Picture Elements. card. I am jealous

So, as I understand it, Dan’s Room is the only entity where tap_action works?

When only one ‘thing’ works, I look to see how it’s different from other things. What I see is that light.dans_light is the only tap_action that is not in a conditional.

As an experiment, try a different entity, like light.laundry in the block starting at line 60.

If tap_action works on light.laundry, then further investigation into using tap_action in a conditional or elements block.

1 Like

Google “picture elements small tutorial”, particularly about positioning elements, might be useful.

1 Like

Thanks so much. I finally got it working. Not sure how but there’s still a few bugs to sort out, but the lights are working as they should :slight_smile:

Will do thanks

When you’re done, share your YAML file here. It might help others.

1 Like