voici mon config.yaml
Code :
# Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
sensor:
- platform: history_stats
name: Mode Solaire Durée
entity_id: sensor.voltronic_1_mode_info
state: "solaire"
type: time
start: "{{ today_at() }}"
end: "{{ now() }}"
#Capteur en watt heure production
- platform: integration
source: sensor.voltronic_1_pv_watt
name: production_pv_wh
unit_prefix: k
round: 3
method: left
#Capteur en watt heure consommation maison
- platform: integration
source: sensor.voltronic_1_conso_maison_watt
name: conso_maison_wh
unit_prefix: k
round: 3
method: left
#Création d'un capteur solaire jour
- platform: history_stats
name: temps_solaire_aujourdhui
entity_id: sensor.voltronic_1_mode_info
state: 'solaire'
type: time
start: "{{ now().replace(hour=0, minute=0, second=0, microsecond=0) }}"
end: "{{ now() }}"
#Création d'un capteur solaire hier
- platform: history_stats
name: temps_solaire_hier
entity_id: sensor.voltronic_1_mode_info
state: 'solaire'
type: time
end: "{{ now().replace(hour=0, minute=0, second=0, microsecond=0) }}"
duration:
hours: 24
#Création d'un capteur solaire semaine
- platform: history_stats
name: temps_solaire_semaine
entity_id: sensor.voltronic_1_mode_info
state: 'solaire'
type: time
start: "{{ as_timestamp( now().replace(hour=0, minute=0, second=0, microsecond=0) ) - now().weekday() * 86400 }}"
end: "{{ now() }}"
#Création d'un capteur solaire mois
- platform: history_stats
name: temps_solaire_mois
entity_id: sensor.voltronic_1_mode_info
state: 'solaire'
type: time
start: "{{ now().replace(day=1, hour=0, minute=0, second=0, microsecond=0 ) }}"
end: "{{ now() }}"
#Création d'un capteur edf jour
- platform: history_stats
name: temps_edf_ajourdhui
entity_id: sensor.voltronic_1_mode_info
state: 'edf'
type: time
start: "{{ now().replace(hour=0, minute=0, second=0, microsecond=0) }}"
end: "{{ now() }}"
#Création d'un capteur edf hier
- platform: history_stats
name: temps_edf_hier
entity_id: sensor.voltronic_1_mode_info
state: 'edf'
type: time
end: "{{ now().replace(hour=0, minute=0, second=0, microsecond=0) }}"
duration:
hours: 24
#Création d'un capteur edf semaine
- platform: history_stats
name: temps_edf_semaine
entity_id: sensor.voltronic_1_mode_info
state: 'edf'
type: time
start: "{{ as_timestamp( now().replace(hour=0, minute=0, second=0, microsecond=0) ) - now().weekday() * 86400 }}"
end: "{{ now() }}"
#Création d'un capteur edf mois
- platform: history_stats
name: temps_edf_mois
entity_id: sensor.voltronic_1_mode_info
state: 'edf'
type: time
start: "{{ now().replace(day=1, hour=0, minute=0, second=0, microsecond=0 ) }}"
end: "{{ now() }}"
template:
- sensor:
temps_aujourdhui:
device_class: duration
value_template: "{% set hours = states('sensor.temps_solaire_aujourdhui') | float %}
{% set minutes = ((hours % 1) * 60) | int %}
{{ '%02ih %02im'%(hours // 1, minutes) }}"
friendly_name: temps_aujourdhui
unique_id: "temps_aujourdhui"
temps_hier:
device_class: duration
value_template: "{% set hours = states('sensor.temps_solaire_hier') | float %}
{% set minutes = ((hours % 1) * 60) | int %}
{{ '%02ih %02im'%(hours // 1, minutes) }}"
friendly_name: temps_hier
unique_id: "temps_hier"
temps_semaine:
device_class: duration
value_template: "{% set hours = states('sensor.temps_solaire_semaine') | float %}
{% set minutes = ((hours % 1) * 60) | int %}
{{ '%02ih %02im'%(hours // 1, minutes) }}"
friendly_name: temps_semaine
unique_id: "temps_semaine"
temps_mois:
device_class: duration
value_template: "{% set hours = states('sensor.temps_solaire_mois') | float %}
{% set minutes = ((hours % 1) * 60) | int %}
{{ '%02ih %02im'%(hours // 1, minutes) }}"
friendly_name: temps_mois
unique_id: "temps_mois"
#Capteur en watt heure production
- platform: integration
source: sensor.voltronic_1_pv_watt
name: production_pv_wh
unit_prefix: k
round: 3
method: left
#Capteur en watt heure consommation maison
- platform: integration
source: sensor.voltronic_1_conso_maison_watt
name: conso_maison_wh
unit_prefix: k
round: 3
method: left
utility_meter:
#Consomation maison par cycle, année, mois, jour, heure
conso_maison_wh_annee:
source: sensor.conso_maison_wh
cycle: yearly
conso_maison_wh_mois:
source: sensor.conso_maison_wh
cycle: monthly
conso_maison_wh_jour:
source: sensor.conso_maison_wh
cycle: daily
conso_maison_wh_heure:
source: sensor.conso_maison_wh
cycle: hourly
#Production PV par cycle, année, mois, jour, heure
production_pv_wh_annee:
source: sensor.production_pv_wh
cycle: yearly
production_pv_wh_mois:
source: sensor.production_pv_wh
cycle: monthly
production_pv_wh_jour:
source: sensor.production_pv_wh
cycle: daily
production_pv_wh_heure:
source: sensor.production_pv_wh
cycle: hourly
influxdb:
host: a0d7b954-influxdb
port: 8086
database: homeassistantDB
username: xxxxxxx
password: xxxxxxx
max_retries: 3
default_measurement: state