Skip to content

Commit

Permalink
Resolve "Plants overview now - Energia Perduda dia anterior" (et/some…
Browse files Browse the repository at this point in the history
…nergia-jardiner!118)

Closes #173

Merge branch '173-plants-overview-now-energia-perduda-dia-anterior' into 'main'
  • Loading branch information
polmonso committed Feb 21, 2024
2 parents 1ef1706 + 422479c commit 3fcb884
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@ select
round(overview.instant_power_plant_kw, 2) as potencia_inst_kw,
round(overview.instant_power_plant_kw / overview.nominal_power_kw, 2) as potencia_inst_vs_nominal,
overview.day as dia,
case
when overview.day > now() - interval '2 days' then
round((overview.meter_exported_energy_kwh - overview.solargis_meter_expected_energy_kwh) / 1000, 2)
end as energia_perduda_ahir_mwh,
round((overview.meter_exported_energy_kwh - overview.solargis_meter_expected_energy_kwh) / 1000, 2) as energia_perduda_mwh
from {{ ref("int_plants_overview_instant") }} as overview
6 changes: 2 additions & 4 deletions superset/produccio_davui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ html: >
<th> Potència instantània temps de lectura</th>
<th> Potència instantània [kW]</th>
<th> Potència instantània vs nominal [%]</th>
<th> Dia </th>
<th> Energia Perduda [MWh] <br> dia anterior </th>
<th> Energia Perduda Ahir [MWh]</th>
</tr>
</thead>
<tbody>
Expand All @@ -29,8 +28,7 @@ html: >
<td>{{ potencia_inst_ts }}</td>
<td>{{ potencia_inst_kw }}</td>
<td>{{#if potencia_inst_vs_nominal}}<span> {{ potencia_inst_vs_nominal }}% </span><progress value="{{ potencia_inst_vs_nominal}}" max="100"> </progress>{{/if}}</td>
<td>{{ dateFormat dia }}</td>
<td>{{ energia_perduda_mwh }}</td>
<td>{{ energia_perduda_ahir_mwh }}</td>
</tr>
{{/each}}
</tbody>
Expand Down

0 comments on commit 3fcb884

Please sign in to comment.