I have a lovelace yaml dashboard, using # lovelace_gen
.
I have a block inside my yaml where I !include some code.
It looks like this:
custom_actions:
!include
- ../imports/firetv_actions_core.yaml
- media_entity: {{ media_player_entity }}
name: test
and firetv_actions_core.yaml
(abbreviated), looks like this:
- type: button
name: button_4
tap_action: { action: "source", source: "Hulu" }
icon: fapro:samsung-s#fullcolor
- type: button
name: main_home
tap_action: { action: "source", source: "Hulu" }
icon: mdi:home-circle
- type: button
name: red
icon: fapro:firetv#fullcolor
tap_action:
action: perform-action
perform_action: input_select.select_option
target:
entity_id: input_select.selected_media_player
data:
option: FireTV
It works.
BUT - I want to merge/!include another yaml file, with exactly the same structure, but non-overapping list items: my_room.yaml
:
- type: button
name: button_4
tap_action: { action: "source", source: "Hulu" }
icon: fapro:samsung-s#fullcolor
- type: button
name: main_home
tap_action: { action: "source", source: "Hulu" }
icon: mdi:home-circle
I have tried:
custom_actions:
!include
- ../imports/firetv_actions_core.yaml
- media_entity: {{ media_player_entity }}
name: test
!include
- ../imports/my_room.yaml
- media_entity: {{ media_player_entity }}
name: test
But it doesn’t work. I am missing some fundamental understanding. Can anyone help?
FWIW, I could also put both the above !includes into separate json files, but am equally stuck on how to (a) load them, (b) merge them and (c) insert them!. What I want is the two !includes appended. There must be a way – but I can’t figure it out!
When I get through this hurdle, I also want the includes to be driven by variables.
i.e. if location == family room, include A and B, else include A and C.
Ugh. Stuck!