Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
--tile-info-primary-font-size: 30px;
--tile-info-secondary-font-size: 30px;
Neu
--tile-info-primary-font-size: 20px;
--tile-info-secondary-font-size: 20px;
Kann man das nicht untereinander schreiben?Warmwasser-Vorlauf und Warmwasser-Rücklauf
ha-tile-info$: |
.info {
width:100%;
flex-flow: row nowrap !important;
align-items: center !important;
justify-content: space-between !important;
--tile-info-primary-font-size: 20px;
--tile-info-secondary-font-size: 20px;
--tile-info-secondary-color: #000;
--tile-info-secondary-font-weight: 500;
}
@media (min-width: 750px) {
.info {
--tile-info-primary-font-size: 30px;
--tile-info-secondary-font-size: 30px;
}
}
@media untereinander setzen, musst aber die Reihenfolge beachten, was zuletzt steht und zutreffend ist wird genommen.
type: custom:button-card
entity: water_heater.dhw1
name: Warmwasser
icon: mdi:thermometer
show_icon: true
show_name: true
show_state: true
layout: grid
styles:
grid:
- grid-template-areas: "\"i n s\""
- grid-template-columns: 30px 1fr auto
- grid-template-rows: 1fr
- align-items: center
card:
- height: 50px
- border-radius: 16px
- padding: 8px 14px
- transition: background-color 0.3s ease
- background-color: |
[[[
const t = entity?.attributes?.current_temperature;
if (t < 51) return 'rgba(255, 0, 0, 0.9)'; // Rot unter 51 °C
if (t >= 51) return 'rgba(0, 150, 0, 1)'; // Grün ab 51 °C
return 'var(--card-background-color)';
]]]
img_cell:
- grid-area: i
- justify-self: start
- align-self: center
icon:
- color: |
[[[
const t = entity?.attributes?.current_temperature;
if (t < 51) return 'rgba(0, 150, 0, 0.9)'; // Rot unter 51 °C
if (t >= 51) return 'rgba(250, 0, 0, 1)'; // Grün ab 51 °C
return 'var(--card-background-color)';
]]]
- width: 26px
- height: 26px
name:
- grid-area: "n"
- justify-self: start
- align-self: center
- font-size: 1.4em
- font-weight: 600
- padding-left: 8px
state:
- grid-area: s
- justify-self: end
- align-self: center
- font-size: 1.6em
- font-weight: 700
- white-space: nowrap
state_display: |
[[[
const t = entity?.attributes?.current_temperature;
if (t === null || t === undefined) return "—";
return t.toFixed(1) + " °C";
]]]
Dazu übrigens noch einen alternativen Lösungsansatz, Du kannst angeben, dass der Bereich der die Temperatur enthält eine gewisse Breite nicht unterschreiten darf und der mangelnde Platz sich nur auf die Beschriftung auswirkt:die Temperatur nur teilweise auf dem Handy

#info > span:nth-child(2) {
flex-basis: 110px;
flex-shrink: 0;
}