#Sensors for energy dashboard in configuration.yml

1 messages · Page 1 of 1 (latest)

oblique cedar
#

Hi everyone,
I’m trying to set up sensors for the Energy Dashboard, but I only have instant sensors that measure values at a given moment. For example, I have a water flow valve sensor (IFM SV4500) that reports the current water flow rate (0.06 to 1.2 m³/h). I’d like to know how to configure these sensors as templates for testing purposes to see how the values progress in the dashboard. Can you provide me and example?

Here's my current attempt:

#############################
# 1) INSTANT SENSORS (for testing purposes)
#############################
template:
  - sensor:
      # ============================
      # ENERGY (Power in kW)
      # ============================
      - name: "Total Energy Consumption Instant"
        unit_of_measurement: "kW"
        state: 2.0  # constant for testing
        state_class: measurement

  
      # ============================
      # WATER (Flow in m³/h)
      # ============================
      - name: "Consumo Total de Água Instant"
        unit_of_measurement: "m³/h"
        state: 1.1  # constant for testing
        device_class: water
        state_class: measurement

###########################################
# 2) INTEGRATION (Riemann Sum)
###########################################
sensor:
  - platform: integration
    name: "Total Energy Consumption"
    source: sensor.total_energy_consumption_instant
    round: 2
    max_sub_interval:
      minutes: 1

  # ============================
  # WATER (this does not work in energy dashboard) (should be m3)
  # ============================
  - platform: integration
    name: "Consumo Total de Água"
    source: sensor.consumo_total_de_agua_instant
    round: 2
    method: trapezoidal
    max_sub_interval:
      minutes: 1
high seal
#

Change the device class on your flow rate from water to volume_flow_rate and it should recognise the units properly

#

Water is configured as a volume rather than a flow rate