utility_meter:
  periodo_consumo_diario_varios_2:
    source: sensor.consumo_varios_2
    cycle: daily
    tariffs:
      - punta
      - valle
  periodo_consumo_mensual_varios_2:
    source: sensor.consumo_varios_2
    cycle: monthly
    offset:
      days: 1
      hours: 0
      minutes: 0
    tariffs:
      - punta
      - valle

sensor:
  - platform: template
    sensors:
      consumo_bruto_diario_varios_2:
        friendly_name: Consumo Bruto Diario Varios 2
        unit_of_measurement: kWh
        value_template: "{{ states('sensor.periodo_consumo_diario_varios_2_punta')|float + states('sensor.periodo_consumo_diario_varios_2_valle')|float |round(2) }}"
      consumo_bruto_mensual_varios_2:
        friendly_name: Consumo Bruto Mensual Varios 2
        unit_of_measurement: kWh
        value_template: "{{ states('sensor.periodo_consumo_mensual_varios_2_punta')|float + states('sensor.periodo_consumo_mensual_varios_2_valle')|float |round(2) }}"

  - platform: integration
    source: sensor.consumo_bruto_diario_varios_2
    name: Consumo Integrado Diario Varios 2
    unit: kWh
    round: 2

  - platform: integration
    source: sensor.consumo_bruto_mensual_varios_2
    name: Consumo Integrado Mensual Varios 2
    unit: kWh
    round: 2
