Hi, I have a custom sidebar that I want to reuse inside picture elements
light-view.yaml:
views:
- title: Light view
path: lights
icon: "mdi:lightbulb-group"
theme: lovelace-blue-blur
panel: true
cards:
- type: picture-elements
image: "/local/floorplan/primary/transarent.png"
theme: clear
elements:
- !include sidebar.yaml
- type: custom:button-card
icon: mdi:layers
size: 50%
color: "#f45f45"
styles:
card:
- background: none
- box-shadow: none
- width: 5vw
- height: 5vw
style:
top: 5%
left: 97%
sidebar.yaml:
type: image
image: "/local/floorplan/primary/sidebarbg.png"
style:
height: 100%
left: 7%
top: 50%
width: 23.4765625%
opacity: 0.2
hold_action:
action: none
tap_action:
action: none
type: state-label
entity: sensor.time
style:
color: "#ffffff"
font-size: 5.41vw
font-weight: 200
left: 2.7%
letter-spacing: "-0.05vw"
max-width: 1px
top: 10%
opacity: 0.7
hold_action:
action: none
tap_action:
action: none
When i’m tying to do it this way, light-view.yaml picks up only the last element (type: state-label)
If I try to remove (-) from - !include sidebar.yaml
and add (-) in front of both type elements like this: - type
, it manages to find all the elements in the sidebar.yaml file, but then I can’t have more elements in light-view.yaml as I did with - type: custom:button-card
How can I solve this? Starting to wonder if I’m thinking completely wrong about how .yaml components should be reused…
Cheers