New custom component: France weather alerts from Météo France

Hi,
i tried with this, but still not working …

state:
              - color: 'rgb(204, 217, 255)'
                operator: template
                value: |
                  [[[
                    return states['sensor.capbreton_next_rain'].attributes
                    && (states['sensor.capbreton_next_rain'].attributes.in_0_min == "Pluie faible")
                  ]]]
              - color: 'rgb(128, 159, 255)'
                operator: template
                value: |
                  [[[
                    return states['sensor.capbreton_next_rain'].attributes
                    && (states['sensor.capbreton_next_rain'].attributes.in_0_min == "Pluie modérée")
                  ]]]
              - color: 'rgb(51, 102, 255)'
                operator: template
                value: |
                  [[[
                    return states['sensor.capbreton_next_rain'].attributes
                    && (states['sensor.capbreton_next_rain'].attributes.in_0_min == "Pluie forte")
                  ]]]
              - color: 'rgb(255, 255, 255)'
                operator: default

Hello , it is working for me:

          - color_type: card
            entity: sensor.faches_thumesnil_next_rain
            name: 10
            show_icon: false
            show_state: false
            state:
              - color: 'rgb(204, 217, 255)'
                operator: template
                value: |
                  [[[
                    return states['sensor.faches_thumesnil_next_rain'].attributes
                    && (states['sensor.faches_thumesnil_next_rain'].attributes.in_10_min == "Pluie faible")
                  ]]]
              - color: 'rgb(128, 159, 255)'
                operator: template
                value: |
                  [[[
                    return states['sensor.faches_thumesnil_next_rain'].attributes
                    && (states['sensor.faches_thumesnil_next_rain'].attributes.in_10_min == "Pluie modérée")
                  ]]]
              - color: 'rgb(51, 102, 255)'
                operator: template
                value: |
                  [[[
                    return states['sensor.faches_thumesnil_next_rain'].attributes
                    && (states['sensor.faches_thumesnil_next_rain'].attributes.in_10_min == "Pluie forte")
                  ]]]
              - color: 'rgb(255, 255, 255)'
                operator: default
            styles:
              card:
                - height: 50px
            type: 'custom:button-card'
          - color_type: card
            entity: sensor.faches_thumesnil_next_rain
            name: 20
            show_icon: false
            show_state: false
            state:
              - color: 'rgb(204, 217, 255)'
                operator: template
                value: |
                  [[[
                    return states['sensor.faches_thumesnil_next_rain'].attributes
                    && (states['sensor.faches_thumesnil_next_rain'].attributes.in_20_min == "Pluie faible")
                  ]]]
              - color: 'rgb(128, 159, 255)'
                operator: template
                value: |
                  [[[
                    return states['sensor.faches_thumesnil_next_rain'].attributes
                    && (states['sensor.faches_thumesnil_next_rain'].attributes.in_20_min == "Pluie modérée")
                  ]]]
              - color: 'rgb(51, 102, 255)'
                operator: template
                value: |
                  [[[
                    return states['sensor.faches_thumesnil_next_rain'].attributes
                    && (states['sensor.faches_thumesnil_next_rain'].attributes.in_20_min == "Pluie forte")
                  ]]]
              - color: 'rgb(255, 255, 255)'
                operator: default
            styles:
              card:
                - height: 50px
            type: 'custom:button-card'
          - color_type: card
            entity: sensor.faches_thumesnil_next_rain
            name: 30
            show_icon: false
            show_state: false
            state:
              - color: 'rgb(204, 217, 255)'
                operator: template
                value: |
                  [[[
                    return states['sensor.faches_thumesnil_next_rain'].attributes
                    && (states['sensor.faches_thumesnil_next_rain'].attributes.in_35_min == "Pluie faible")
                  ]]]
              - color: 'rgb(128, 159, 255)'
                operator: template
                value: |
                  [[[
                    return states['sensor.faches_thumesnil_next_rain'].attributes
                    && (states['sensor.faches_thumesnil_next_rain'].attributes.in_35_min == "Pluie modérée")
                  ]]]
              - color: 'rgb(51, 102, 255)'
                operator: template
                value: |
                  [[[
                    return states['sensor.faches_thumesnil_next_rain'].attributes
                    && (states['sensor.faches_thumesnil_next_rain'].attributes.in_35_min == "Pluie forte")
                  ]]]
              - color: 'rgb(255, 255, 255)'
                operator: default
            styles:
              card:
                - height: 50px
            type: 'custom:button-card'
          - color_type: card
            entity: sensor.faches_thumesnil_next_rain
            name: 40
            show_icon: false
            show_state: false
            state:
              - color: 'rgb(204, 217, 255)'
                operator: template
                value: |
                  [[[
                    return states['sensor.faches_thumesnil_next_rain'].attributes
                    && (states['sensor.faches_thumesnil_next_rain'].attributes.in_45_min == "Pluie faible")
                  ]]]
              - color: 'rgb(128, 159, 255)'
                operator: template
                value: |
                  [[[
                    return states['sensor.faches_thumesnil_next_rain'].attributes
                    && (states['sensor.faches_thumesnil_next_rain'].attributes.in_45_min == "Pluie modérée")
                  ]]]
              - color: 'rgb(51, 102, 255)'
                operator: template
                value: |
                  [[[
                    return states['sensor.faches_thumesnil_next_rain'].attributes
                    && (states['sensor.faches_thumesnil_next_rain'].attributes.in_45_min == "Pluie forte")
                  ]]]
              - color: 'rgb(255, 255, 255)'
                operator: default
            styles:
              card:
                - height: 50px
            type: 'custom:button-card'
          - color_type: card
            entity: sensor.faches_thumesnil_next_rain
            name: 50
            show_icon: false
            show_state: false
            state:
              - color: 'rgb(204, 217, 255)'
                operator: template
                value: |
                  [[[
                    return states['sensor.faches_thumesnil_next_rain'].attributes
                    && (states['sensor.faches_thumesnil_next_rain'].attributes.in_55_min == "Pluie faible")
                  ]]]
              - color: 'rgb(128, 159, 255)'
                operator: template
                value: |
                  [[[
                    return states['sensor.faches_thumesnil_next_rain'].attributes
                    && (states['sensor.faches_thumesnil_next_rain'].attributes.in_55_min == "Pluie modérée")
                  ]]]
              - color: 'rgb(51, 102, 255)'
                operator: template
                value: |
                  [[[
                    return states['sensor.faches_thumesnil_next_rain'].attributes
                    && (states['sensor.faches_thumesnil_next_rain'].attributes.in_55_min == "Pluie forte")
                  ]]]
              - color: 'rgb(255, 255, 255)'
                operator: default
            styles:
              card:
                - height: 50px
            type: 'custom:button-card'
        type: horizontal-stack

