Nesse vídeo, eu mostro como montei meu Dashboard de Energia para monitoramento do consumo atual da casa e da obra, além da energia solar e quanto envio para a rede.

1. Video sobre meu monitor energético: https://youtu.be/N94VGtMUUi8

2. Sensores de Consumo, Geração, Consumo via Rede e Retorno a Rede. (sensor.yaml – no video includes/sensor/solar.yaml): 

- platform: template
  sensors:
    consumo_atual:
      unique_id: consumo_atual
      friendly_name: Consumo Atual
      unit_of_measurement: "W"
      device_class: energy
      value_template: >-
        {% if (states('sensor.shelly_fase_a')|int) + (states('sensor.shelly_fase_c')|int) > 0 %}
          {{ ((states('sensor.shelly_fase_a')|int) + (states('sensor.shelly_fase_c')|int) - (states('sensor.solplanet_producao_corrente')|int))|abs }}
        {% else %}
          {{ ((states('sensor.solplanet_producao_corrente')|int) + ((states('sensor.shelly_fase_a')|int) + (states('sensor.shelly_fase_c')|int)))|abs }}
        {% endif %}

    enviando_para_rede:
      unique_id: atual_para_rede
      friendly_name: Enviando para Rede
      unit_of_measurement: "W"
      device_class: energy
      value_template: >-
        {% if (states('sensor.solplanet_producao_corrente')|int) - (states('sensor.consumo_atual')|int) > 0 %}
          {{ ((states('sensor.solplanet_producao_corrente')|int) - (states('sensor.consumo_atual')|int)) }}
        {% else %}
          {{ (0|int) }}
        {% endif %}

    consumo_rede:
      unique_id: consumo_rede
      friendly_name: Consumo via Rede
      unit_of_measurement: "W"
      device_class: energy
      value_template: >-
        {% if (states('sensor.solplanet_producao_corrente')|int) < (states('sensor.consumo_atual')|int) %}
          {{ ((states('sensor.consumo_atual')|int) - (states('sensor.solplanet_producao_corrente')|int))|abs }}
        {% else %}
          {{ (0|int) }}
        {% endif %}

3. Sensores de Consumo, Geração, Consumo via Rede e Retorno a Rede em kWh. (sensor.yaml – no video includes/sensor/utility_meter.yaml): 

- platform: integration
  source: sensor.consumo_atual
  name: Consumo Casa
  unique_id: consumo_casa
  unit_prefix: k
  round: 2

- platform: integration
  source: sensor.enviando_para_rede
  name: Retorno a Rede
  unique_id: retorno_rede
  unit_prefix: k
  round: 2

- platform: integration
  source: sensor.consumo_rede
  name: Consumo via Rede
  unique_id: consumo_via_rede
  unit_prefix: k
  round: 2

- platform: integration
  source: sensor.solplanet_producao_corrente
  name: Solar Geração
  unique_id: solar_geracao
  unit_prefix: k
  round: 2

4. Sensores Diários e Mensais em kWh. (utility_meter.yaml – no video /includes/utility_meter.yaml): 

casa_diario:
  unique_id: casa_diario
  source: sensor.consumo_casa
  cycle: daily
  name: Consumo Diário

casa_mensal:
  unique_id: casa_mensal
  source: sensor.consumo_casa
  cycle: monthly
  offset:
    days: 20
    hours: 0
    minutes: 0
  name: Consumo Mensal

para_rede_diario:
  unique_id: para_rede_diario
  source: sensor.retorno_a_rede
  cycle: daily
  name: Para Rede Diário

para_rede_mensal:
  unique_id: para_rede_mensal
  source: sensor.retorno_a_rede
  cycle: monthly
  offset:
    days: 20
    hours: 0
    minutes: 0
  name: Para Rede Mensal

via_rede_diario:
  unique_id: via_rede_diario
  source: sensor.consumo_via_rede
  cycle: daily
  name: Via Rede Diario

via_rede_mensal:
  unique_id: via_rede_mensal
  source: sensor.consumo_via_rede
  cycle: monthly
  offset:
    days: 20
    hours: 0
    minutes: 0
  name: Via Rede Mensal

solplanet_diario:
  unique_id: solplanet_diario
  source: sensor.solar_geracao
  cycle: daily
  name: Solplanet Diário

solplanet_mensal:
  unique_id: solplanet_mensal
  source: sensor.solar_geracao
  cycle: monthly
  offset:
    days: 20
    hours: 0
    minutes: 0
  name: Solplanet Mensal

5. Configuration.yaml

sensor: !include_dir_merge_list includes/sensor/
utility_meter: !include includes/utility_meter.yaml

6. Código dos cards do Dashboard – 1a Coluna

