Hello guest, if you read this it means you are not registered. Click here to register in a few simple steps, you will enjoy all features of our Forum.
Hi Guest this is an announcement for guests !!!

Note de ce sujet :
  • Moyenne : 0 (0 vote(s))
  • 1
  • 2
  • 3
  • 4
  • 5
recherche formule calcul temps d'utilisation
#35
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


 
Like Répondre


Messages dans ce sujet
RE: recherche formule calcul temps d'utilisation - par trucjp - 27-03-2024, 11:20 PM

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)
[-]
discussions récentes
5ggm How to Customize Auto Swi...
Player switching can have a ma...Taylorlly — 09:56 AM
Réduire les abonnements fixes ...
Salut à tous, En parallèle du...Bearni — 06:27 AM
Présentation - Bearni
Bonjour à tous, Moi c'est Bea...Bearni — 06:25 AM
prise en charge gateway
Cảm thấy cô đơn? Kết nối ngay ...hande2910 — 03:56 AM
Playing Wordle Unlimited: A S...
Feeling lonely? Connect instan...hande2910 — 03:54 AM
système de pilotage Pilontech ...
Bonjour la Team, je viens vou...STF — 02:51 PM
game
Documentation consistency dese...kemod95673 — 01:48 PM
A Guide to Slope 2 and Beyond:...
A Guide to Slope 2 and Beyond:...rodent22 — 04:21 AM
Playing Wordle Unlimited: A Si...
There's something oddly satisf...mollusk11 — 09:48 AM
game
Bonjour à tous ! En parcourant...xxxbpss — 11:01 PM
game
Центральна Австралія завжди зд...meoowu77 — 12:38 PM

[-]
Rechercher








(Advanced Search)

[-]
Who's Online
There are currently 393 online users. [Complete List]
» 1 Member(s) | 392 Guest(s)
Avatar

[-]
goals
79.7% of the way to our goal of 10,000 posts!
Only 2,034 posts left to go!

[-]
Statistics
» Members: 1,143
» Latest member: jackoscar
» Forum threads: 907
» Forum posts: 7,965

Full Statistics

[-]
Latest Threads
5ggm How to Customize Auto Switching Set...
Last Post: Taylorlly
Aujourd’hui 09:56 AM
» Replies: 0
» Views: 15
Réduire les abonnements fixes de la mais...
Last Post: Bearni
Aujourd’hui 06:27 AM
» Replies: 0
» Views: 23
Présentation - Bearni
Last Post: Bearni
Aujourd’hui 06:25 AM
» Replies: 0
» Views: 24
prise en charge gateway
Last Post: hande2910
11-11-2026 03:56 AM
» Replies: 2
» Views: 2378
Playing Wordle Unlimited: A Simple Game ...
Last Post: hande2910
11-11-2026 03:54 AM
» Replies: 1
» Views: 183
système de pilotage Pilontech 24V
Last Post: STF
06-11-2026 02:51 PM
» Replies: 0
» Views: 147
game
Last Post: kemod95673
05-11-2026 01:48 PM
» Replies: 1
» Views: 282
A Guide to Slope 2 and Beyond: Mastering...
Last Post: rodent22
05-11-2026 04:21 AM
» Replies: 0
» Views: 185
game
Last Post: meoowu77
01-11-2026 12:38 PM
» Replies: 1
» Views: 536
Pochette Switch Personnalisable : Guide ...
Last Post: gestaltenselbstdiy
29-10-2026 03:17 AM
» Replies: 0
» Views: 311

>