Hallo,
nachdem an anderer Stelle eine Lösung für die Markdown Karte gefunden wurde bin ich auf die folgende Idee gekommen.
Mitteln Button-Cards habe ich 8 verschiedene Karten für Tankstellen nach folgendem Schema angelegt:
type: custom:button-card
entity: sensor.aral_friedrich_ebert_strasse_14_super
show_icon: false
hold_action:
action: more-info
tap_action:
action: toggle
aspect_ratio: 3/1
name: false
show_name: false
show_state: false
styles:
card:
- background-color: "#4e5e78"
- border-radius: 2%
- padding: 5%
- opacity: 0.7
- font: 18px Cooper
- border: 8px double var(--button-card-light-color)
grid:
- grid-template-areas: >
". . . . ." "price street_1 street_1 street_1 ." "price street_2
street_2 street_2 ." "price street_3 street_3 street_3 richtung" "time .
. . km" ". . . . ."
- grid-template-columns: 2fr 1fr 1fr 1fr 1fr
- grid-template-rows: min-content 1fr 1fr 1fr 1fr min-content
custom_fields:
price:
- align-self: start
street_1: null
street_2: null
street_3: null
time:
- justify-self: start
- margin-top: "-35px"
- font-size: 13px
- margin-left: 10px
km:
- align-self: start
- justify-self: start
- margin-top: "-25px"
- font-size: 13px
richtung:
- align-self: start
- justify-self: end
- margin-right: 45px
- margin-top: "-25px"
custom_fields:
price:
card:
type: custom:button-card
name: |
[[[
if (states['sensor.aral_friedrich_ebert_strasse_14_super'].state > 1)
return ` ${states['sensor.aral_friedrich_ebert_strasse_14_super'].state}`;
else
return '0,00';
]]]
styles:
card:
- font-family: "-apple-system, digital-7"
- color: yellow
- font-size: 40px
street_1:
card:
type: custom:button-card
name: >-
[[[ return
`${states['sensor.aral_friedrich_ebert_strasse_14_super'].attributes.brand}`
]]]
styles:
card:
- background-color: transparent
- box-shadow: none
street_2:
card:
type: custom:button-card
name: >-
[[[ return
`${states['sensor.aral_friedrich_ebert_strasse_14_super'].attributes.street}
${states['sensor.aral_friedrich_ebert_strasse_14_super'].attributes.house_number}`
]]]
styles:
card:
- background-color: transparent
- box-shadow: none
street_3:
card:
type: custom:button-card
name: >-
[[[ return
`${states['sensor.aral_friedrich_ebert_strasse_14_super'].attributes.postcode}
${states['sensor.aral_friedrich_ebert_strasse_14_super'].attributes.city}`
]]]
styles:
card:
- background-color: transparent
- box-shadow: none
time: |
[[[
if (states['sensor.aral_friedrich_ebert_strasse_14_super'].state > 1)
return 'Geöffnet';
else
return 'geschlossen';
]]]
km: >-
[[[ return `${states['sensor.mobiltelefon_entfernung_zur_friedrich'].state}
km` ]]]
richtung:
card:
type: custom:button-card
icon: mdi:navigation-variant
name: false
show_name: false
tap_action:
action: navigate
navigation_path: /map
styles:
card:
- background-color: "#242e42"
- height: 25px
- width: 25px
- box-shadow: none
icon:
- width: 15px
Ist es möglich, die Reihenfolge der Karten nach der Preisanzeige (aufsteigend) zu sortieren?
Vielen Dank im Voraus,
Achim