cards:
  - type: horizontal-stack
    cards:
      - graph: none
        type: sensor
        entity: sensor.consumo_diario
        detail: 2
        icon: mdi:home-lightning-bolt
      - graph: none
        type: sensor
        entity: sensor.via_rede_diario
        detail: 2
        icon: mdi:transmission-tower-export
  - type: horizontal-stack
    cards:
      - graph: none
        type: sensor
        entity: sensor.consumo_mensal
        detail: 2
        icon: mdi:home-lightning-bolt
      - graph: none
        type: sensor
        entity: sensor.via_rede_mensal
        detail: 2
        icon: mdi:transmission-tower-export
  - type: horizontal-stack
    cards:
      - type: custom:apexcharts-card
        header:
          show: true
          title: Energia
          show_states: true
          colorize_states: true
        apex_config:
          chart:
            height: 350
            zoom:
              type: x
              enabled: true
              autoScaleYaxis: false
            toolbar:
              show: true
              autoSelected: zoom
            xaxis.type: datetime
          stroke:
            width: 1
            curve: smooth
        series:
          - entity: sensor.consumo_atual
            name: Obra
            group_by:
              func: avg
              duration: 5min
          - entity: sensor.casa_sonoff_1000dd27e4_power
            name: Casa
            group_by:
              func: avg
              duration: 5min
          - entity: sensor.enviando_para_rede
            name: Enviando a Rede
            group_by:
              func: avg
              duration: 5min
          - entity: sensor.solplanet_producao_corrente
            name: Produçao Solar
            group_by:
              func: avg
              duration: 5min
          - entity: sensor.power_production_now
            name: Estimativa
            group_by:
              func: avg
              duration: 5min
  - type: horizontal-stack
    cards:
      - type: custom:apexcharts-card
        header:
          show: true
          title: Rendimento Diário
          show_states: true
          colorize_states: true
        apex_config:
          chart:
            height: 350
            zoom:
              type: x
              enabled: true
              autoScaleYaxis: false
            toolbar:
              show: true
              autoSelected: zoom
            xaxis.type: datetime
        series:
          - entity: sensor.consumo_diario
            type: column
            name: Obra
            group_by:
              func: max
              duration: 24h
          - entity: sensor.casa_total_diario
            type: column
            name: Casa
            group_by:
              func: max
              duration: 24h
          - entity: sensor.para_rede_diario
            name: Enviado a Rede
            type: column
            group_by:
              func: max
              duration: 24h
          - entity: sensor.solplanet_diario
            type: column
            name: Produção Solar
            group_by:
              func: max
              duration: 24h
          - entity: sensor.energy_production_today
            type: column
            name: Previsão
            group_by:
              func: max
              duration: 24h
        graph_span: 5d
        span:
          end: day
  - type: energy-solar-graph
type: vertical-stack

7. Código dos cards do Dashboard – 2a Coluna

cards:
  - type: horizontal-stack
    cards:
      - graph: none
        type: sensor
        entity: sensor.solplanet_diario
        detail: 2
        icon: mdi:sun-wireless
      - graph: none
        type: sensor
        entity: sensor.para_rede_diario
        detail: 2
        icon: mdi:transmission-tower-import
  - type: horizontal-stack
    cards:
      - graph: none
        type: sensor
        entity: sensor.solplanet_mensal
        detail: 2
        icon: mdi:sun-wireless
      - graph: none
        type: sensor
        entity: sensor.para_rede_mensal
        detail: 2
        icon: mdi:transmission-tower-import
  - type: custom:tesla-style-solar-power-card
    show_w_not_kw: 1
    energy_flow_diagramm_line_factor: 4
    generation_to_grid_entity: sensor.enviando_para_rede
    generation_to_house_entity: sensor.consumo_atual
    house_entity: sensor.consumo_atual
    grid_to_house_entity: sensor.consumo_rede
    grid_entity: sensor.consumo_atual
    generation_entity: sensor.solplanet_producao_corrente
    grid_icon: mdi:transmission-tower
    generation_icon: mdi:white-balance-sunny
    house_icon: mdi:home
    show_gap: true
    hide_inactive_lines: 0
    appliance1_consumption_entity: sensor.casa_sonoff_1000dd27e4_power
    appliance1_icon: mdi:home
    change_house_bubble_color_with_flow: 1
    energy_flow_diagramm: 0
  - type: horizontal-stack
    cards:
      - type: custom:apexcharts-card
        header:
          show: true
          title: Proporção
          show_states: false
          colorize_states: true
        series:
          - entity: sensor.consumo_diario
            name: Obra
          - entity: sensor.casa_total_diario
            name: Casa
          - entity: sensor.solplanet_diario
            name: Geração
        span:
          end: day
        chart_type: donut
  - type: energy-distribution
    link_dashboard: false
  - type: horizontal-stack
    cards:
      - type: energy-grid-neutrality-gauge
      - type: energy-solar-consumed-gauge
type: vertical-stack

Pronto! Seja feliz! 😂

DEIXE UMA RESPOSTA

Please enter your comment!
Please enter your name here