Sorry I made a mistake we should remove the in_ in in_X_min as the attributes are:

  • 0 min: Temps sec
  • 5 min: Temps sec
  • 10 min: Temps sec
  • 15 min: Temps sec
  • 20 min: Temps sec
  • 25 min: Pluie faible
  • 35 min: Pluie faible
  • 45 min: Pluie modérée
  • 55 min: Pluie modérée
1 Like

_x_min return always False


how can we got _x_min in 1_hour_forecast dic
x_min return error

1 Like

{{state_attr('sensor.limoges_next_rain', '1_hour_forecast')['0 min'] == 'Temps sec' }}
{{state_attr('sensor.limoges_next_rain', '1_hour_forecast')['0 min'] == 'Pluie faible' }}
{{state_attr('sensor.limoges_next_rain', '1_hour_forecast')['0 min'] == 'Pluie modérée' }}
{{state_attr('sensor.limoges_next_rain', '1_hour_forecast')['0 min'] == 'Pluie forte' }}

works in model development tools
but state_attr don’t work in button-card template value.
an idea?
it’s probably simple but I miss it

Because home assistant use jinja in template and button-card custom card use javascript. It’s not the same language.

It seems “object.property” notation in javascript forbid to have properties starting with a number. You have to use “object[property]” notation according to stackoverflow.

1 Like

