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
Online platform with cool bonu...
After spending two hours under...ramsaybolt — 10:41 PM
Pochette Switch Personnalisabl...
Acheter son premier accessoire...gestaltenselbstdiy — 03:17 AM
Herren Hemd selbst gestalten: ...
Standardgrößen von der Stange ...gestaltenselbstdiy — 03:04 AM
Install Deye Pylontech chez u...
Hello, Il faudrait que tu j...jlm — 06:24 PM
Install Deye Pylontech chez un...
Salut, Jeudi dernier j'étai...Angelos — 03:15 PM
Intégration SynSynk/DEYE avec...
Mieux ce n'est pas possible.Anna202 — 10:57 AM
Entertainment online platform ...
I was having a chat with my br...ramsaybolt — 01:01 AM
MapleStory Classic World: Plan...
Building a reliable character ...ZeonLau — 09:23 AM
Build a Better NBA 2K27 MyTEAM...
Building a competitive MyTEAM ...ZeonLau — 08:58 AM
MapleStory Classic World Progr...
Progress in MapleStory Classic...ZeonLau — 08:50 AM
Aion 2 Budget Tips Spend Smart...
In Aion 2, steady character de...ZeonLau — 08:36 AM

[-]
Rechercher








(Advanced Search)

[-]
Who's Online
There are currently no members online.

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

[-]
Statistics
» Members: 1,115
» Latest member: AnastsiyaDer
» Forum threads: 904
» Forum posts: 7,958

Full Statistics

[-]
Latest Threads
Online platform with cool bonuses
Last Post: ramsaybolt
Aujourd’hui 10:41 PM
» Replies: 0
» Views: 3
Pochette Switch Personnalisable : Guide ...
Last Post: gestaltenselbstdiy
Hier 03:17 AM
» Replies: 0
» Views: 51
Herren Hemd selbst gestalten: Stil & Pas...
Last Post: gestaltenselbstdiy
Hier 03:04 AM
» Replies: 0
» Views: 54
Install Deye Pylontech chez un client, e...
Last Post: jlm
27-10-2026 06:24 PM
» Replies: 1
» Views: 142
Intégration SynSynk/DEYE avec HA ou ...
Last Post: Anna202
20-10-2026 10:57 AM
» Replies: 15
» Views: 23442
Entertainment online platform in your fr...
Last Post: ramsaybolt
19-10-2026 01:01 AM
» Replies: 0
» Views: 252
MapleStory Classic World: Plan Gear Upgr...
Last Post: ZeonLau
17-10-2026 09:23 AM
» Replies: 0
» Views: 334
Build a Better NBA 2K27 MyTEAM With U4GM
Last Post: ZeonLau
17-10-2026 08:58 AM
» Replies: 0
» Views: 289
MapleStory Classic World Progress Tips F...
Last Post: ZeonLau
17-10-2026 08:50 AM
» Replies: 0
» Views: 274
Aion 2 Budget Tips Spend Smarter With U4...
Last Post: ZeonLau
17-10-2026 08:36 AM
» Replies: 0
» Views: 284

>