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