here is the solution

          - type: horizontal-stack
            title: Prévisions de pluie
            cards: 
              - color_type: card
                entity: sensor.limoges_next_rain
                name: "0"
                show_icon: false
                show_state: false
                state:
                  - color: 'rgb(204, 217, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['0 min'] == 'Pluie faible')
                      ]]]
                  - color: 'rgb(128, 159, 255)'  
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['0 min'] == 'Pluie modérée')
                      ]]]
                  - color: 'rgb(51, 102, 255)' 
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['0 min'] == 'Pluie forte')
                      ]]]
                  - color: 'rgb(255, 255, 255)'
                    operator: default
                styles:
                  card:
                    - height: 50px
                type: 'custom:button-card'

              - color_type: card
                entity: sensor.limoges_next_rain
                name: 05
                show_icon: false
                show_state: false
                state:
                  - color: 'rgb(204, 217, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['5 min'] == 'Pluie faible')
                      ]]]
                  - color: 'rgb(128, 159, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['5 min'] == 'Pluie modérée')
                      ]]]
                  - color: 'rgb(51, 102, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['5 min'] == 'Pluie forte')
                      ]]]
                  - color: 'rgb(255, 255, 255)'
                    operator: default
                styles:
                  card:
                    - height: 50px
                type: 'custom:button-card'

              - color_type: card
                entity: sensor.limoges_next_rain
                name: 10
                show_icon: false
                show_state: false
                state:
                  - color: 'rgb(204, 217, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['10 min'] == 'Pluie faible')
                      ]]]
                  - color: 'rgb(128, 159, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['10 min'] == 'Pluie modérée')
                      ]]]
                  - color: 'rgb(51, 102, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['10 min'] == 'Pluie forte')
                      ]]]
                  - color: 'rgb(255, 255, 255)'
                    operator: default
                styles:
                  card:
                    - height: 50px
                type: 'custom:button-card'

              - color_type: card
                entity: sensor.limoges_next_rain
                name: 15
                show_icon: false
                show_state: false
                state:
                  - color: 'rgb(204, 217, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['15 min'] == 'Pluie faible')
                      ]]]
                  - color: 'rgb(128, 159, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['15 min'] == 'Pluie modérée')
                      ]]]
                  - color: 'rgb(51, 102, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['15 min'] == 'Pluie forte')
                      ]]]
                  - color: 'rgb(255, 255, 255)'
                    operator: default
                styles:
                  card:
                    - height: 50px
                type: 'custom:button-card'

              - color_type: card
                entity: sensor.limoges_next_rain
                name: 20
                show_icon: false
                show_state: false
                state:
                  - color: 'rgb(204, 217, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['20 min'] == 'Pluie faible')
                      ]]]
                  - color: 'rgb(128, 159, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['20 min'] == 'Pluie modérée')
                      ]]]
                  - color: 'rgb(51, 102, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['20 min'] == 'Pluie forte')
                      ]]]
                  - color: 'rgb(255, 255, 255)'
                    operator: default
                styles:
                  card:
                    - height: 50px
                type: 'custom:button-card'

              - color_type: card
                entity: sensor.limoges_next_rain
                name: 25
                show_icon: false
                show_state: false
                state:
                  - color: 'rgb(204, 217, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['25 min'] == 'Pluie faible')
                      ]]]
                  - color: 'rgb(128, 159, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['25 min'] == 'Pluie modérée')
                      ]]]
                  - color: 'rgb(51, 102, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['25 min'] == 'Pluie forte')
                      ]]]
                  - color: 'rgb(255, 255, 255)'
                    operator: default
                styles:
                  card:
                    - height: 50px
                type: 'custom:button-card'

              - color_type: card
                entity: sensor.limoges_next_rain
                name: 30
                show_icon: false
                show_state: false
                state:
                  - color: 'rgb(204, 217, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['30 min'] == 'Pluie faible')
                      ]]]
                  - color: 'rgb(128, 159, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['30 min'] == 'Pluie modérée')
                      ]]]
                  - color: 'rgb(51, 102, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['30 min'] == 'Pluie forte')
                      ]]]
                  - color: 'rgb(255, 255, 255)'
                    operator: default
                styles:
                  card:
                    - height: 50px
                type: 'custom:button-card'

              - color_type: card
                entity: sensor.limoges_next_rain
                name: 35
                show_icon: false
                show_state: false
                state:
                  - color: 'rgb(204, 217, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['35 min'] == 'Pluie faible')
                      ]]]
                  - color: 'rgb(128, 159, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['35 min'] == 'Pluie modérée')
                      ]]]
                  - color: 'rgb(51, 102, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['35 min'] == 'Pluie forte')
                      ]]]
                  - color: 'rgb(255, 255, 255)'
                    operator: default
                styles:
                  card:
                    - height: 50px
                type: 'custom:button-card'

              - color_type: card
                entity: sensor.limoges_next_rain
                name: 40
                show_icon: false
                show_state: false
                state:
                  - color: 'rgb(204, 217, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['40 min'] == 'Pluie faible')
                      ]]]
                  - color: 'rgb(128, 159, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['40 min'] == 'Pluie modérée')
                      ]]]
                  - color: 'rgb(51, 102, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['40 min'] == 'Pluie forte')
                      ]]]
                  - color: 'rgb(255, 255, 255)'
                    operator: default
                styles:
                  card:
                    - height: 50px
                type: 'custom:button-card'

              - color_type: card
                entity: sensor.limoges_next_rain
                name: 45
                show_icon: false
                show_state: false
                state:
                  - color: 'rgb(204, 217, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['45 min'] == 'Pluie faible')
                      ]]]
                  - color: 'rgb(128, 159, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['45 min'] == 'Pluie modérée')
                      ]]]
                  - color: 'rgb(51, 102, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['45 min'] == 'Pluie forte')
                      ]]]
                  - color: 'rgb(255, 255, 255)'
                    operator: default
                styles:
                  card:
                    - height: 50px
                type: 'custom:button-card'

              - color_type: card
                entity: sensor.limoges_next_rain
                name: 50
                show_icon: false
                show_state: false
                state:
                  - color: 'rgb(204, 217, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['50 min'] == 'Pluie faible')
                      ]]]
                  - color: 'rgb(128, 159, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['50 min'] == 'Pluie modérée')
                      ]]]
                  - color: 'rgb(51, 102, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['50 min'] == 'Pluie forte')
                      ]]]
                  - color: 'rgb(255, 255, 255)'
                    operator: default
                styles:
                  card:
                    - height: 50px
                type: 'custom:button-card'

              - color_type: card
                entity: sensor.limoges_next_rain
                name: 55
                show_icon: false
                show_state: false
                state:
                  - color: 'rgb(204, 217, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['55 min'] == 'Pluie faible')
                      ]]]
                  - color: 'rgb(128, 159, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['55 min'] == 'Pluie modérée')
                      ]]]
                  - color: 'rgb(51, 102, 255)'
                    operator: template
                    value: |
                      [[[
                        return states['sensor.limoges_next_rain'].attributes
                        && (states['sensor.limoges_next_rain'].attributes['1_hour_forecast']['55 min'] == 'Pluie forte')
                      ]]]
                  - color: 'rgb(255, 255, 255)'
                    operator: default
                styles:
                  card:
                    - height: 50px
                type: 'custom:button-card'
