There is no real “Dashboard” I just a used of the Grafana graph editor.
The query options altered:
- Min interval: 1M , i.e. 1 month
Three energy entities are use:
- Heating (called Värme) - heating_including_int_add_heat_31578.
- Hot water (called Varmvatten) - hot_water_including_add_heat_31576
- Consumption (called Förbrukning) - enery_spent_nibe
The last one is an “integration” sensor which uses the power sensor available from the Nibe integration:
sensor riemann:
- platform: integration
source: sensor.s1255_anvand_effekt
name: energy_spent_nibe
unit_prefix: k
round: 2
There’s a limitation in the “integration” integration as it doesn’t set a proper “state_class”. Hence I needed to add it manually:
homeassistant:
....
customize:
....
sensor.energy_spent_nibe:
state_class: total_increasing
Further the “s1255_anvand_effekt” is a template sensor as I have had problems with bogus values from the Nibe integration sensor. It may not actually be a problem anymore as I’ve switched from Modbus to the “proper” Nibe integration. Anyway the Nibe power template sensor definition is as:
template:
.....
- sensor:
name: "S1255 använd effekt"
unit_of_measurement: "W"
device_class: power
unique_id: s1255.anvand.power
state: >
{% set s1255_power = states('sensor.instantaneous_used_power_32167') %}
{% if is_number(s1255_power) %}
{% set s1255_power = s1255_power | float(0) %}
{{ s1255_power }}
{% else %}
None
{% endif %}
Each of the entities in the Grafana diagram uses the following settings:
- From default KWh WHERE entity_id =
- SELECT field (value) last() difference()
- GROUP BY time($__interval= fill (previous)
- TIMEZONE ORDER BY TIME ascending
- LIMIT SLIMIT
- FORMAT AS Time series ALIAS
In addition to the entities I also added two Grafana expressions. The first is called “Produktion”, “Production” in English:
- Operation Math
- Expression $Varmvatten + $Värme
The second is called “COP”.
- Operation Math
- Expression ($Varmvatten + $Värme)/$Förbrukning
Then I used panel options to get a legend which includes the “Max”, “Mean”, “Min” and “Total” figures. These figures may not work for all entities, e.g. the COP, but is handy for others.
I haven’t really got to fix the alignment of the time series. E.g. selecting the time window “This year so far” split the diagram bars on the 13th as it is the 13th of September today. Further the “1M” “macro” seems to be recalculate to a 30 days time window for each monthly bar which is not always correct, around 50% correct. The 13th seem to stick even if you select another time window by select a specific time range. I don’t really understand what is going on here.