Sorry, truncated
# lovelace_gen
{% set activities = [
{'entity':'switch.xbox_one', 'color': 'rgba(14, 122, 13)', 'template': '../templates/remote_icon_button.yaml'},
{'entity':'switch.ps4', 'color': 'rgba(102, 92, 190)', 'template': '../templates/remote_icon_button.yaml'},
{'entity':'switch.roku', 'color': 'rgba(105, 58, 147)', 'template': '../templates/remote_image_button.yaml', 'image': '/local/images/roku.png'},
{'entity':'switch.switch', 'color': 'rgba(228, 0, 15)', 'template': '../templates/remote_icon_button.yaml'},
{'entity':'switch.tv', 'color': 'var(--button-card-light-color)', 'template': '../templates/remote_icon_button.yaml'},
] %}
{% set roku_apps = [
{'entity':'switch.netflix', 'color': 'rgba(216, 31, 38)', 'image': '/local/images/netflix.png'},
{'entity':'switch.hbo_now', 'color': 'rgba(255, 255, 255)', 'image': '/local/images/hbo_now.png'},
{'entity':'switch.hulu', 'color': 'rgba(28, 231, 131)', 'image': '/local/images/hulu.png'},
{'entity':'switch.prime_video', 'color': 'rgba(0, 168, 225)', 'image': '/local/images/prime_video.png'},
{'entity':'switch.disney_plus', 'color': 'rgba(8, 213, 238)', 'image': '/local/images/disney_plus.png'},
{'entity':'switch.plex', 'color': 'rgba(229, 160, 13)', 'image': '/local/images/plex.png'},
] %}
{% set volume_btns = [
{},
{'entity': 'sensor.active_media_player', 'service': 'script.multizone_cycle_zone'},
{'entity': 'script.multizone_volume_up', 'name': 'Up', 'icon': 'mdi:volume-plus','repeat': 250},
{'entity': 'script.multizone_volume_down', 'name': 'Down', 'icon': 'mdi:volume-minus','repeat': 250},
{'entity': 'script.multizone_volume_mute', 'name': 'Mute', 'icon': 'mdi:volume-mute'},
] %}
{% set controls = [
{'entity': 'sensor.active_media_player', 'service': 'script.multizone_cycle_zone'},
{'entity': 'binary_sensor.remote_living_room_rewind' },
{'entity': 'binary_sensor.remote_living_room_play' },
{'entity': 'binary_sensor.remote_living_room_pause' },
{'entity': 'binary_sensor.remote_living_room_fastforward' },
{'entity': 'script.multizone_volume_up', 'icon': 'mdi:volume-plus','repeat': 250},
{'entity': 'binary_sensor.remote_living_room_back' },
{'entity': 'binary_sensor.remote_living_room_directionup' },
{'entity': 'binary_sensor.remote_living_room_homebutton' },
{'entity': 'binary_sensor.remote_living_room_menubutton' },
{'entity': 'script.multizone_volume_down', 'icon': 'mdi:volume-minus','repeat': 250},
{'entity': 'binary_sensor.remote_living_room_directionleft' },
{'entity': 'binary_sensor.remote_living_room_ok' },
{'entity': 'binary_sensor.remote_living_room_directionright' },
{},
{'entity': 'script.multizone_volume_mute', 'icon': 'mdi:volume-mute'},
{'entity': 'binary_sensor.remote_living_room_lowerleft' },
{'entity': 'binary_sensor.remote_living_room_directiondown' },
{'entity': 'binary_sensor.remote_living_room_lowerright' },
{},
] %}
{% set controller_buttons = [
{'entity': 'binary_sensor.remote_living_room_bottombutton' },
{'entity': 'binary_sensor.remote_living_room_rightbutton' },
{'entity': 'binary_sensor.remote_living_room_topbutton' },
{'entity': 'binary_sensor.remote_living_room_leftbutton' },
{},
]%}
{% set sources = [
{'entity':'switch.xbox_source', 'color': 'rgba(14, 122, 13)', 'template': '../templates/remote_icon_button.yaml'},
{'entity':'switch.playstation_source', 'color': 'rgba(102, 92, 190)', 'template': '../templates/remote_icon_button.yaml'},
{'entity':'switch.roku_source', 'color': 'rgba(105, 58, 147)', 'template': '../templates/remote_image_button.yaml', 'image': '/local/images/roku.png'},
{'entity':'switch.nintendo_switch_source', 'color': 'rgba(228, 0, 15)', 'template': '../templates/remote_icon_button.yaml'},
{'entity':'switch.alexa_source', 'color': 'rgba(49, 196, 243)', 'template': '../templates/remote_icon_button.yaml'},
] %}
{% set surround_modes = [
{'entity': 'switch.surround_mode_sci_fi', 'name': 'Sci Fi', 'sound_mode':'Sci-Fi', 'icon': 'mdi:rocket',},
{'entity': 'switch.surround_mode_7ch_stereo', 'name': 'Music', 'sound_mode':'7ch Stereo', 'icon': 'mdi:music',},
{'entity': 'switch.surround_mode_standard', 'name': 'Standard', 'sound_mode':'Standard', 'icon': 'mdi:filmstrip',},
{'entity': 'switch.surround_mode_surround_decoder', 'name': 'Surround Sound', 'sound_mode':'Surround Decoder', 'icon': 'mdi:surround-sound-7-1',},
{'entity': 'switch.surround_mode_adventure', 'name': 'Adventure', 'sound_mode':'Adventure', 'icon': 'mdi:account-cowboy-hat',},
{'entity': 'switch.surround_mode_drama', 'name': 'Drama', 'sound_mode':'Drama', 'icon': 'mdi:drama-masks',},
{'entity': 'switch.surround_mode_action_game', 'name': 'Action', 'sound_mode':'Action Game', 'icon': 'mdi:pistol',},
{'entity': 'switch.surround_mode_roleplaying_game', 'name': 'Roleplaying', 'sound_mode':'Roleplaying Game', 'icon': 'mdi:auto-fix',},
{'entity': 'switch.surround_mode_sports', 'name': 'Sports', 'sound_mode':'Sports', 'icon': 'mdi:basketball',},
] %}
title: Remote
path: remote
icon: mdi:remote-tv
cards:
- type: vertical-stack
cards:
- type: horizontal-stack
cards:
- !include '../templates/spacer_edge.yaml'
- !include
- '../templates/remote_main_button.yaml'
- entity: switch.poweroff
name: Harmony
color: rgba(228, 94, 101)
- !include
- '../templates/remote_zone_button.yaml'
- entity: media_player.onkyo
name: Zone 1
color: rgba(228, 94, 101)
- !include
- '../templates/remote_zone_button.yaml'
- entity: media_player.onkyo_zone_2
name: Zone 2
color: rgba(228, 94, 101)
- !include '../templates/spacer_edge.yaml'
- type: horizontal-stack
cards:
- !include '../templates/spacer_edge.yaml'
{%- for activity in activities %}
- !include
- {{ activity.template }}
- entity: {{ activity.entity }}
color: {{ activity.color }}
{%- if activity.image is defined %}
image: {{ activity.image }}
{%- endif %}
{%- endfor %}
- !include '../templates/spacer_edge.yaml'
- type: conditional
conditions:
- entity: switch.roku
state: 'on'
card:
type: horizontal-stack
cards:
- !include '../templates/spacer_edge.yaml'
{%- for app in roku_apps %}
- !include
- '../templates/remote_image_button.yaml'
- entity: {{ app.entity }}
color: {{ app.color }}
image: {{ app.image }}
{%- endfor %}
- !include '../templates/spacer_edge.yaml'
- type: conditional
conditions:
- entity: binary_sensor.onkyo_receiver
state: 'on'
- entity: binary_sensor.remote_living_room_control
state_not: 'on'
- entity: switch.alexa_source
state_not: 'on'
card: !include '../templates/active_media_player_volume_row.yaml'
- type: conditional
conditions:
- entity: binary_sensor.remote_living_room_control
state: 'on'
card:
type: vertical-stack
cards:
{%- for i in range(controls | length) %}
{%- set control = controls[i] %}
{%- if i % 5 == 0 %}
- type: horizontal-stack
cards:
- !include '../templates/spacer_edge.yaml'
{%- endif %}
{%- if 'entity' in control %}
{%- if 'service' not in control %}
{%- set service = control.entity.replace('binary_sensor','script') %}
{%- else %}
{%- set service = control.service %}
{%- endif %}
- !include
- '../templates/remote_icon_service.yaml'
- entity: {{ control.entity }}
service: {{ service }}
{%- if control.entity == 'sensor.active_media_player' %}
icon: '!include ../partials/active_media_player_icon.yaml'
{%- else %}
{%- if 'icon' in control %}
icon: {{ control.icon }}
{%- endif %}
{%- endif %}
{%- else %}
- !include '../templates/spacer_button.yaml'
{%- endif %}
{%- if i % 5 == 4 %}
- !include '../templates/spacer_edge.yaml'
{%- endif %}
{%- endfor %}
- type: conditional
conditions:
- entity: sensor.harmony_activity
state_not: 'PowerOff'
- entity: sensor.harmony_activity
state_not: 'Switch'
- entity: sensor.harmony_activity
state_not: 'TV'
- entity: sensor.harmony_activity
state_not: 'Roku'
card:
type: horizontal-stack
cards:
- !include '../templates/spacer_edge.yaml'
{%- for btn in controller_buttons %}
{%- if btn %}
{%- set service = btn.entity.replace('binary_sensor','script') %}
- !include
- '../templates/remote_image_service.yaml'
- entity: {{ btn.entity }}
service: {{ service }}
{%- else %}
- !include '../templates/spacer_button.yaml'
{%- endif %}
{%- endfor %}
- !include '../templates/spacer_edge.yaml'
- type: conditional
conditions:
- entity: switch.alexa_source
state: 'on'
- entity: media_player.living_room_dot
state_not: 'off'
card:
type: horizontal-stack
cards:
- !include '../templates/spacer_edge.yaml'
- !include
- '../templates/media_player_custom.yaml'
- entity: media_player.living_room_dot
bluetooth: switch.floating_outlet_switch
- !include '../templates/spacer_edge.yaml'
- type: conditional
conditions:
- entity: binary_sensor.onkyo_receiver
state: 'on'
card:
type: horizontal-stack
cards:
- !include '../templates/spacer_edge.yaml'
{%- for source in sources %}
- !include
- {{ source.template }}
- entity: {{ source.entity }}
color: {{ source.color }}
{%- if source.image is defined %}
image: {{ source.image }}
{%- endif %}
{%- endfor %}
- !include '../templates/spacer_edge.yaml'
- type: conditional
conditions:
- entity: binary_sensor.onkyo_receiver
state: 'on'
card:
type: horizontal-stack
cards:
- !include '../templates/spacer_edge.yaml'
{%- for sound in surround_modes %}
- !include
- '../templates/remote_icon_button.yaml'
- entity: {{ sound.entity }}
icon: {{ sound.icon }}
{%- endfor %}
- !include '../templates/spacer_edge.yaml'