2 Likes

Ho, I did some tests in the genre without finding the right solution, thank you Papoo, oncleben31 (and everyone ^^) for the solution :).

Thank you. I think one of you could share it on the HACF forum as this target more a french speaking population.

the french subject

1 Like

Hey guys I’m new to HA and I wanted to use the custom weather card (https://github.com/Imbuzi/meteo-france-weather-card) with the meteo france integration. However I can’t seem to make it work, it just won’t show anything in the lovelace card, just like if it wasn’t there. Anyone managed to make it work?

Repostory from Imbuzi seems not maintained anymore. I suggest you try this one:
https://github.com/hacf-fr/lovelace-meteofrance-weather-card.

Some members of the HACF community have put some love recently to make it works and improve the look and feel.

2 Likes

Hello,

I’m new on home assistant, I’m working on “cards” for the good meteo-france integration for weather_alert and next_rain sensors.

Here is a first draft of the rendering:

This is my first cards too, I have to test it during different weather events to see the result before I can share it.

Nice approach too. Perhaps you should come on HACF network to coordinate with other contributor to Météo France spécific lovelace card.

It remind me old domogik good time :wink:

As already said good back in home automation dev for community.
Happy to see you back in the place for new challenge, even if already seems just done in ha :wink:

thanks for this lovely and efficient card. I’d like to size down the font of location name and temperature. I made several attemps so far with no success. Does somebody know how to achieve it? Thank you