# Panneaux Solaire Enphase Envoy

**URL:** <https://forum.hacf.fr/t/panneaux-solaire-enphase-envoy/3938>\
**Category:** Entraide Home Assistant\
**Created:** [Mars 31, 2021, 5:31 UTC](https://forum.hacf.fr/t/panneaux-solaire-enphase-envoy/3938 "2021-03-31T17:31:25Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Mathep](https://forum.hacf.fr/user_avatar/forum.hacf.fr/mathep/32/6443_2.png) [@Mathep](https://forum.hacf.fr/u/Mathep)\
**Post date:** [Avril 7, 2021, 10:51 UTC](https://forum.hacf.fr/t/panneaux-solaire-enphase-envoy/3938/21 "2021-04-07T22:51:04Z")

</div>

bonsoir  
les questions que tu poses sont plus liées au fonctionnement de la carte, a son codage.  
voir github

J’ai posé la question des calculs au support enphase. J’attends un retour. (j’espère)  
pierre

---

<div class="post-metadata">

**Author:** ![foXaCe](https://forum.hacf.fr/user_avatar/forum.hacf.fr/foxace/32/320_2.png) [@foXaCe](https://forum.hacf.fr/u/foXaCe)\
**Post date:** [Avril 8, 2021, 4:15 UTC](https://forum.hacf.fr/t/panneaux-solaire-enphase-envoy/3938/22 "2021-04-08T04:15:33Z")

</div>

Comment tu fais pour faire la carte de la conso jours en kWh ?  
edit : j'ai réussi merci 😊😊

Voici grâce à toi la mise à jour ma page conso

 ![final](https://forum.hacf.fr/uploads/default/original/2X/a/aa781b65f3e2d9928831f2878ebe480e58fe7e3e.jpeg)

---

<div class="post-metadata">

**Author:** ![foXaCe](https://forum.hacf.fr/user_avatar/forum.hacf.fr/foxace/32/320_2.png) [@foXaCe](https://forum.hacf.fr/u/foXaCe)\
**Post date:** [Avril 8, 2021, 4:51 UTC](https://forum.hacf.fr/t/panneaux-solaire-enphase-envoy/3938/23 "2021-04-08T16:51:46Z")

</div>

@Mathep Ta carte jour je viens que tu partages le code pour comparer parce que je ne suis pas sûr de ce que j’ai fait

---

<div class="post-metadata">

**Author:** ![Mathep](https://forum.hacf.fr/user_avatar/forum.hacf.fr/mathep/32/6443_2.png) [@Mathep](https://forum.hacf.fr/u/Mathep)\
**Post date:** [Avril 8, 2021, 5:52 UTC](https://forum.hacf.fr/t/panneaux-solaire-enphase-envoy/3938/24 "2021-04-08T17:52:21Z")

</div>

Bonsoir  
voici ma carte 'custom:power-distribution-card' sur la journée mais avec le cumul en energie, donc en Wh sur la journée.

 ![image](https://forum.hacf.fr/uploads/default/original/2X/9/9a5ebc3b0415d7b2a8d9b196e272c3592cf90066.png)

# Les entrées de l'envoy:

sensor.pv\_envoy\_today\_s\_energy\_production  
sensor.pv\_envoy\_today\_s\_energy\_consumption

# les calculs (W \> Wh \> Daily Wh)

les watts exportés puis les Wh puis le calcul jour et pareil pour l'import. Car ces valeurs ne sont toujours pas dispo dans l'envoy

# Les calculs

```yaml
# calcul power export      
      energy_exporting:
        friendly_name: "Current Energy Exporting"
        value_template: "{{ [0, (states('sensor.pv_envoy_current_energy_production') | int - states('sensor.pv_envoy_current_energy_consumption') | int)] | max }}"
        unit_of_measurement: 'W'
        icon_template: 'mdi:flash'

# calcul power import      
      energy_importing:
        friendly_name: "Current Energy Importing"
        value_template: "{{ [0, (states('sensor.pv_envoy_current_energy_consumption') | int - states('sensor.pv_envoy_current_energy_production') | int)] | max }}"
        unit_of_measurement: 'W'
        icon_template: 'mdi:flash'

# Création de l'énergie exportée sur le réseau en Wh
  - platform: integration
    source: sensor.energy_exporting
    name: energy_exported_wh
    unit_prefix: k
    round: 2
    method: left

# Création de l'énergie importée du réseau en Wh
  - platform: integration
    source: sensor.energy_importing
    name: energy_imported_wh
    unit_prefix: k
    round: 2
    method: left

# Utility Meters pour historisation       
utility_meter:
  daily_energy_import:
    source: sensor.energy_imported_wh
    cycle: daily
  daily_energy_export:
    source: sensor.energy_exported_wh
    cycle: daily

```

# La carte jour

```yaml
type: 'custom:power-distribution-card'
title: Power Home jour
entities:
  - decimals: '1'
    display_abs: true
    name: solar
    unit_of_display: kWh
    icon: 'mdi:solar-power'
    producer: true
    entity: sensor.pv_envoy_today_s_energy_production
    preset: solar
    icon_color:
      bigger: green
      equal: gray
      smaller: red
    invert_value: false
    hide_arrows: true
  - decimals: '1'
    display_abs: true
    name: Export
    unit_of_display: kWh
    icon: 'mdi:lightning-bolt-outline'
    producer: true
    entity: sensor.daily_energy_export
    preset: producer
    icon_color:
      bigger: green
      equal: gray
      smaller: red
    calc_excluded: true
    invert_value: false
    hide_arrows: true
  - decimals: '1'
    display_abs: true
    name: conso
    unit_of_display: kWh
    consumer: true
    icon: 'mdi:home'
    entity: sensor.pv_envoy_today_s_energy_consumption
    preset: consumer
    icon_color:
      bigger: red
      equal: green
      smaller: red
    invert_value: true
    hide_arrows: true
  - decimals: '1'
    display_abs: true
    name: Import
    unit_of_display: kWh
    icon: 'mdi:transmission-tower'
    entity: sensor.daily_energy_import
    preset: grid
    icon_color:
      bigger: red
      equal: gray
      smaller: green
    invert_value: true
    hide_arrows: true
center:
  type: bars
  content:
    - preset: ratio
      name: use
      bar_color: green
      bar_bg_color: ''
      entity: ''
      invert_value: false
    - preset: autarky
      name: indep
      bar_color: yellow
animation: flash

```

That all...  
et non un nouveau bidule en beta test

 ![image](https://forum.hacf.fr/uploads/default/original/2X/c/c079ff4fd6a3506396f6a6e0cd8f8c01c1bb9ed1.png)

Pierre

---

<div class="post-metadata">

**Author:** ![foXaCe](https://forum.hacf.fr/user_avatar/forum.hacf.fr/foxace/32/320_2.png) [@foXaCe](https://forum.hacf.fr/u/foXaCe)\
**Post date:** [Avril 8, 2021, 7:51 UTC](https://forum.hacf.fr/t/panneaux-solaire-enphase-envoy/3938/26 "2021-04-08T19:51:31Z")

</div>

@Mathep merci une fois de plus pour le partage  
ta new carte beta , il s’agit d’un timer pour la production jours ?

---

<div class="post-metadata">

**Author:** ![Mathep](https://forum.hacf.fr/user_avatar/forum.hacf.fr/mathep/32/6443_2.png) [@Mathep](https://forum.hacf.fr/u/Mathep)\
**Post date:** [Avril 9, 2021, 12:39 UTC](https://forum.hacf.fr/t/panneaux-solaire-enphase-envoy/3938/27 "2021-04-09T12:39:39Z")

</div>

Bonjour

pour savoir a quelle heure démarre la production des panneaux solaire, voici deux entity.  
Dans mon cas je considère qu'il me faut au moins 8w (1w par panneau, j'en ai 8)  
J'ai un état ON/OFF et je calcule la durée sur la journée. Remise a 0 le lendemain.  
Pas encore sur de vouloir garder l'historique de ce temps... Je vais voir.

 ![image](https://forum.hacf.fr/uploads/default/original/2X/5/5a9869dd3450635adb88a80e31a5df1e306c5941.png)

```auto
# Determine quand les panneaux solaire commencent a produire
binary_sensor:
  - platform: template
    sensors:
      solar_run:
        friendly_name: "Solar Run"
        delay_off:
          minutes: 2
        value_template: >-
          {{ states('sensor.pv_envoy_current_energy_production')|float > 8 }}    

```

```auto
# history demarrage panneaux solaire  
sensor:
  - platform: history_stats
    name: Solar ON today
    entity_id: binary_sensor.solar_run
    state: "on"
    type: time
    start: "{{ now().replace(hour=0, minute=0, second=0) }}"
    end: "{{ now() }}"

```

---

<div class="post-metadata">

**Author:** ![foXaCe](https://forum.hacf.fr/user_avatar/forum.hacf.fr/foxace/32/320_2.png) [@foXaCe](https://forum.hacf.fr/u/foXaCe)\
**Post date:** [Avril 9, 2021, 5:01 UTC](https://forum.hacf.fr/t/panneaux-solaire-enphase-envoy/3938/28 "2021-04-09T17:01:18Z")

</div>

Configuration invalideVÉRIFIER LA CONFIGURATION

Platform error binary\_sensor.history\_stats - No module named ‹&nbsp;homeassistant.components.history\_stats.binary\_sensor&nbsp;›

---

<div class="post-metadata">

**Author:** ![Mathep](https://forum.hacf.fr/user_avatar/forum.hacf.fr/mathep/32/6443_2.png) [@Mathep](https://forum.hacf.fr/u/Mathep)\
**Post date:** [Avril 9, 2021, 9:26 UTC](https://forum.hacf.fr/t/panneaux-solaire-enphase-envoy/3938/29 "2021-04-09T21:26:27Z")

</div>

le 2eme est un sensor il faut le mettre avec les sensors…

---

<div class="post-metadata">

**Author:** ![foXaCe](https://forum.hacf.fr/user_avatar/forum.hacf.fr/foxace/32/320_2.png) [@foXaCe](https://forum.hacf.fr/u/foXaCe)\
**Post date:** [Avril 10, 2021, 5:07 UTC](https://forum.hacf.fr/t/panneaux-solaire-enphase-envoy/3938/30 "2021-04-10T05:07:24Z")

</div>

Merci je n’avais même pas vu. Honte à moi 😂

---

<div class="post-metadata">

**Author:** ![Mathep](https://forum.hacf.fr/user_avatar/forum.hacf.fr/mathep/32/6443_2.png) [@Mathep](https://forum.hacf.fr/u/Mathep)\
**Post date:** [Avril 12, 2021, 11:33 UTC](https://forum.hacf.fr/t/panneaux-solaire-enphase-envoy/3938/31 "2021-04-12T11:33:58Z")

</div>

Bonjour  
voici un clone de vue sur l’application enphase  
Production/Consommation/Importation ou Exportation  
et avec les même couleurs...  
et sur 5 min ce qui même mieux que l'original...

 ![image](https://forum.hacf.fr/uploads/default/original/2X/6/6997a4958e890570aadfbbf45915e528e057bb4b.png)

# prerequis

> **[GitHub - RomRider/apexcharts-card: 📈 A Lovelace card to display advanced graphs and...](https://github.com/RomRider/apexcharts-card#span-options)**
>
> 📈 A Lovelace card to display advanced graphs and charts based on ApexChartsJS for Home Assistant

et un calcul pour l'energie exporte ou importe "sensor.inst\_energy\_difference"  
avec un changement de nom et d'icon suivant si c'est de l'import ou de l'export

# calcul sensor.inst\_energy\_difference

```yaml
#energy  
            #enphase special Net energy
- platform: template
    sensors:
      inst_energy_difference:
        friendly_name: Instant Energy Difference
        icon_template: >
          {% if (states("sensor.inst_energy_difference") | int > 0) -%} 
            mdi:solar-panel
          {%- elif (states("sensor.inst_energy_difference") | int < 0) -%}
            mdi:transmission-tower
          {%- else -%}
            mdi:power-off
          {%- endif %}
        friendly_name_template: >
          {% if (states("sensor.inst_energy_difference") | int > 0) -%} 
            Currently Exporting
          {%- elif (states("sensor.inst_energy_difference") | int < 0) -%}
           Currently Importing
          {%- else -%}
            Balanced
          {%- endif %}
        unit_of_measurement: "W"
        device_class: power
        value_template: >
          {{ '%0.0f' | format(states('sensor.pv_envoy_current_energy_production') | int - states('sensor.pv_envoy_current_energy_consumption') | int) }}

```

# la carte

```auto
type: 'custom:apexcharts-card'
graph_span: 24h
span:
  start: day
stacked: true
header:
  show: true
  title: Solar Prod
series:
  - entity: sensor.pv_matheenvoy_current_energy_consumption
    transform: return x *-1 ;
    type: column
    name: Conso
    color: orange
    group_by:
      func: avg
      duration: 5min
  - entity: sensor.pv_matheenvoy_current_energy_production
    type: column
    name: Prod
    color: Turquoise
    group_by:
      func: avg
      duration: 5min
  - entity: sensor.inst_energy_difference
    type: column
    name: Importé/Exporté
    transform: return x *-1 ;
    color: grey
    group_by:
      func: avg
      duration: 5min

```

Cool...  
Pierre

---

<div class="post-metadata">

**Author:** ![foXaCe](https://forum.hacf.fr/user_avatar/forum.hacf.fr/foxace/32/320_2.png) [@foXaCe](https://forum.hacf.fr/u/foXaCe)\
**Post date:** [Avril 12, 2021, 4:21 UTC](https://forum.hacf.fr/t/panneaux-solaire-enphase-envoy/3938/32 "2021-04-12T16:21:26Z")

</div>

super bravo  
tu es vraiment fort avec les template  
merci pour le partage

---

<div class="post-metadata">

**Author:** ![foXaCe](https://forum.hacf.fr/user_avatar/forum.hacf.fr/foxace/32/320_2.png) [@foXaCe](https://forum.hacf.fr/u/foXaCe)\
**Post date:** [Avril 12, 2021, 4:26 UTC](https://forum.hacf.fr/t/panneaux-solaire-enphase-envoy/3938/33 "2021-04-12T16:26:06Z")

</div>

![01](https://forum.hacf.fr/uploads/default/original/2X/0/084820e50fff1b288def64bf06a2deaf853c8c18.jpeg)

comme ca aussi pas mal non ?

---

<div class="post-metadata">

**Author:** ![foXaCe](https://forum.hacf.fr/user_avatar/forum.hacf.fr/foxace/32/320_2.png) [@foXaCe](https://forum.hacf.fr/u/foXaCe)\
**Post date:** [Avril 12, 2021, 4:43 UTC](https://forum.hacf.fr/t/panneaux-solaire-enphase-envoy/3938/34 "2021-04-12T16:43:37Z")

</div>

par contre la carte crée le graph jusqu’à la fin de la journée  
bizarre

```auto
type: 'custom:apexcharts-card'
graph_span: 24h
span:
  start: day
stacked: true
header:
  show: true
  title: Production Énergie
series:
  - entity: sensor.panneaux_solaireenvoy_current_energy_consumption
    type: area
    name: Conso
    color: red
    group_by:
      func: avg
      duration: 5min
  - entity: sensor.panneaux_solaireenvoy_current_energy_production
    type: area
    name: Prod
    color: green
    group_by:
      func: avg
      duration: 5min
  - entity: sensor.inst_energy_difference
    type: column
    name: Importé/Exporté
    transform: return x *-1 ;
    color: grey
    group_by:
      func: avg
      duration: 5min

```

---

<div class="post-metadata">

**Author:** ![foXaCe](https://forum.hacf.fr/user_avatar/forum.hacf.fr/foxace/32/320_2.png) [@foXaCe](https://forum.hacf.fr/u/foXaCe)\
**Post date:** [Avril 13, 2021, 4:22 UTC](https://forum.hacf.fr/t/panneaux-solaire-enphase-envoy/3938/35 "2021-04-13T04:22:39Z")

</div>

bonjour @Mathep

j’aimerai creer un sensor production jour en kwh ?  
tu peux m’aider stp  
merci

---

<div class="post-metadata">

**Author:** ![Clemalex](https://forum.hacf.fr/user_avatar/forum.hacf.fr/clemalex/32/3691_2.png) [@Clemalex](https://forum.hacf.fr/u/Clemalex)\
**Post date:** [Avril 13, 2021, 5:40 UTC](https://forum.hacf.fr/t/panneaux-solaire-enphase-envoy/3938/36 "2021-04-13T05:40:34Z")

</div>

En attendant la réponse, commence à regarder par ici → [Utility Meter - Home Assistant](https://www.home-assistant.io/integrations/utility_meter/)

---

<div class="post-metadata">

**Author:** ![Mathep](https://forum.hacf.fr/user_avatar/forum.hacf.fr/mathep/32/6443_2.png) [@Mathep](https://forum.hacf.fr/u/Mathep)\
**Post date:** [Avril 13, 2021, 6:53 UTC](https://forum.hacf.fr/t/panneaux-solaire-enphase-envoy/3938/37 "2021-04-13T06:53:40Z")

</div>

bonjour  
exact c’est avec utility meters que tu dois faire ce calcul  
ps:en Wh

# Utility Meters pour historisation

```auto
utility_meter:
 daily_energy_prod:
    source: sensor.pv_envoy_today_s_energy_production
    cycle: daily

```

et toi, as-tu des trucs sympa a partager ?  
pierre

---

<div class="post-metadata">

**Author:** ![angusc](https://forum.hacf.fr/letter_avatar_proxy/v4/letter/a/c6cbf5/32.png) [@angusc](https://forum.hacf.fr/u/angusc)\
**Post date:** [Avril 13, 2021, 3:53 UTC](https://forum.hacf.fr/t/panneaux-solaire-enphase-envoy/3938/38 "2021-04-13T15:53:55Z")

</div>

Bonjour @foXaCe

To create your watts to kW or kWh you have to create a sensor file, call it as you like in my case this: «&nbsp;solar\_wh\_to\_kwh.yaml&nbsp;»

```auto
sensor:
  - platform: template
    sensors:
        pv_solar_production_kwh:
          friendly_name: "pv_solar_production_kwh"
          unit_of_measurement: 'kWh'
          value_template: "{{ states('sensor.pv_envoy_today_s_energy_production') | float / 1000 }}"
          
        pv_solar_todays_consumption_kwh:
          friendly_name: "pv_solar_todays_consumption_kwh"
          unit_of_measurement: 'kWh'
          value_template: "{{ states('sensor.pv_envoy_today_s_energy_consumption') | float / 1000 }}"

```

then you select the new sensor after you have restarted your Home Assistant.

---

<div class="post-metadata">

**Author:** ![angusc](https://forum.hacf.fr/letter_avatar_proxy/v4/letter/a/c6cbf5/32.png) [@angusc](https://forum.hacf.fr/u/angusc)\
**Post date:** [Avril 13, 2021, 3:59 UTC](https://forum.hacf.fr/t/panneaux-solaire-enphase-envoy/3938/39 "2021-04-13T15:59:49Z")

</div>

@Mathep

Not as cool as everything that you shared with us my friend, merci beaucoup!!

 ![image](https://forum.hacf.fr/uploads/default/original/2X/8/8e5dfc21d19c5ac2ad084a128707f9e4130d1084.png)

Here is something using custom mini graphs please install from HACS if you do not already have it. then the custom card input is as follows:

```auto
type: 'custom:mini-graph-card'
icon: 'mdi:solar-power'
hours_to_show: 14
name: Solar
unit: kW
value_factor: -3
points_per_hour: 4
entities:
  - name: Production
    show_state: true
    color: Blue
    index: 0
    entity: sensor.pv_envoy_current_energy_production
  - name: Consumption
    show_state: true
    color: Red
    index: 1
    entity: sensor.pv_envoy_current_energy_consumption

```

---

<div class="post-metadata">

**Author:** ![angusc](https://forum.hacf.fr/letter_avatar_proxy/v4/letter/a/c6cbf5/32.png) [@angusc](https://forum.hacf.fr/u/angusc)\
**Post date:** [Avril 13, 2021, 4:15 UTC](https://forum.hacf.fr/t/panneaux-solaire-enphase-envoy/3938/40 "2021-04-13T16:15:49Z")

</div>

Here is my Enphase Solar screen:

 ![image](https://forum.hacf.fr/uploads/default/original/2X/3/342c73dfd0d825bbc67b6af1e361e5803fb1b26e.jpeg)

Most is using the Enphase API to gain the per panel Watts and consumption and production numbers in the stats cards.

I tihnk you know it from the configurtion file:

```auto
# EnPhase Data
sensor:
  - platform: enphase_envoy
    name: pv
    ip_address: 192.168.xxx.xxx
    username: envoy
    monitored_conditions:
      - production
      - daily_production
      - seven_days_production
      - seven_days_consumption
      - lifetime_production
      - lifetime_consumption
      - consumption
      - daily_consumption
      - inverters

```

Then is possible to find all the above sensors to add to your Lovelace display.

---

<div class="post-metadata">

**Author:** ![foXaCe](https://forum.hacf.fr/user_avatar/forum.hacf.fr/foxace/32/320_2.png) [@foXaCe](https://forum.hacf.fr/u/foXaCe)\
**Post date:** [Avril 13, 2021, 4:44 UTC](https://forum.hacf.fr/t/panneaux-solaire-enphase-envoy/3938/41 "2021-04-13T16:44:39Z")

</div>

Merci beaucoup.

je vais regarder ca en rentrant du travail  
et encore merci @Mathep pour tout les partages

[Page précédente](https://forum.hacf.fr/t/panneaux-solaire-enphase-envoy/3938.md?page=1)

[Page suivante](https://forum.hacf.fr/t/panneaux-solaire-enphase-envoy/3938.md?page=3)
