Oui oui mais il vont en inventer encore ou pas
On a plus d’alerte que de prévision simple.
Pas une journée sans que la carte soit jaune c’est fou.
Magnifique, ça fonctionne à merveille !! Merci beaucoup pour le partage !
Hier tout fonctionnait bien, mais j’ai un souci avec l’API. Il demande une durée de validité de la clé API… Donc quand la durée est dépassée, plus moyen de récupérer les informations… Une parade pour ce problème ?
Refaire ton API key
Sinon je ne vois pas autre chose
EDIT : j’ai trouvé mon erreur, j’étais sur le mauvais site API :
METEO FRANCE – PORTAIL DES API au lieu de [Devportal]- WSO2 APIM (meteofrance.fr)
Je viens de la refaire, mais impossibilité de laisser le champ durée vide, donc même souci
Bonjour, pareil j’ai essayé 63072000 secondes, apparemment c’est trop long comme durée. Je vais rester sur meteoalarm
Bonsoir à tous ! Maintenant que les alertes sont bien configurées chez moi, je m’attèle au bulletin texte.
étant un peu novice en JSON, je ne sais pas trop comment récupérer toutes les écritures (0,1,2…) du bloc text dans un seul sensor, exemple sur cette photo :
Un de vous aurait une idée de comment faire ?
solution finale : ne pas utiliser Chrome mais Edge pour se connecter
Bonjour, je suis arrivé à créer l’api et les capteurs.
Seulement, je n’arrive pas à avoir les 2 cartes.
Pouvez vous me donner la bonne configuration à mettre ?
Merci
Voilà mon code de la carte :
type: horizontal-stack
cards:
- type: vertical-stack
cards:
- type: conditional
conditions:
- entity: sensor.meteo_france_alerts_26
state_not: 1
card:
type: custom:button-card
entity_picture: /local/pictures/meteo_france_alert_today.jpg
name: Aujourdhui
aspect_ratio: 4/3
show_entity_picture: true
size: 80%
- type: vertical-stack
cards:
- type: horizontal-stack
cards:
- type: custom:button-card
entity: sensor.meteo_france_alerts_26
name: Vent
aspect_ratio: 4/3
show_state: false
show_icon: true
icon: mdi:weather-windy
size: 100%
styles:
card:
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
name:
- font-size: 0.85em
state:
- font-size: 0.7em
icon:
- color: >
[[[ if (
entity.attributes.today[0].phenomenon_max_color_id == 1
) return 'green'; else if (
entity.attributes.today[0].phenomenon_max_color_id == 2
) return 'yellow'; else if (
entity.attributes.today[0].phenomenon_max_color_id == 3
) return 'orange'; else return 'red'; ]]]
style: |
ha-card {
top: 1px !important;
}
- type: custom:button-card
entity: sensor.meteo_france_alerts_26
name: Pluie
aspect_ratio: 4/3
show_state: false
show_icon: true
icon: mdi:weather-rainy
size: 100%
styles:
card:
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
name:
- font-size: 0.85em
state:
- font-size: 0.7em
icon:
- color: >
[[[ if (
entity.attributes.today[1].phenomenon_max_color_id == 1
) return 'green'; else if (
entity.attributes.today[1].phenomenon_max_color_id == 2
) return 'yellow'; else if (
entity.attributes.today[1].phenomenon_max_color_id == 3
) return 'orange'; else return 'red'; ]]]
style: |
ha-card {
top: 1px !important;
}
- type: custom:button-card
entity: sensor.meteo_france_alerts_26
name: Orage
aspect_ratio: 4/3
show_state: false
show_icon: true
icon: mdi:weather-partly-lightning
size: 100%
styles:
card:
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
name:
- font-size: 0.85em
state:
- font-size: 0.7em
icon:
- color: >
[[[ if (
entity.attributes.today[2].phenomenon_max_color_id == 1
) return 'green'; else if (
entity.attributes.today[2].phenomenon_max_color_id == 2
) return 'yellow'; else if (
entity.attributes.today[2].phenomenon_max_color_id == 3
) return 'orange'; else return 'red'; ]]]
style: |
ha-card {
top: 1px !important;
}
- type: horizontal-stack
cards:
- type: custom:button-card
entity: sensor.meteo_france_alerts_26
name: Innondation
aspect_ratio: 4/3
show_state: false
show_icon: true
icon: mdi:home-flood
size: 100%
styles:
card:
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
name:
- font-size: 0.85em
state:
- font-size: 0.7em
icon:
- color: >
[[[ if (
entity.attributes.today[3].phenomenon_max_color_id == 1
) return 'green'; else if (
entity.attributes.today[3].phenomenon_max_color_id == 2
) return 'yellow'; else if (
entity.attributes.today[3].phenomenon_max_color_id == 3
) return 'orange'; else return 'red'; ]]]
style: |
ha-card {
top: 1px !important;
}
- type: custom:button-card
entity: sensor.meteo_france_alerts_26
name: Neige
aspect_ratio: 4/3
show_state: false
show_icon: true
icon: mdi:weather-snowy
size: 100%
styles:
card:
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
name:
- font-size: 0.85em
state:
- font-size: 0.7em
icon:
- color: >
[[[ if (
entity.attributes.today[4].phenomenon_max_color_id == 1
) return 'green'; else if (
entity.attributes.today[4].phenomenon_max_color_id == 2
) return 'yellow'; else if (
entity.attributes.today[4].phenomenon_max_color_id == 3
) return 'orange'; else return 'red'; ]]]
style: |
ha-card {
top: 1px !important;
}
- type: custom:button-card
entity: sensor.meteo_france_alerts_26
name: Canicule
aspect_ratio: 4/3
show_state: false
show_icon: true
icon: mdi:weather-sunny-alert
size: 100%
styles:
card:
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
name:
- font-size: 0.85em
state:
- font-size: 0.7em
icon:
- color: >
[[[ if (
entity.attributes.today[5].phenomenon_max_color_id == 1
) return 'green'; else if (
entity.attributes.today[5].phenomenon_max_color_id == 2
) return 'yellow'; else if (
entity.attributes.today[5].phenomenon_max_color_id == 3
) return 'orange'; else return 'red'; ]]]
style: |
ha-card {
top: 1px !important;
}
- type: horizontal-stack
cards:
- type: custom:button-card
entity: sensor.meteo_france_alerts_26
name: Froid
aspect_ratio: 4/3
show_state: false
show_icon: true
icon: mdi:snowflake
size: 100%
styles:
card:
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
name:
- font-size: 0.85em
state:
- font-size: 0.7em
icon:
- color: >
[[[ if (entity.attributes.today.length == 7) { if (
entity.attributes.today[6].phenomenon_max_color_id == 1
) return 'green'; else if (
entity.attributes.today[6].phenomenon_max_color_id == 2
) return 'yellow'; else if (
entity.attributes.today[6].phenomenon_max_color_id == 3
) return 'orange'; else return 'red'; } else return
'grey'; ]]]
style: |
ha-card {
top: 1px !important;
}
- type: custom:button-card
entity: sensor.meteo_france_alerts_26
name: Avalanches
aspect_ratio: 4/3
show_state: false
show_icon: true
icon: mdi:snowflake-alert
size: 100%
styles:
card:
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
name:
- font-size: 0.85em
state:
- font-size: 0.7em
icon:
- color: >
[[[ if (entity.attributes.today.length == 8) { if (
entity.attributes.today[7].phenomenon_max_color_id == 1
) return 'green'; else if (
entity.attributes.today[7].phenomenon_max_color_id == 2
) return 'yellow'; else if (
entity.attributes.today[7].phenomenon_max_color_id == 3
) return 'orange'; else return 'red'; } else return
'grey'; ]]]
style: |
ha-card {
top: 1px !important;
}
- type: custom:button-card
entity: sensor.meteo_france_alerts_26
name: Vagues Submersion
aspect_ratio: 4/3
show_state: false
show_icon: true
icon: mdi:waves-arrow-up
size: 100%
styles:
card:
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
name:
- font-size: 0.85em
state:
- font-size: 0.7em
icon:
- color: >
[[[ if (entity.attributes.today.length == 9) { if (
entity.attributes.today[8].phenomenon_max_color_id == 1
) return 'green'; else if (
entity.attributes.today[8].phenomenon_max_color_id == 2
) return 'yellow'; else if (
entity.attributes.today[8].phenomenon_max_color_id == 3
) return 'orange'; else return 'red'; } else return
'grey'; ]]]
style: |
ha-card {
top: 1px !important;
}
- type: vertical-stack
cards:
- type: conditional
conditions:
- entity: sensor.meteo_france_alerts_26
state_not: 1
card:
type: custom:button-card
entity_picture: /local/pictures/meteo_france_alert_tomorrow.jpg
name: Demain
aspect_ratio: 4/3
show_entity_picture: true
size: 80%
- type: vertical-stack
cards:
- type: horizontal-stack
cards:
- type: custom:button-card
entity: sensor.meteo_france_alerts_26
name: Vent
aspect_ratio: 4/3
show_state: false
show_icon: true
icon: mdi:weather-windy
size: 100%
styles:
card:
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
name:
- font-size: 0.85em
state:
- font-size: 0.7em
icon:
- color: >
[[[ if (
entity.attributes.today[0].phenomenon_max_color_id == 1
) return 'green'; else if (
entity.attributes.today[0].phenomenon_max_color_id == 2
) return 'yellow'; else if (
entity.attributes.today[0].phenomenon_max_color_id == 3
) return 'orange'; else return 'red'; ]]]
style: |
ha-card {
top: 1px !important;
}
- type: custom:button-card
entity: sensor.meteo_france_alerts_26
name: Pluie
aspect_ratio: 4/3
show_state: false
show_icon: true
icon: mdi:weather-rainy
size: 100%
styles:
card:
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
name:
- font-size: 0.85em
state:
- font-size: 0.7em
icon:
- color: >
[[[ if (
entity.attributes.today[1].phenomenon_max_color_id == 1
) return 'green'; else if (
entity.attributes.today[1].phenomenon_max_color_id == 2
) return 'yellow'; else if (
entity.attributes.today[1].phenomenon_max_color_id == 3
) return 'orange'; else return 'red'; ]]]
style: |
ha-card {
top: 1px !important;
}
- type: custom:button-card
entity: sensor.meteo_france_alerts_26
name: Orage
aspect_ratio: 4/3
show_state: false
show_icon: true
icon: mdi:weather-partly-lightning
size: 100%
styles:
card:
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
name:
- font-size: 0.85em
state:
- font-size: 0.7em
icon:
- color: >
[[[ if (
entity.attributes.today[2].phenomenon_max_color_id == 1
) return 'green'; else if (
entity.attributes.today[2].phenomenon_max_color_id == 2
) return 'yellow'; else if (
entity.attributes.today[2].phenomenon_max_color_id == 3
) return 'orange'; else return 'red'; ]]]
style: |
ha-card {
top: 1px !important;
}
- type: horizontal-stack
cards:
- type: custom:button-card
entity: sensor.meteo_france_alerts_26
name: Innondation
aspect_ratio: 4/3
show_state: false
show_icon: true
icon: mdi:home-flood
size: 100%
styles:
card:
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
name:
- font-size: 0.85em
state:
- font-size: 0.7em
icon:
- color: >
[[[ if (
entity.attributes.today[3].phenomenon_max_color_id == 1
) return 'green'; else if (
entity.attributes.today[3].phenomenon_max_color_id == 2
) return 'yellow'; else if (
entity.attributes.today[3].phenomenon_max_color_id == 3
) return 'orange'; else return 'red'; ]]]
style: |
ha-card {
top: 1px !important;
}
- type: custom:button-card
entity: sensor.meteo_france_alerts_26
name: Neige
aspect_ratio: 4/3
show_state: false
show_icon: true
icon: mdi:weather-snowy
size: 100%
styles:
card:
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
name:
- font-size: 0.85em
state:
- font-size: 0.7em
icon:
- color: >
[[[ if (
entity.attributes.today[4].phenomenon_max_color_id == 1
) return 'green'; else if (
entity.attributes.today[4].phenomenon_max_color_id == 2
) return 'yellow'; else if (
entity.attributes.today[4].phenomenon_max_color_id == 3
) return 'orange'; else return 'red'; ]]]
style: |
ha-card {
top: 1px !important;
}
- type: custom:button-card
entity: sensor.meteo_france_alerts_26
name: Canicule
aspect_ratio: 4/3
show_state: false
show_icon: true
icon: mdi:weather-sunny-alert
size: 100%
styles:
card:
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
name:
- font-size: 0.85em
state:
- font-size: 0.7em
icon:
- color: >
[[[ if (
entity.attributes.today[5].phenomenon_max_color_id == 1
) return 'green'; else if (
entity.attributes.today[5].phenomenon_max_color_id == 2
) return 'yellow'; else if (
entity.attributes.today[5].phenomenon_max_color_id == 3
) return 'orange'; else return 'red'; ]]]
style: |
ha-card {
top: 1px !important;
}
- type: horizontal-stack
cards:
- type: custom:button-card
entity: sensor.meteo_france_alerts_26
name: Froid
aspect_ratio: 4/3
show_state: false
show_icon: true
icon: mdi:snowflake
size: 100%
styles:
card:
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
name:
- font-size: 0.85em
state:
- font-size: 0.7em
icon:
- color: >
[[[ if (entity.attributes.today.length == 7) { if (
entity.attributes.today[6].phenomenon_max_color_id == 1
) return 'green'; else if (
entity.attributes.today[6].phenomenon_max_color_id == 2
) return 'yellow'; else if (
entity.attributes.today[6].phenomenon_max_color_id == 3
) return 'orange'; else return 'red'; } else return
'grey'; ]]]
style: |
ha-card {
top: 1px !important;
}
- type: custom:button-card
entity: sensor.meteo_france_alerts_26
name: Avalanches
aspect_ratio: 4/3
show_state: false
show_icon: true
icon: mdi:snowflake-alert
size: 100%
styles:
card:
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
name:
- font-size: 0.85em
state:
- font-size: 0.7em
icon:
- color: >
[[[ if (entity.attributes.today.length == 8) { if (
entity.attributes.today[7].phenomenon_max_color_id == 1
) return 'green'; else if (
entity.attributes.today[7].phenomenon_max_color_id == 2
) return 'yellow'; else if (
entity.attributes.today[7].phenomenon_max_color_id == 3
) return 'orange'; else return 'red'; } else return
'grey'; ]]]
style: |
ha-card {
top: 1px !important;
}
- type: custom:button-card
entity: sensor.meteo_france_alerts_26
name: Vagues Submersion
aspect_ratio: 4/3
show_state: false
show_icon: true
icon: mdi:waves-arrow-up
size: 100%
styles:
card:
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
name:
- font-size: 0.85em
state:
- font-size: 0.7em
icon:
- color: >
[[[ if (entity.attributes.today.length == 9) { if (
entity.attributes.today[8].phenomenon_max_color_id == 1
) return 'green'; else if (
entity.attributes.today[8].phenomenon_max_color_id == 2
) return 'yellow'; else if (
entity.attributes.today[8].phenomenon_max_color_id == 3
) return 'orange'; else return 'red'; } else return
'grey'; ]]]
style: |
ha-card {
top: 1px !important;
}
Dans configuration.yaml
# Alerte météo
camera:
- platform: local_file
name: MF_alerte_today
file_path: /config/www/weather/meteo_france_alerte_today.png
- platform: local_file
name: MF_alerte_tomorrow
file_path: /config/www/weather/meteo_france_alerte_tomorrow.png
Dans command_line.yaml :
- sensor:
name: meteo_france_alerts_26
scan_interval: 30000
command: >
curl -X GET "https://public-api.meteofrance.fr/public/DPVigilance/v1/cartevigilance/encours" -H "accept: */*" -H "apikey: MONAPIKEY" | jq '{details: {"domain_max_color_id_today": .product.periods[0].timelaps.domain_ids[15].max_color_id,"domain_max_color_id_tomorrow": .product.periods[1].timelaps.domain_ids[15].max_color_id, "update_time": .product.update_time}, "today": .product.periods[0].timelaps.domain_ids[15].phenomenon_items | sort_by(.phenomenon_id), "tomorrow": .product.periods[1].timelaps.domain_ids[15].phenomenon_items | sort_by(.phenomenon_id)}'
value_template: "{{ value_json.details.domain_max_color_id_today }}"
unique_id: meteo_france_alerts_26
json_attributes:
- details
- today
- tomorrow
- sensor:
name: meteo_france_alerts_picture_today
scan_interval: 7200
command: >
curl -X GET "https://public-api.meteofrance.fr/public/DPVigilance/v1/vignettenationale-J/encours" -H "accept: */*" -H "apikey: MONAPIKEY" > ./www/pictures/meteo_france_alert_today.jpg
value_template: "mf_alert_today"
unique_id: meteo_france_alerts_picture_today
- sensor:
name: meteo_france_alerts_picture_tomorrow
scan_interval: 7200
command: >
curl -X GET "https://public-api.meteofrance.fr/public/DPVigilance/v1/vignettenationale-J1/encours" -H "accept: */*" -H "apikey: =MONAPIKEY" > ./www/pictures/meteo_france_alert_tomorrow.jpg
value_template: "mf_alert_tomorrow"
unique_id: meteo_france_alerts_picture_tomorrow
Bonjour,
tu indique le chemin de l’image, alors que l’entité est une image.
Je comprends pas les gens qui modifie un code original qui fonctionne
C’est du copier coller…
ton code:
type: custom:button-card
entity_picture: /local/pictures/meteo_france_alert_today.jpg
name: Aujourdhui
aspect_ratio: 4/3
show_entity_picture: true
size: 80%
le code original:
type: custom:button-card
entity: camera.mf_alerte_today
name: Aujourd'hui
show_icon: false
show_entity_picture: true
aspect_ratio: 1/1
size: 100%
Salut @chuppito,
Chez toi, ton sensor meteo_france_alerts_26 est rempli à chaque redemarrage de Home Assistant ?
Chez moi c’est un peu la roulette Russe…
Bonjour,
Un correctif pour le code de ce post : Alerte météo - #226 par Fred55
Il ne devrait plus apparaitre d’icon en noir sur la carte du jour et d’erreur sur la carte demain.
MF envoie de temps en temps uniquement phenomen_id_max.
C’est corrigé dans le code ci-dessous.
type: custom:stack-in-card
mode: vertical
keep:
box_shadow: false
margin: false
border_radius: true
background: false
outer_padding: false
card_mod:
style: |
ha-card {
background: none;
}
cards:
- type: horizontal-stack
cards:
- type: custom:button-card
card_mod:
style: |
ha-card {
background: none;
border: none
}
entity: camera.mf_alerte_today
name: Aujourd'hui
show_icon: false
show_entity_picture: true
aspect_ratio: 1.35/1
size: 75%
styles:
name:
- font-size: 0.85em
- border-radius: 4px
- background: |
[[[
if (states["input_boolean.mf_today_on"].state == "on") {
return 'green'
}
return 'transparent'
]]]
state:
- font-size: 0.7em
tap_action:
action: call-service
service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.mf_today_on
- type: custom:button-card
card_mod:
style: |
ha-card {
background: none;
border: none
}
entity: camera.mf_alerte_tomorrow
name: Demain
show_icon: false
show_entity_picture: true
aspect_ratio: 1.35/1
size: 75%
styles:
name:
- font-size: 0.85em
- border-radius: 4px
- background: |
[[[
if (states["input_boolean.mf_today_on"].state == "off") {
return 'green'
}
return 'transparent'
]]]
state:
- font-size: 0.7em
tap_action:
action: call-service
service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.mf_today_on
- type: conditional
conditions:
- entity: input_boolean.mf_today_on
state: 'on'
card:
type: horizontal-stack
cards:
- type: custom:stack-in-card
mode: vertical
keep:
box_shadow: false
margin: false
border_radius: false
background: false
outer_padding: false
card_mod:
style: |
ha-card {
background: none;
border: none
}
cards:
- type: custom:mod-card
card_mod:
style:
.: |
:host {
--text-divider-color: rgb(68, 115, 158);
--text-divider-line-size: 1px;
}
ha-card {
margin: -15px -5px 0px -5px;
}
card:
type: horizontal-stack
cards:
- type: custom:bar-card
entities:
- entity: sensor.mf_level_today
name: Sévérité
icon: mdi:alert-circle
height: 20px
positions:
indicator: 'off'
icon: 'off'
severity:
- text: Pas de vigilance particulière
color: green
- text: Soyez attentif
color: yellow
- text: Soyez très vigilant
color: orange
- text: Vigilance absolue
color: red
card_mod:
style: >
bar-card-currentbar, bar-card-backgroundbar {
border-radius: 25px;
}
#states > bar-card-row > bar-card-card >
bar-card-background > bar-card-contentbar >
bar-card-name {
font-size: 14px;
color: black;
} ha-card {
margin-top: 2px;
background: none;
border: none;
}
- type: conditional
conditions:
- entity: sensor.mf_level_today
state_not: Pas de vigilance particulière
- entity: sensor.mf_level_today
state_not: unknown
card:
type: custom:mod-card
card_mod:
style: |
ha-card {
margin: -10px 5px 7px 5px;
}
card:
type: custom:auto-entities
card:
type: grid
columns: 5
card_param: cards
filter:
include:
- entity_id: sensor.mf_today_*
options:
type: custom:button-card
color_type: icon
aspect_ratio: 1/1
show_name: true
show_state: false
show_label: true
card_mod:
style: |
ha-card {
margin-top: 2px;
background: none;
border: none;
}
label: |
[[[
var txt = ""
var hd = ""
var hf = ""
var t = (new Date()).toLocaleString("fr-FR")
var size = entity.attributes.timelaps_items.length
var j = 0
for ( j = 0; j < size; j++) {
hd = entity.attributes.timelaps_items[j].begin_time
hf = entity.attributes.timelaps_items[j].end_time
if ((t > hd) && (t < hf)) break
}
j = j + 2
if (( j < size ) &&( j > 0 ) ) {
txt = entity.attributes.timelaps_items[j].begin_time.split(' ')[1].split(':')[0] + 'h' +
entity.attributes.timelaps_items[j].begin_time.split(' ')[1].split(':')[1] + ' à ' +
entity.attributes.timelaps_items[j].end_time.split(' ')[1].split(':')[0] + 'h' +
entity.attributes.timelaps_items[j].end_time.split(' ')[1].split(':')[1]
}
return txt
]]]
name: |
[[[
var txt = ""
var hd = ""
var hf = ""
var t = (new Date()).toLocaleString("fr-FR")
var size = entity.attributes.timelaps_items.length
var j = 0
for ( j = 0; j < size; j++) {
hd = entity.attributes.timelaps_items[j].begin_time
hf = entity.attributes.timelaps_items[j].end_time
if ((t > hd) && (t < hf)) break
}
j = j + 1
if (( j < size ) && ( j > 0 ) ) {
txt = entity.attributes.timelaps_items[j].begin_time.split(' ')[1].split(':')[0] + 'h' +
entity.attributes.timelaps_items[j].begin_time.split(' ')[1].split(':')[1] + ' à ' +
entity.attributes.timelaps_items[j].end_time.split(' ')[1].split(':')[0] + 'h' +
entity.attributes.timelaps_items[j].end_time.split(' ')[1].split(':')[1]
}
return txt
]]]
styles:
card:
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
- border-radius: 8px
state:
- font-size: 9px
- white-space: normal
label:
- font-size: 0.5em
- background: |
[[[
var color = "transparent"
var hd = ""
var hf = ""
var t = (new Date()).toLocaleString("fr-FR")
var size = entity.attributes.timelaps_items.length
var j = 0
for ( j = 0; j < size; j++) {
hd = entity.attributes.timelaps_items[j].begin_time
hf = entity.attributes.timelaps_items[j].end_time
if ((t > hd) && (t < hf)) break
}
j = j + 2
if (( j < size ) &&( j > 0 ) ) {
color = entity.attributes.timelaps_items[j].color_id
}
return color
]]]
- color: |
[[[
var color = "transparent"
var bgColor = ["green", "yellow", "orange", "red"]
var txtColor = ["white", "black", "black", "black"]
var hd = ""
var hf = ""
var t = (new Date()).toLocaleString("fr-FR")
var size = entity.attributes.timelaps_items.length
var j = 0
for ( j = 0; j < size; j++) {
hd = entity.attributes.timelaps_items[j].begin_time
hf = entity.attributes.timelaps_items[j].end_time
if ((t > hd) && (t < hf)) break
}
j = j + 2
if (( j < size ) &&( j > 0 ) ) {
color = entity.attributes.timelaps_items[j].color_id
}
for ( j = 0; j < 4; j++) {
if ( color == bgColor[j]) break
}
return txtColor[j]
]]]
name:
- font-size: 0.5em
- background: |
[[[
var color = "transparent"
var hd = ""
var hf = ""
var t = (new Date()).toLocaleString("fr-FR")
var size = entity.attributes.timelaps_items.length
var j = 0
for ( j = 0; j < size; j++) {
hd = entity.attributes.timelaps_items[j].begin_time
hf = entity.attributes.timelaps_items[j].end_time
if ((t > hd) && (t < hf)) break
}
j = j + 1
if (( j < size ) &&( j > 0 ) ) {
color = entity.attributes.timelaps_items[j].color_id
}
return color
]]]
- color: |
[[[
var color = "transparent"
var bgColor = ["green", "yellow", "orange", "red"]
var txtColor = ["white", "black", "black", "black"]
var hd = ""
var hf = ""
var t = (new Date()).toLocaleString("fr-FR")
var size = entity.attributes.timelaps_items.length
var j = 0
for ( j = 0; j < size; j++) {
hd = entity.attributes.timelaps_items[j].begin_time
hf = entity.attributes.timelaps_items[j].end_time
if ((t > hd) && (t < hf)) break
}
j = j + 1
if (( j < size ) &&( j > 0 ) ) {
color = entity.attributes.timelaps_items[j].color_id
}
for ( j = 0; j < 4; j++) {
if ( color == bgColor[j]) break
}
return txtColor[j]
]]]
state:
- value: Vent
operator: '=='
color: rgb(240,240,240)
icon: mdi:weather-windy
styles:
icon:
- color: |
[[[
var color = entity.attributes.phenomenon_max_color_id
var hd = ""
var hf = ""
var t = (new Date()).toLocaleString("fr-FR")
var size = entity.attributes.timelaps_items.length
var j = 0
for ( j = 0; j < size; j++) {
hd = entity.attributes.timelaps_items[j].begin_time
hf = entity.attributes.timelaps_items[j].end_time
if ((t > hd) && (t < hf)) break
}
if ( j < size ) {
color = entity.attributes.timelaps_items[j].color_id
}
return color
]]]
card:
- box-shadow: |
[[[
return '0px 0px 0px 2px ' + entity.attributes.phenomenon_max_color_id
]]]
- value: Pluie
operator: '=='
color: rgb(240,240,240)
icon: mdi:weather-rainy
styles:
icon:
- color: |
[[[
var color = entity.attributes.phenomenon_max_color_id
var hd = ""
var hf = ""
var t = (new Date()).toLocaleString("fr-FR")
var size = entity.attributes.timelaps_items.length
var j = 0
for ( j = 0; j < size; j++) {
hd = entity.attributes.timelaps_items[j].begin_time
hf = entity.attributes.timelaps_items[j].end_time
if ((t > hd) && (t < hf)) break
}
if ( j < size ) {
color = entity.attributes.timelaps_items[j].color_id
}
return color
]]]
card:
- box-shadow: |
[[[
return '0px 0px 0px 2px ' + entity.attributes.phenomenon_max_color_id
]]]
- value: Orages
operator: '=='
color: rgb(240,240,240)
icon: mdi:weather-partly-lightning
styles:
icon:
- color: |
[[[
var color = entity.attributes.phenomenon_max_color_id
var hd = ""
var hf = ""
var t = (new Date()).toLocaleString("fr-FR")
var size = entity.attributes.timelaps_items.length
var j = 0
for ( j = 0; j < size; j++) {
hd = entity.attributes.timelaps_items[j].begin_time
hf = entity.attributes.timelaps_items[j].end_time
if ((t > hd) && (t < hf)) break
}
if ( j < size ) {
color = entity.attributes.timelaps_items[j].color_id
}
return color
]]]
card:
- box-shadow: |
[[[
return '0px 0px 0px 2px ' + entity.attributes.phenomenon_max_color_id
]]]
- value: Crues
operator: '=='
color: rgb(240,240,240)
icon: mdi:home-flood
styles:
icon:
- color: |
[[[
var color = entity.attributes.phenomenon_max_color_id
var hd = ""
var hf = ""
var t = (new Date()).toLocaleString("fr-FR")
var size = entity.attributes.timelaps_items.length
var j = 0
for ( j = 0; j < size; j++) {
hd = entity.attributes.timelaps_items[j].begin_time
hf = entity.attributes.timelaps_items[j].end_time
if ((t > hd) && (t < hf)) break
}
if ( j < size ) {
color = entity.attributes.timelaps_items[j].color_id
}
return color
]]]
card:
- box-shadow: |
[[[
return '0px 0px 0px 2px ' + entity.attributes.phenomenon_max_color_id
]]]
- value: Neige
operator: '=='
color: rgb(240,240,240)
icon: mdi:weather-snowy
styles:
icon:
- color: |
[[[
var color = entity.attributes.phenomenon_max_color_id
var hd = ""
var hf = ""
var t = (new Date()).toLocaleString("fr-FR")
var size = entity.attributes.timelaps_items.length
var j = 0
for ( j = 0; j < size; j++) {
hd = entity.attributes.timelaps_items[j].begin_time
hf = entity.attributes.timelaps_items[j].end_time
if ((t > hd) && (t < hf)) break
}
if ( j < size ) {
color = entity.attributes.timelaps_items[j].color_id
}
return color
]]]
card:
- box-shadow: |
[[[
return '0px 0px 0px 2px ' + entity.attributes.phenomenon_max_color_id
]]]
- value: Canicule
operator: '=='
color: rgb(240,240,240)
icon: mdi:thermometer
styles:
icon:
- color: |
[[[
var color = entity.attributes.phenomenon_max_color_id
var hd = ""
var hf = ""
var t = (new Date()).toLocaleString("fr-FR")
var size = entity.attributes.timelaps_items.length
var j = 0
for ( j = 0; j < size; j++) {
hd = entity.attributes.timelaps_items[j].begin_time
hf = entity.attributes.timelaps_items[j].end_time
if ((t > hd) && (t < hf)) break
}
if ( j < size ) {
color = entity.attributes.timelaps_items[j].color_id
}
return color
]]]
card:
- box-shadow: |
[[[
return '0px 0px 0px 2px ' + entity.attributes.phenomenon_max_color_id
]]]
- value: Froid
operator: '=='
color: rgb(240,240,240)
icon: si:snowflake
styles:
icon:
- color: |
[[[
var color = entity.attributes.phenomenon_max_color_id
var hd = ""
var hf = ""
var t = (new Date()).toLocaleString("fr-FR")
var size = entity.attributes.timelaps_items.length
var j = 0
for ( j = 0; j < size; j++) {
hd = entity.attributes.timelaps_items[j].begin_time
hf = entity.attributes.timelaps_items[j].end_time
if ((t > hd) && (t < hf)) break
}
if ( j < size ) {
color = entity.attributes.timelaps_items[j].color_id
}
return color
]]]
card:
- box-shadow: |
[[[
return '0px 0px 0px 2px ' + entity.attributes.phenomenon_max_color_id
]]]
- value: Avalanche
operator: '=='
color: rgb(240,240,240)
icon: si:snowpack
styles:
icon:
- color: |
[[[
var color = entity.attributes.phenomenon_max_color_id
var hd = ""
var hf = ""
var t = (new Date()).toLocaleString("fr-FR")
var size = entity.attributes.timelaps_items.length
var j = 0
for ( j = 0; j < size; j++) {
hd = entity.attributes.timelaps_items[j].begin_time
hf = entity.attributes.timelaps_items[j].end_time
if ((t > hd) && (t < hf)) break
}
if ( j < size ) {
color = entity.attributes.timelaps_items[j].color_id
}
return color
]]]
card:
- box-shadow: |
[[[
return '0px 0px 0px 2px ' + entity.attributes.phenomenon_max_color_id
]]]
- value: Vagues
operator: '=='
color: rgb(240,240,240)
icon: si:flood
styles:
icon:
- color: |
[[[
var color = entity.attributes.phenomenon_max_color_id
var hd = ""
var hf = ""
var t = (new Date()).toLocaleString("fr-FR")
var size = entity.attributes.timelaps_items.length
var j = 0
for ( j = 0; j < size; j++) {
hd = entity.attributes.timelaps_items[j].begin_time
hf = entity.attributes.timelaps_items[j].end_time
if ((t > hd) && (t < hf)) break
}
if ( j < size ) {
color = entity.attributes.timelaps_items[j].color_id
}
return color
]]]
card:
- box-shadow: |
[[[
return '0px 0px 0px 2px ' + entity.attributes.phenomenon_max_color_id
]]]
size: 50%
exclude:
- entity_id: sensor.mf_today_*
state: Indefini
- entity_id: sensor.mf_today_*
state: unknown
- entity_id: sensor.mf_today_*
attributes:
phenomenon_max_color_id: green
sort:
method: state
reverse: false
- type: conditional
conditions:
- entity: input_boolean.mf_today_on
state: 'off'
card:
type: horizontal-stack
cards:
- type: custom:stack-in-card
mode: vertical
keep:
box_shadow: false
margin: false
border_radius: false
background: false
outer_padding: false
card_mod:
style: |
ha-card {
background: none;
border: none
}
cards:
- type: custom:mod-card
card_mod:
style:
.: |
:host {
--text-divider-color: rgb(68, 115, 158);
--text-divider-line-size: 1px;
}
ha-card {
margin: -15px -5px 0px -5px;
}
card:
type: horizontal-stack
cards:
- type: custom:bar-card
entities:
- entity: sensor.mf_level_tomorrow
name: Sévérité
icon: mdi:alert-circle
height: 20px
positions:
indicator: 'off'
icon: 'off'
severity:
- text: Pas de vigilance particulière
color: green
- text: Soyez attentif
color: yellow
- text: Soyez très vigilant
color: orange
- text: Vigilance absolue
color: red
card_mod:
style: >
bar-card-currentbar, bar-card-backgroundbar {
border-radius: 25px;
}
#states > bar-card-row > bar-card-card >
bar-card-background > bar-card-contentbar >
bar-card-name {
font-size: 14px;
color: black;
} ha-card {
margin-top: 2px;
background: none;
border: none;
}
- type: conditional
conditions:
- entity: sensor.mf_level_tomorrow
state_not: Pas de vigilance particulière
- entity: sensor.mf_level_tomorrow
state_not: unknown
card:
type: custom:mod-card
card_mod:
style: |
ha-card {
margin: -10px 5px 7px 5px;
}
card:
type: custom:auto-entities
card:
type: grid
columns: 5
card_param: cards
filter:
include:
- entity_id: sensor.mf_tomorrow_*
options:
type: custom:button-card
color_type: icon
aspect_ratio: 1/1
show_name: true
show_state: false
show_label: true
card_mod:
style: |
ha-card {
margin-top: 2px;
background: none;
border: none;
}
label: |
[[[
var txt = ""
var size = entity.attributes.timelaps_items.length
if ( size > 2 ) {
txt = entity.attributes.timelaps_items[2].begin_time.split(' ')[1].split(':')[0] + 'h' +
entity.attributes.timelaps_items[2].begin_time.split(' ')[1].split(':')[1] + ' à ' +
entity.attributes.timelaps_items[2].end_time.split(' ')[1].split(':')[0] + 'h' +
entity.attributes.timelaps_items[2].end_time.split(' ')[1].split(':')[1]
}
return txt
]]]
name: |
[[[
var txt = ""
var size = entity.attributes.timelaps_items.length
if ( size > 1 ) {
txt = entity.attributes.timelaps_items[1].begin_time.split(' ')[1].split(':')[0] + 'h' +
entity.attributes.timelaps_items[1].begin_time.split(' ')[1].split(':')[1] + ' à ' +
entity.attributes.timelaps_items[1].end_time.split(' ')[1].split(':')[0] + 'h' +
entity.attributes.timelaps_items[1].end_time.split(' ')[1].split(':')[1]
}
return txt
]]]
styles:
card:
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
- border-radius: 8px
state:
- font-size: 9px
- white-space: normal
label:
- font-size: 0.5em
- background: |
[[[
var color = "transparent"
var size = entity.attributes.timelaps_items.length
if ( size > 2 ) {
color = entity.attributes.timelaps_items[2].color_id
}
return color
]]]
- color: |
[[[
var color = "transparent"
var bgColor = ["green", "yellow", "orange", "red"]
var txtColor = ["white", "black", "black", "black"]
var size = entity.attributes.timelaps_items.length
var j = 0
if ( size > 2 ) {
color = entity.attributes.timelaps_items[2].color_id
}
for ( j = 0; j < 4; j++) {
if ( color == bgColor[j]) break
}
return txtColor[j]
]]]
name:
- font-size: 0.5em
- background: |
[[[
var color = "transparent"
var size = entity.attributes.timelaps_items.length
if ( size > 1) {
color = entity.attributes.timelaps_items[1].color_id
}
return color
]]]
- color: |
[[[
var color = "transparent"
var bgColor = ["green", "yellow", "orange", "red"]
var txtColor = ["white", "black", "black", "black"]
var size = entity.attributes.timelaps_items.length
var j = 0
if ( size > 1 ) {
color = entity.attributes.timelaps_items[1].color_id
}
for ( j = 0; j < 4; j++) {
if ( color == bgColor[j]) break
}
return txtColor[j]
]]]
state:
- value: Vent
operator: '=='
color: rgb(240,240,240)
icon: mdi:weather-windy
styles:
icon:
- color: |
[[[
if ( entity.attributes.timelaps_items[0])
return entity.attributes.timelaps_items[0].color_id
else
return entity.attributes.phenomenon_max_color_id
]]]
card:
- box-shadow: |
[[[
return '0px 0px 0px 2px ' + entity.attributes.phenomenon_max_color_id
]]]
- value: Pluie
operator: '=='
color: rgb(240,240,240)
icon: mdi:weather-rainy
styles:
icon:
- color: |
[[[
if ( entity.attributes.timelaps_items[0])
return entity.attributes.timelaps_items[0].color_id
else
return entity.attributes.phenomenon_max_color_id
]]]
card:
- box-shadow: |
[[[
return '0px 0px 0px 2px ' + entity.attributes.phenomenon_max_color_id
]]]
- value: Orages
operator: '=='
color: rgb(240,240,240)
icon: mdi:weather-partly-lightning
styles:
icon:
- color: |
[[[
if ( entity.attributes.timelaps_items[0])
return entity.attributes.timelaps_items[0].color_id
else
return entity.attributes.phenomenon_max_color_id
]]]
card:
- box-shadow: |
[[[
return '0px 0px 0px 2px ' + entity.attributes.phenomenon_max_color_id
]]]
- value: Crues
operator: '=='
color: rgb(240,240,240)
icon: mdi:home-flood
styles:
icon:
- color: |
[[[
if ( entity.attributes.timelaps_items[0])
return entity.attributes.timelaps_items[0].color_id
else
return entity.attributes.phenomenon_max_color_id
]]]
card:
- box-shadow: |
[[[
return '0px 0px 0px 2px ' + entity.attributes.phenomenon_max_color_id
]]]
- value: Neige
operator: '=='
color: rgb(240,240,240)
icon: mdi:weather-snowy
styles:
icon:
- color: |
[[[
if ( entity.attributes.timelaps_items[0])
return entity.attributes.timelaps_items[0].color_id
else
return entity.attributes.phenomenon_max_color_id
]]]
card:
- box-shadow: |
[[[
return '0px 0px 0px 2px ' + entity.attributes.phenomenon_max_color_id
]]]
- value: Canicule
operator: '=='
color: rgb(240,240,240)
icon: mdi:thermometer
styles:
icon:
- color: |
[[[
if ( entity.attributes.timelaps_items[0])
return entity.attributes.timelaps_items[0].color_id
else
return entity.attributes.phenomenon_max_color_id
]]]
card:
- box-shadow: |
[[[
return '0px 0px 0px 2px ' + entity.attributes.phenomenon_max_color_id
]]]
- value: Froid
operator: '=='
color: rgb(240,240,240)
icon: si:snowflake
styles:
icon:
- color: |
[[[
if ( entity.attributes.timelaps_items[0])
return entity.attributes.timelaps_items[0].color_id
else
return entity.attributes.phenomenon_max_color_id
]]]
card:
- box-shadow: |
[[[
return '0px 0px 0px 2px ' + entity.attributes.phenomenon_max_color_id
]]]
- value: Avalanche
operator: '=='
color: rgb(240,240,240)
icon: si:snowpack
styles:
icon:
- color: |
[[[
if ( entity.attributes.timelaps_items[0])
return entity.attributes.timelaps_items[0].color_id
else
return entity.attributes.phenomenon_max_color_id
]]]
card:
- box-shadow: |
[[[
return '0px 0px 0px 2px ' + entity.attributes.phenomenon_max_color_id
]]]
- value: Vagues
operator: '=='
color: rgb(240,240,240)
icon: si:flood
styles:
icon:
- color: |
[[[
if ( entity.attributes.timelaps_items[0])
return entity.attributes.timelaps_items[0].color_id
else
return entity.attributes.phenomenon_max_color_id
]]]
card:
- box-shadow: |
[[[
return '0px 0px 0px 2px ' + entity.attributes.phenomenon_max_color_id
]]]
size: 50%
exclude:
- entity_id: sensor.mf_tomorrow_*
state: Indefini
- entity_id: sensor.mf_tomorrow_*
state: unknown
- entity_id: sensor.mf_tomorrow_*
attributes:
phenomenon_max_color_id: green
sort:
method: state
reverse: false
Bonjour @jerome6994,
tu as réussi pour avalanche et grand froid ?
de mon coté je n’y parviens pas, si tu peux m’aider ?
merci
Bonjour,
Merci pour toutes ces informations. Bon, je pense que je ne suis pas loin, mais je n’arrive pas à trouver mon erreur malgré les recherches sur ce long topic.
J’ai bien les alertes fonctionnelle (enfin je suppose, il n’y a pas d’alerte dans mon département) :
Par contre, l’image de la carte de france ne s’affiche pas comme vous pouvez le constater.
Le téléchargement de l’image est bien fonctionnel, et j’arrive à l’afficher dans une entité seule :
Ma conf Yaml :
# Pour la carte Météo France et avoir les alertes.
command_line: !include command_line.yaml
camera:
- platform: local_file
name: MF_alerte_today
file_path: local/weather/meteo_france_alerte_today.png
- platform: local_file
name: MF_alerte_tomorrow
file_path: local/weather/meteo_france_alerte_tomorrow.png
J’ai bien les mêmes chemins de fichier que la carte fonctionnelle, donc je ne comprend pas,
Mon code de carte :
type: custom:stack-in-card
mode: vertical
keep:
box_shadow: false
margin: false
border_radius: false
background: false
outer_padding: false
cards:
- type: horizontal-stack
cards:
- type: conditional
conditions:
- entity: sensor.meteo_france_alertes_91
state_not: '1'
card:
type: custom:button-card
entity: camera.mf_alerte_today
name: Aujourd'hui
show_icon: false
show_entity_picture: true
aspect_ratio: 1/1
size: 100%
card_mod:
style: |
ha-card {
border: none;
}
- type: conditional
conditions:
- entity: sensor.meteo_france_alertes_91
state_not: '1'
card:
type: custom:button-card
entity: camera.mf_alerte_tomorrow
name: Demain
aspect_ratio: 1/1
show_icon: false
show_entity_picture: true
size: 100%
card_mod:
style: |
ha-card {
border: none;
}
- type: vertical-stack
cards:
- type: grid
columns: 6
square: false
cards:
- type: custom:button-card
entity: sensor.meteo_france_alertes_91
name: Vent
aspect_ratio: 4/3
show_state: false
show_icon: true
icon: mdi:weather-windy
size: 100%
styles:
card:
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
name:
- font-size: 0.84em
state:
- font-size: 0.7em
icon:
- color: >
[[[ if ( entity.attributes.today[0].phenomenon_max_color_id
== 1 ) return 'green'; else if (
entity.attributes.today[0].phenomenon_max_color_id == 2 )
return 'yellow'; else if (
entity.attributes.today[0].phenomenon_max_color_id == 3 )
return 'orange'; else return 'red'; ]]]
card_mod:
style: |
ha-card {
top: 1px !important;
border: none;
}
- type: custom:button-card
entity: sensor.meteo_france_alertes_91
name: Pluie
aspect_ratio: 4/3
show_state: false
show_icon: true
icon: mdi:weather-rainy
size: 100%
styles:
card:
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
name:
- font-size: 0.84em
state:
- font-size: 0.7em
icon:
- color: >
[[[ if ( entity.attributes.today[1].phenomenon_max_color_id
== 1 ) return 'green'; else if (
entity.attributes.today[1].phenomenon_max_color_id == 2 )
return 'yellow'; else if (
entity.attributes.today[1].phenomenon_max_color_id == 3 )
return 'orange'; else return 'red'; ]]]
card_mod:
style: |
ha-card {
top: 1px !important;
border: none;
}
- type: custom:button-card
entity: sensor.meteo_france_alertes_91
name: Orage
aspect_ratio: 4/3
show_state: false
show_icon: true
icon: mdi:weather-partly-lightning
size: 100%
styles:
card:
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
name:
- font-size: 0.84em
state:
- font-size: 0.7em
icon:
- color: >
[[[ if ( entity.attributes.today[2].phenomenon_max_color_id
== 1 ) return 'green'; else if (
entity.attributes.today[2].phenomenon_max_color_id == 2 )
return 'yellow'; else if (
entity.attributes.today[2].phenomenon_max_color_id == 3 )
return 'orange'; else return 'red'; ]]]
card_mod:
style: |
ha-card {
top: 1px !important;
border: none;
}
- type: custom:button-card
entity: sensor.meteo_france_alertes_91
name: Inondation
aspect_ratio: 4/3
show_state: false
show_icon: true
icon: mdi:home-flood
size: 100%
styles:
card:
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
name:
- font-size: 0.84em
state:
- font-size: 0.7em
icon:
- color: >
[[[ if ( entity.attributes.today[3].phenomenon_max_color_id
== 1 ) return 'green'; else if (
entity.attributes.today[3].phenomenon_max_color_id == 2 )
return 'yellow'; else if (
entity.attributes.today[3].phenomenon_max_color_id == 3 )
return 'orange'; else return 'red'; ]]]
card_mod:
style: |
ha-card {
top: 1px !important;
border: none;
}
- type: custom:button-card
entity: sensor.meteo_france_alertes_91
name: Neige
aspect_ratio: 4/3
show_state: false
show_icon: true
icon: mdi:weather-snowy
size: 100%
styles:
card:
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
name:
- font-size: 0.84em
state:
- font-size: 0.7em
icon:
- color: >
[[[ if ( entity.attributes.today[4].phenomenon_max_color_id
== 1 ) return 'green'; else if (
entity.attributes.today[4].phenomenon_max_color_id == 2 )
return 'yellow'; else if (
entity.attributes.today[4].phenomenon_max_color_id == 3 )
return 'orange'; else return 'red'; ]]]
card_mod:
style: |
ha-card {
top: 1px !important;
border: none;
}
- type: custom:button-card
entity: sensor.meteo_france_alertes_91
name: Canicule
aspect_ratio: 4/3
show_state: false
show_icon: true
icon: mdi:temperature-celsius
size: 100%
styles:
card:
- '--mdc-ripple-color': rgb(68, 115, 158)
- '--mdc-ripple-press-opacity': 0.5
name:
- font-size: 0.84em
state:
- font-size: 0.7em
icon:
- color: >
[[[ if ( entity.attributes.today[5].phenomenon_max_color_id
== 1 ) return 'green'; else if (
entity.attributes.today[5].phenomenon_max_color_id == 2 )
return 'yellow'; else if (
entity.attributes.today[5].phenomenon_max_color_id == 3 )
return 'orange'; else return 'red'; ]]]
card_mod:
style: |
ha-card {
top: 1px !important;
border: none;
}
- type: custom:bar-card
entities:
- entity: sensor.meteo_france_alertes_91
name: Alerte Météo France
height: 30px
color: red
min: 0
max: 4
positions:
indicator: 'off'
icon: 'off'
severity:
- color: green
from: 1
to: 1
- color: yellow
from: 2
to: 2
- color: orange
from: 3
to: 3
- color: Red
from: 4
to: 4
card_mod:
style: >
bar-card-currentbar, bar-card-backgroundbar {
border-radius: 25px;
}
#states > bar-card-row > bar-card-card > bar-card-background >
bar-card-contentbar > bar-card-name {
font-size: 16px;
font-weight: bold;
} ha-card {
margin-top: -10px;
background: none;
border: none;
}
De plus, est-il possible d’avoir plus de détail pour le code de la carte météo france pour y réintégrer ces alerte ? Moi j’ai ceci, et je n’arrive pas à les ajouter comme certains ont fait ici :
type: custom:meteofrance-weather-card
entity: weather.briis_sous_forges
number_of_forecasts: '5'
name: Briis-Sous-Forges
forecast: true
animated_icons: true
alert_forecast: true
details: true
current: true
one_hour_forecast: true
cloudCoverEntity: sensor.briis_sous_forges_cloud_cover
rainChanceEntity: sensor.briis_sous_forges_rain_chance
freezeChanceEntity: sensor.briis_sous_forges_freeze_chance
snowChanceEntity: sensor.briis_sous_forges_snow_chance
uvEntity: sensor.briis_sous_forges__uv
rainForecastEntity: sensor.briis_sous_forges__next_rain
alertEntity: sensor.meteo_france_alertes_91
Merci d’avance
Bonjour,
erreur dans le chemin de l’image. C’est fou c’est habitude de modifier les codes fournie.
pourquoi mettre local/weather/meteo_france_alerte_today.png
au lieu de /config/www/weather/meteo_france_alerte_today.png
dans le code fournie ?
Beh écoute, je ne sais pas ce que j’ai foutu, erreur bête en effet !
ça fonctionne, merci !
Et concernant l’ajout de ces entités dans la carte météofrance, je n’ai pas vu d’exemple de code en recherchant sur ce topic.
Question complémentaire, il n’y a pas d’alerte grêle ?
Merci encore, et désolé pour l’erreur bête !
Bonjour tout le monde,
Pour éviter que tout le monde galère a trouver le bon numéro a mettre dans timelaps.domain_ids[ID], je vous ai fait un tableau qui vous le donnera en fonction du numéro de votre département.
A+
Jeff
Voici un extrait du site de météofrance qui explique les différentes vigilances :
La Vigilance couvre aujourd’hui 9 phénomènes : vent, vagues-submersion(1), pluie-inondation, crues, orages, neige-verglas, avalanches(2), canicule et grand froid.
(1) Concernant les vagues-submersion, la Vigilance distingue 46 zones littorales pour les 25 départements côtiers. .Seuls les tronçons des côtes exposées au danger sont affichés sur les cartes départementales sous forme de liseré. Une Vigilance orange pour vagues-submersion peut ainsi être activée uniquement sur la portion de littoral comprise entre l’ouest de la presqu’île de Quiberon et la Pointe du Raz.
(2) Concernant les Avalanches, la Vigilance distingue 37 zones montagneuses. Seuls les massifs montagneux exposés au danger d’avalanches sont affichés en détail sur les cartes départementales.la Vigilance Avalanches complète les Bulletins d’estimation du risque d’avalanche. .
Salut,
sympa le tableau. Il y avait déja une liste disponible ici: Alerte météo - #116 par Christophe69480
Ah bah je l’ai loupé… Tout ce travail réduit a néant en quelques secondes