Hallo,
ich steh grad etwas aufm Schlauch. Ich wollte diese Anzeige
Wenn man draufklickt hätte ich gerne die Ansicht im Popup.
So sieht meine Aktuelle YAML aus.
type: custom:mushroom-template-card
primary: >-
Nächste Abholung: {{ states.sensor.nachste_abholung.attributes.values() |
first | replace("PapierTonne", "Papier") | replace("GelberSack", "Gelber
Sack") | replace("Restmuell", "Restmüll") | replace("Christbaumabfuhr",
"Weihnachtsbäume") }}
secondary: >-
{# No german date variables, so we make our own #}
{% set wochentage = ["Montag", "Dienstag", "Mittwoch", "Donnerstag",
"Freitag", "Samstag", "Sonntag"] %}
{# Don't actually need the months in this code #}
{% set monate = ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli",
"August", "September", "Oktober", "November", "Dezember"] %}
{# Get the next pickup date #}
{% set next_pickup = states.sensor.nachste_abholung.attributes | first |
as_timestamp |timestamp_custom("%d.%m.%Y") %}
{# Get the next pickup date, MINUS the day #}
{% set next_pickup_date_str = states.sensor.nachste_abholung.attributes |
first | as_timestamp |timestamp_custom(", der %d.%m.%y") %}
{# Get todays date #}
{% set todays_date = now().timestamp() | timestamp_custom('%d.%m.%Y') %}
{# Convert the dayname to an INT #}
{% set next_wochentag = states.sensor.nachste_abholung.attributes | first |
as_timestamp |timestamp_custom("%w")| int %}
{# Is there a pickup today, then show todays date #}
{% if next_pickup == todays_date %}
Abholung heute!!
{# No pickup today, so show next pickup date #}
{% else %}
{{ wochentage[ next_wochentag - 1 ] }}{{ next_pickup_date_str }} (Heute: {{ todays_date }})
{% endif %}
icon: >-
{% set next_pickup = states.sensor.nachste_abholung.attributes | first |
as_timestamp |timestamp_custom("%d.%m.%Y") %}
{% set todays_date = now().timestamp() | timestamp_custom('%d.%m.%Y') %}
{% if next_pickup == todays_date %}
mdi:truck-fast
{% else %}
mdi:trash-can-outline
{% endif %}
layout: vertical
badge_color: ""
badge_icon: ""
icon_color: >-
{% set next_pickup = states.sensor.nachste_abholung.attributes | first |
as_timestamp |timestamp_custom("%d.%m.%Y") %}
{% set todays_date = now().timestamp() | timestamp_custom('%d.%m.%Y') %}
{% if next_pickup == todays_date %}
green
{% else %}
#990000
{% endif %}
hold_action:
action: none
double_tap_action:
action: none
entity: sensor.nachste_abholung
tap_action:
action: navigate
navigation_path: /dashboard-wandtablet/muellabfuhren
fill_container: false
grid_options:
columns: full
multiline_secondary: false
card_mod:
style: |
{% set next_pickup = states.sensor.abfallnaechster.attributes | first |
as_timestamp |timestamp_custom("%d.%m.%Y") %}
{% set todays_date = now().timestamp() | timestamp_custom('%d.%m.%Y') %}
{% if next_pickup == todays_date %}
ha-card {
--ha-card-border-radius: 6px;
--ha-card-border-color: green;
--ha-card-border-width: 2px;
--card-mod-icon-color: white;
mushroom-shape-icon {
--shape-color: green !important;
--shape-color-disabled: none !important;}
}
ha-state-icon {
animation: 2s vroom infinite;
}
@keyframes vroom {
49% { opacity: -150;}
50% { transform: translate(22px); opacity: -100; }
51% { transform: translate(-22px); opacity: -100; }
52% { opacity: -150; }
}
{% else %}
ha-card {
--ha-card-border-radius: 6px;
--ha-card-border-color: #990000;
--ha-card-border-width: 2px;
--card-mod-icon-color: white;
mushroom-shape-icon {
--shape-color: #990000 !important;
--shape-color-disabled: none !important;}
}
{% endif %}
Aus anderen Dashboards hab ich entnohmen dass man es mit “Navigieren” lösen kann
Bei mir switch damit nur auf diese Ansicht.
Wo ist mein Fehler?