Files
N22/dashboards/views/04c_madplan.yaml
T

697 lines
18 KiB
YAML

title: Madplan
path: madplan
icon: mdi:chef-hat
cards:
# 🍽️ Dagens ret - stort fremhævet kort med link til Mealie
- type: custom:button-card
entity: sensor.dagens_aftensmad
show_icon: true
show_name: true
show_state: true
icon: mdi:food-variant
name: I dag
tap_action:
action: url
url_path: >
[[[
var slug = states['sensor.dagens_aftensmad_slug'].state;
if (slug && slug !== '' && slug !== 'unknown') {
return 'https://mealie.anneclaus.dk/g/home/r/' + slug;
}
return 'https://mealie.anneclaus.dk';
]]]
styles:
card:
- padding: 16px
- background: var(--primary-color)
- border-radius: 12px
icon:
- color: white
- width: 40px
name:
- font-size: 13px
- color: "rgba(255,255,255,0.7)"
- text-transform: uppercase
- letter-spacing: 1px
state:
- font-size: 22px
- font-weight: bold
- color: white
- padding-top: 4px
# 🎵 Musik i køkken + Vi laver mad + Der er mad
- type: grid
columns: 2
square: false
cards:
- type: button
name: Musik i køkken
icon: mdi:music-note-outline
tap_action:
action: call-service
service: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "1 Family Mix"
- type: button
name: Vi laver mad
icon: mdi:chef-hat
tap_action:
action: call-service
service: script.vi_laver_mad
- type: button
name: Der er mad!
icon: mdi:silverware-fork-knife
tap_action:
action: call-service
service: script.mad_announcement
# 📅 Madplan: i dag + 6 dage
- type: markdown
content: |-
{%- set ns = namespace(rows="") -%}
{%- set items = state_attr('sensor.mealie_madplan_ugen', 'items') or [] -%}
{%- set days = ['Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag','Søndag'] -%}
{%- for offset in range(7) -%}
{%- set day = now().date() + timedelta(days=offset) -%}
{%- set ms = items | selectattr('date', 'eq', day.isoformat()) | list -%}
{%- set m = ms[0] if ms else none -%}
{%- set recipe = m.recipe if m else none -%}
{%- set name = recipe.name if recipe else '' -%}
{%- set slug = recipe.slug if recipe else '' -%}
{%- set label = 'I dag' if offset == 0 else days[day.weekday()] -%}
{%- if slug -%}
{%- set ns.rows = ns.rows + "| **" + label + "** | [" + name + "](https://mealie.anneclaus.dk/g/home/r/" + slug + ") |\n" -%}
{%- elif name -%}
{%- set ns.rows = ns.rows + "| **" + label + "** | " + name + " |\n" -%}
{%- else -%}
{%- set ns.rows = ns.rows + "| **" + label + "** | - |\n" -%}
{%- endif -%}
{%- endfor -%}
## Næste 7 dage
| Dag | Ret |
| --- | --- |
{{ ns.rows }}
# 🎵 Sonos Køkken
- type: media-control
entity: media_player.kokken
name: Sonos Køkken
- type: grid
columns: 2
square: false
cards:
- type: custom:button-card
name: Volumen ned
icon: mdi:volume-minus
tap_action:
action: perform-action
perform_action: media_player.volume_down
target:
entity_id: media_player.kokken
hold_action:
action: perform-action
perform_action: media_player.volume_down
target:
entity_id: media_player.kokken
styles:
card:
- height: 72px
- font-size: 16px
- background: var(--primary-color)
icon:
- color: white
- width: 36px
name:
- color: white
- font-size: 13px
- type: custom:button-card
name: Volumen op
icon: mdi:volume-plus
tap_action:
action: perform-action
perform_action: media_player.volume_up
target:
entity_id: media_player.kokken
hold_action:
action: perform-action
perform_action: media_player.volume_up
target:
entity_id: media_player.kokken
styles:
card:
- height: 72px
- font-size: 16px
- background: var(--primary-color)
icon:
- color: white
- width: 36px
name:
- color: white
- font-size: 13px
- type: grid
columns: 3
square: false
cards:
- type: custom:button-card
name: DR P3
icon: mdi:radio
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "0 DR P3"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Family Mix
icon: mdi:account-music
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "1 Family Mix"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Danske fav.
icon: mdi:music-note
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "Danske favoritter"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Rock klassikere
icon: mdi:music-note-outline
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "Danske rock klassikere"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Anne Mix 1
icon: mdi:playlist-music
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "Anne Daily Mix 1"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Anne Mix 2
icon: mdi:playlist-music
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "Anne Daily Mix 2"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Anne Mix 3
icon: mdi:playlist-music
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "Anne Daily Mix 3"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Anne Mix 4
icon: mdi:playlist-music
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "Anne Daily Mix 4"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Anne Mix 5
icon: mdi:playlist-music
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "Anne Daily Mix 5"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Anne Mix 6
icon: mdi:playlist-music
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "Anne Daily Mix 6"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Claus Mix 1
icon: mdi:playlist-music
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "Claus Daily Mix 1"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Claus Mix 2
icon: mdi:playlist-music
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "Claus Daily Mix 2"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Claus Mix 3
icon: mdi:playlist-music
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "Claus Daily Mix 3"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Claus Mix 4
icon: mdi:playlist-music
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "Claus Daily Mix 4"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Claus Mix 5
icon: mdi:playlist-music
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "Claus Daily Mix 5"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Claus Mix 6
icon: mdi:playlist-music
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "Claus Daily Mix 6"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Andreas Mix 1
icon: mdi:playlist-music
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "Andreas Daily Mix 1"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Andreas Mix 2
icon: mdi:playlist-music
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "Andreas Daily Mix 2"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Andreas Mix 3
icon: mdi:playlist-music
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "Andreas Daily Mix 3"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Andreas Mix 4
icon: mdi:playlist-music
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "Andreas Daily Mix 4"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Andreas Mix 5
icon: mdi:playlist-music
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "Andreas Daily Mix 5"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Andreas Mix 6
icon: mdi:playlist-music
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "Andreas Daily Mix 6"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Daniel Mix 1
icon: mdi:playlist-music
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "Daniel Daily Mix 1"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Daniel Mix 2
icon: mdi:playlist-music
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "Daniel Daily Mix 2"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Daniel Mix 3
icon: mdi:playlist-music
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "Daniel Daily Mix 3"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Daniel Mix 4
icon: mdi:playlist-music
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "Daniel Daily Mix 4"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Daniel Mix 5
icon: mdi:playlist-music
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "Daniel Daily Mix 5"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px
- type: custom:button-card
name: Daniel Mix 6
icon: mdi:playlist-music
tap_action:
action: perform-action
perform_action: media_player.select_source
target:
entity_id: media_player.kokken
data:
source: "Daniel Daily Mix 6"
styles:
card:
- height: 52px
- padding: 6px 8px
icon:
- width: 18px
name:
- font-size: 11px