pour celle de la journée tu change juste les entités en today sur la carte ?
si je fais ca le calcul indep ne correspond pas par rapport a la web de enphase.
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
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
@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
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.
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
# 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
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
Pierre
@Mathep merci une fois de plus pour le partage
ta new carte beta , il s’agit d’un timer pour la production jours ?
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.
# 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 }}
# 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() }}"
Configuration invalideVÉRIFIER LA CONFIGURATION
Platform error binary_sensor.history_stats - No module named ‹ homeassistant.components.history_stats.binary_sensor ›
le 2eme est un sensor il faut le mettre avec les sensors…
Merci je n’avais même pas vu. Honte à moi
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…
prerequis
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
#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
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
super bravo
tu es vraiment fort avec les template
merci pour le partage
comme ca aussi pas mal non ?
par contre la carte crée le graph jusqu’à la fin de la journée
bizarre
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
bonjour
exact c’est avec utility meters que tu dois faire ce calcul
ps:en Wh
Utility Meters pour historisation
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
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: « solar_wh_to_kwh.yaml »
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.
Not as cool as everything that you shared with us my friend, merci beaucoup!!
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:
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