Séparer les heures creuses et pleines en fonction d’un sensor

Bonjour

une question pourquoi passer pas tasmota alors des personnes ont développé les librairies pour ESPHOME ?

l’intégration via ESPHOME permet de ségréger nativement les HP et les HC et de donner aussi nativement la période tarifaire en cours qui peut être utilisée par la suite pour déclencher des scripts ou des actions.

pour répondre sinon a vos questions
il vous faut mettre en place un utility meter

et plus particulierement la configuration avancée

Advanced Configuration

The following configuration shows an example where 2 utility_meters (daily_energy and monthly_energy) track daily and monthly energy consumptions.

Both track the same sensor (sensor.energy) which continuously monitors the energy consumed.

4 different sensors will be created, 2 per utility meter and corresponding to each tariff. Sensor sensor.daily_energy_peak, sensor.daily_energy_offpeak, sensor.monthly_energy_peak and sensor.monthly_energy_offpeak will automatically be created to track the consumption in each tariff for the given cycle.

The select.daily_energy and select.monthly_energy select entities will track the current tariff and allow changing the tariff.

utility_meter:
  daily_energy:
    source: sensor.energy
    name: Daily Energy
    cycle: daily
    tariffs:
      - peak
      - offpeak
  monthly_energy:
    source: sensor.energy
    name: Monthly Energy
    cycle: monthly
    tariffs:
      - peak
      - offpeak

YAML

Copy

Assuming your energy provider tariffs are time based according to:

  • peak: from 9h00 to 21h00
  • offpeak: from 21h00 to 9h00 next day

a time based automation can be used:

automation:
  trigger:
    - platform: time
      at: "09:00:00"
      variables:
        tariff: "peak"
    - platform: time
      at: "21:00:00"
      variables:
        tariff: "offpeak"
  action:
    - service: select.select_option
      target:
        entity_id: select.daily_energy
      data:
        option: "{{ tariff }}"
    - service: select.select_option
      target:
        entity_id: select.monthly_energy
      data:
        option: "{{ tariff }}"

vous aurez automatiquement une ségrégation des valeurs de consommation HP HC qui sera intégrable directement dans le module energy de HA