# \[CARTE\] Home assistant Sun card - pour les phases du soleil

**URL:** <https://forum.hacf.fr/t/carte-home-assistant-sun-card-pour-les-phases-du-soleil/4927>\
**Category:** Interface / Lovelace / Thème / Custom Card\
**Tags:** card\
**Created:** [Mai 29, 2021, 9:24 UTC](https://forum.hacf.fr/t/carte-home-assistant-sun-card-pour-les-phases-du-soleil/4927 "2021-05-29T21:24:15Z")\
**Posts on this page:** 1\
**Showing post:** 26

<div class="post-metadata">

**Author:** ![Vince60](https://forum.hacf.fr/letter_avatar_proxy/v4/letter/v/45deac/32.png) [@Vince60](https://forum.hacf.fr/u/Vince60)\
**Post date:** [Décembre 16, 2021, 8:39 UTC](https://forum.hacf.fr/t/carte-home-assistant-sun-card-pour-les-phases-du-soleil/4927/26 "2021-12-16T20:39:08Z")

</div>

J’ai l’impression qu’il y a une partie de code qui correspond à une autre carte sun Card.  
[https://community.home-assistant.io/t/lovelace-sun-card/109489](https://community.home-assistant.io/t/lovelace-sun-card/109489)  
La carte utilisée ici est celle de [https://github.com/AitorDB/home-assistant-sun-card](https://github.com/AitorDB/home-assistant-sun-card) et sa configuration est différente.  
Les codes suivant apportent le même résultat

```auto
    type: custom:stack-in-card
    title: Suivi du soleil
    mode: vertical
    cards:
      - type: horizontal-stack
        cards:
          - type: vertical-stack
            cards:
              - type: custom:compass-card
                language: fr
                indicator_sensors:
                  - sensor: sun.sun
                    attribute: azimuth
                    indicator:
                      type: circle
                      color: orange
                      dynamic_style:
                        sensor: sun.sun
                        attribute: elevation
                        bands:
                          - from_value: 0
                            show: true
                value_sensors:
                  - sensor: sun.sun
                    attribute: elevation
                    units: °
                    decimals: 1
                compass:
                  circle:
                    background_image: \local\community\compass-card\home.png
                    background_opacity: 0.5
                  north:
                    show: true
                    offset: 0
                  east:
                    show: true
                  west:
                    show: true
                  south:
                    show: true
              - type: markdown
                content: |
                  <center>Azimuth: {{ state_attr('sun.sun', 'azimuth') }}°</center>
                  <center>Saison: {{ states("sensor.saison") }}</center> 
          - type: custom:sun-card
            card_mod:
              style: |
                .sun-card-footer .sun-card-text-subtitle {
                    font-size: 1rem !important;
                    color: var(--primary-text-color) !important;
                }
                .sun-card-header .sun-card-text-subtitle {
                    font-size: 1rem !important;
                    color: var(--primary-text-color) !important;
                }
                .sun-card-header .sun-card-text-time {
                    font-size: 1.1rem !important;
                    color: var(--primary-text-color) !important;
                }
                .sun-card-footer .sun-card-text-time {
                    font-size: 1.1rem !important;
                    color: var(--primary-text-color) !important;
                }

```

```auto
sun:

sensor:
  - platform: template
    sensors:
      saison:
        value_template: >
          {% if is_state("sensor.season", "spring") %}
            Printemps
          {% elif is_state("sensor.season", "summer") %}
            Eté
          {% elif is_state("sensor.season", "autumn") %}
            Automne
          {% else %}
            Hiver
          {% endif %}

```

---

_[View the full topic](https://forum.hacf.fr/t/carte-home-assistant-sun-card-pour-les-phases-du-soleil/4927)._
