-
type: custom:mod-card
card:
type: custom:button-card
entity: sensor.station_meteo_temperature
show_name: false
show_state: true
icon: |
[[[
const t = Number(entity.state);
if (t < 0) return "mdi:snowflake";
if (t < 10) return "mdi:thermometer-low";
if (t < 25) return "mdi:thermometer";
if (t < 32) return "mdi:thermometer-high";
return "mdi:fire";
]]]
styles:
card:
- width: 80px
- height: 80px
- border-radius: 50%
- padding: 10px
- font-family: sans-serif
- overflow: hidden
icon:
- position: absolute
- top: 6%
- width: 26px
- height: 26px
- color: var(–icon-color)
- filter: drop-shadow(0 0 6px rgba(0,0,0,0.4))
- animation: var(–icon-animation)
state:
- position: absolute
- top: 58%
- font-size: 13px
- font-weight: 700
- color: var(–text-color)
- text-shadow: 0 0 1px rgba(0,0,0,0.2)
card_mod:
style: |
ha-card {
{% set lux = states('sensor.luxmetre_illuminance') | float(0) %}
{% set sun = states('sun.sun') %}
{% set night = lux < 10 or sun.state == 'below_horizon' %}
{% if night %}
/* 🌙 Mode nuit léger */
filter: brightness(0.9); /* juste un léger assombrissement */
background: linear-gradient(180deg, #1a2a3a, #2c3e50); /* bleu doux */
--text-color: #d0d8e0; /* texte adouci */
--icon-color: #9bb0c4; /* icône légèrement plus froide */
{% endif %}
{% set t = states('sensor.station_meteo_temperature') | float(0) %}
{% if t < -5 %}
/* 🧊 Froid extrême */
background: linear-gradient(180deg, #0f2027, #203a43);
--text-color: #e0f7fa;
--icon-color: #81ecec;
--icon-animation: frost 3s infinite ease-in-out;
{% elif t < 0 %}
/* ❄️ Gel */
background: linear-gradient(180deg, #1e3c72, #2a5298);
--text-color: #ecf0f1;
--icon-color: #74b9ff;
--icon-animation: frost 4s infinite ease-in-out;
{% elif t < 5 %}
/* 🥶 Très froid (bleu froid clair) */
background: linear-gradient(180deg, #6fa3d8, #b6d7f2);
--text-color: #123047;
--icon-color: #2d6cdf;
--icon-animation: none;
{% elif t < 10 %}
/* 🧥 Froid */
background: linear-gradient(180deg, #a1c4fd, #c2e9fb);
--text-color: #2c3e50;
--icon-color: #0984e3;
--icon-animation: none;
{% elif t < 18 %}
/* 🌤 Frais */
background: linear-gradient(180deg, #d4fc79, #96e6a1);
--text-color: #1e272e;
--icon-color: #2ecc71;
--icon-animation: none;
{% elif t < 25 %}
/* 🙂 Tempéré */
background: linear-gradient(180deg, #fdfbfb, #ebedee);
--text-color: #2c3e50;
--icon-color: #f1c40f;
--icon-animation: none;
{% elif t < 32 %}
/* 🌞 Chaud */
background: linear-gradient(180deg, #fceabb, #f8b500);
--text-color: #2c3e50;
--icon-color: #f39c12;
--icon-animation: heat 2.5s infinite ease-in-out;
{% else %}
/* 🔥 Canicule */
background: linear-gradient(180deg, #ff512f, #dd2476);
--text-color: #ffffff;
--icon-color: #ffdd59;
--icon-animation: heat 1.8s infinite ease-in-out;
{% endif %}
}
/* 🌡 Animations */
@keyframes frost {
0% { filter: brightness(1); }
50% { filter: brightness(1.2); }
100% { filter: brightness(1); }
}
@keyframes heat {
0% { transform: scale(1); }
50% { transform: scale(1.08); }
100% { transform: scale(1); }
}
style: |
ha-card {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
width: 100%;
}
-
type: custom:mod-card
card:
type: custom:button-card
entity: sensor.station_meteo_vitesse_du_vent
show_name: false
show_state: true
icon: |
[[[
const wind = Number(entity.state);
const gust = Number(states[‹ sensor.station_meteo_rafale_10m ›]?.state || 0);
if (gust >= 50) return "mdi:weather-windy-variant";
if (gust >= 30) return "mdi:weather-windy";
if (wind >= 15) return "mdi:weather-windy";
return "mdi:weather-cloudy";
]]]
styles:
card:
- width: 80px
- height: 80px
- border-radius: 50%
- padding: 10px
- font-family: sans-serif
- overflow: hidden
icon:
- position: absolute
- top: 8%
- width: 26px
- height: 26px
- color: var(–icon-color)
- filter: drop-shadow(0 0 6px rgba(0,0,0,0.4))
- animation: var(–icon-animation)
state:
- position: absolute
- top: 50%
- font-size: 13px
- font-weight: 700
- color: var(–text-color)
- text-shadow: 0 0 1px rgba(0,0,0,0.2)
custom_fields:
rafale:
- position: absolute
- top: 70%
- left: 50%
- transform: translateX(-50%)
- font-size: 12px
- font-weight: 600
- color: |
[[[
const g = Number(states[‹ sensor.station_meteo_rafale_max_jour ›]?.state || 0);
if (g < 20) return ‹ #95a5a6 ›; // gris doux
if (g < 40) return ‹ #6c8f7d ›; // vert-gris naturel (beaucoup plus discret)
if (g < 60) return ‹ #d68910 ›; // orange plus sourd
return ‹ #c0392b ›; // rouge profond
]]]
- text-shadow: 0 0 1px rgba(0,0,0,0.2)
- text-align: center
custom_fields:
rafale: |
[[[
const gustMax = Number(states[‹ sensor.station_meteo_rafale_max_jour ›]?.state || 0);
return ${Math.round(gustMax)} km/h;
]]]
card_mod:
style: |
ha-card {
{% set lux = states('sensor.luxmetre_illuminance') | float(0) %}
{% set sun = states('sun.sun') %}
{% set night = lux < 10 or sun.state == 'below_horizon' %}
{% if night %}
/* 🌙 Mode nuit léger */
filter: brightness(0.9); /* juste un léger assombrissement */
background: linear-gradient(180deg, #1a2a3a, #2c3e50); /* bleu doux */
--text-color: #d0d8e0; /* texte adouci */
--icon-color: #9bb0c4; /* icône légèrement plus froide */
{% endif %}
{% set wind = states('sensor.station_meteo_vitesse_du_vent') | float(0) %}
{% set gust = states('sensor.station_meteo_rafale_10m') | float(0) %}
{% if wind < 1 %}
/* 🌫 Calme plat */
background: linear-gradient(180deg, #e0eafc, #cfdef3);
--text-color: #2c3e50;
--icon-color: #b2bec3;
{% elif wind < 5 %}
/* 🌬 Très faible */
background: linear-gradient(180deg, #dfe9f3, #ffffff);
--text-color: #2c3e50;
--icon-color: #74b9ff;
{% elif wind < 15 %}
/* 🍃 Brise */
background: linear-gradient(180deg, #a1c4fd, #c2e9fb);
--text-color: #2c3e50;
--icon-color: #0984e3;
{% elif wind < 30 %}
/* 🌬 Vent modéré */
background: linear-gradient(180deg, #6fdcbf, #2ecc71);
--text-color: #0b2e1a;
--icon-color: #1e8449;
{% elif wind < 50 %}
/* 💨 Vent fort */
background: linear-gradient(180deg, #667db6, #485563);
--text-color: #ecf0f1;
--icon-color: #81ecec;
{% else %}
/* 🌪 Tempête */
background: linear-gradient(180deg, #232526, #414345);
--text-color: #ffffff;
--icon-color: #dfe6e9;
{% endif %}
/* 💨 Animation selon rafales */
{% if gust < 10 %}
--icon-animation: none;
{% elif gust < 30 %}
--icon-animation: breeze 4s infinite ease-in-out;
{% elif gust < 50 %}
--icon-animation: gust 3s infinite ease-in-out;
{% else %}
--icon-animation: storm 2s infinite ease-in-out;
{% endif %}
}
/* 🌬 Animations adoucies */
@keyframes breeze {
0% { transform: translateX(0); opacity: 0.95; }
50% { transform: translateX(2px); opacity: 1; }
100% { transform: translateX(0); opacity: 0.95; }
}
@keyframes gust {
0% { transform: translateX(0); }
50% { transform: translateX(3px); }
100% { transform: translateX(0); }
}
@keyframes storm {
0% { transform: translateX(-3px); }
50% { transform: translateX(3px); }
100% { transform: translateX(-3px); }
}
style: |
ha-card {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
width: 100%;
}
-
type: custom:mod-card
card:
type: custom:button-card
entity: sensor.station_meteo_precipitation_journaliere
show_name: false
show_state: true
icon: |
[[[
const daily = Number(entity.state);
const rate = Number(states[‹ sensor.station_meteo_precipitation_par_heure ›]?.state || 0);
if (rate > 0.1) return "mdi:weather-pouring";
if (rate > 0.02) return "mdi:weather-rainy";
if (rate > 0) return "mdi:weather-partly-rainy";
if (daily > 0) return "mdi:weather-cloudy";
return "mdi:weather-cloudy";
]]]
styles:
card:
- width: 80px
- height: 80px
- border-radius: 50%
- padding: 10px
- font-family: sans-serif
- overflow: hidden
icon:
- position: absolute
- top: 6%
- width: 26px
- height: 26px
- color: var(–icon-color)
- filter: drop-shadow(0 0 6px rgba(0,0,0,0.4))
- animation: var(–icon-animation)
state:
- position: absolute
- top: 58%
- font-size: 13px
- font-weight: 700
- color: var(–text-color)
- text-shadow: 0 0 1px rgba(0,0,0,0.2)
card_mod:
style: |
ha-card {
{% set lux = states('sensor.luxmetre_illuminance') | float(0) %}
{% set sun = states('sun.sun') %}
{% set night = lux < 10 or sun.state == 'below_horizon' %}
{% if night %}
/* 🌙 Mode nuit léger */
filter: brightness(0.9); /* juste un léger assombrissement */
background: linear-gradient(180deg, #1a2a3a, #2c3e50); /* bleu doux */
--text-color: #d0d8e0; /* texte adouci */
--icon-color: #9bb0c4; /* icône légèrement plus froide */
{% endif %}
{% set daily = states('sensor.station_meteo_precipitation_journaliere') | float(0) %}
{% set rate = states('sensor.station_meteo_precipitation_par_heure') | float(0) %}
{% if daily == 0 %}
/* ☁️ Sec */
background: linear-gradient(180deg, #757f9a, #d7dde8);
--text-color: #2c3e50;
--icon-color: #636e72;
{% elif daily < 2 %}
/* 🌫 Journée humide */
background: linear-gradient(180deg, #667db6, #485563);
--text-color: #ecf0f1;
--icon-color: #74b9ff;
{% elif daily < 8 %}
/* 🌧 Journée pluvieuse */
background: linear-gradient(180deg, #4b6cb7, #182848);
--text-color: #ecf0f1;
--icon-color: #81ecec;
{% elif daily < 20 %}
/* 🌧🌧 Forte pluie */
background: linear-gradient(180deg, #283048, #859398);
--text-color: #ffffff;
--icon-color: #00cec9;
{% else %}
/* ⛈ Épisode intense */
background: linear-gradient(180deg, #141e30, #243b55);
--text-color: #ffffff;
--icon-color: #0984e3;
{% endif %}
/* 💧 Animation selon intensité instantanée */
{% if rate == 0 %}
--icon-animation: none;
{% elif rate < 0.05 %}
--icon-animation: drizzle 3s infinite ease-in-out;
{% elif rate < 0.10 %}
--icon-animation: rain 1.8s infinite linear;
{% else %}
--icon-animation: rain 0.9s infinite linear;
{% endif %}
}
/* 💧 Animations */
@keyframes drizzle {
0% { transform: translateY(0); opacity: 0.7; }
50% { transform: translateY(2px); opacity: 1; }
100% { transform: translateY(0); opacity: 0.7; }
}
@keyframes rain {
0% { transform: translateY(0); }
100% { transform: translateY(7px); }
}
style: |
ha-card {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
width: 100%;
}
-
type: custom:mod-card
card:
type: custom:button-card
entity: sensor.bain_de_bretagne_pressure
show_name: false
show_state: true
icon: |
[[[
const p = Number(entity.state);
if (p < 990) return "mdi:weather-lightning";
if (p < 1005) return "mdi:weather-windy";
if (p < 1015) return "mdi:weather-cloudy";
if (p < 1025) return "mdi:weather-partly-cloudy";
return "mdi:weather-sunny";
]]]
styles:
card:
- width: 80px
- height: 80px
- border-radius: 50%
- padding: 10px
- font-family: sans-serif
- overflow: hidden
icon:
- position: absolute
- top: 6%
- width: 26px
- height: 26px
- color: var(–icon-color)
- filter: drop-shadow(0 0 6px rgba(0,0,0,0.4))
- animation: var(–icon-animation)
state:
- position: absolute
- top: 58%
- font-size: 13px
- font-weight: 700
- color: var(–text-color)
- text-shadow: 0 0 1px rgba(0,0,0,0.2)
state_display: |
[[[
return Math.floor(Number(entity.state)) + " hPa";
]]]
card_mod:
style: |
ha-card {
{% set lux = states('sensor.luxmetre_illuminance') | float(0) %}
{% set sun = states('sun.sun') %}
{% set night = lux < 10 or sun.state == 'below_horizon' %}
{% if night %}
/* 🌙 Mode nuit léger */
filter: brightness(0.9); /* juste un léger assombrissement */
background: linear-gradient(180deg, #1a2a3a, #2c3e50); /* bleu doux */
--text-color: #d0d8e0; /* texte adouci */
--icon-color: #9bb0c4; /* icône légèrement plus froide */
{% endif %}
{% set p = states('sensor.bain_de_bretagne_pressure') | float(0) %}
{% if p < 990 %}
/* ⛈ Dépression marquée */
background: linear-gradient(180deg, #141e30, #243b55);
--text-color: #ffffff;
--icon-color: #74b9ff;
--icon-animation: pulse 1.2s infinite ease-in-out;
{% elif p < 1005 %}
/* 🌧 Dépression */
background: linear-gradient(180deg, #485563, #29323c);
--text-color: #ecf0f1;
--icon-color: #81ecec;
--icon-animation: drift 3s infinite ease-in-out;
{% elif p < 1015 %}
/* ☁️ Pression normale */
background: linear-gradient(180deg, #757f9a, #d7dde8);
--text-color: #2c3e50;
--icon-color: #636e72;
--icon-animation: none;
{% elif p < 1025 %}
/* 🌤 Haute pression */
background: linear-gradient(180deg, #a1c4fd, #c2e9fb);
--text-color: #1e272e;
--icon-color: #0984e3;
--icon-animation: none;
{% else %}
/* ☀️ Anticyclone */
background: linear-gradient(180deg, #fdfbfb, #ebedee);
--text-color: #2c3e50;
--icon-color: #f1c40f;
--icon-animation: glow 3s infinite ease-in-out;
{% endif %}
}
/* 🌫 Animations */
@keyframes pulse {
0% { transform: scale(1); opacity: 0.9; }
50% { transform: scale(1.08); opacity: 1; }
100% { transform: scale(1); opacity: 0.9; }
}
@keyframes drift {
0% { transform: translateX(0); }
50% { transform: translateX(4px); }
100% { transform: translateX(0); }
}
@keyframes glow {
0% { filter: brightness(1); }
50% { filter: brightness(1.25); }
100% { filter: brightness(1); }
}
style: |
ha-card {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
width: 100%;
}
`