Hello all,
I want to create a power sensor to measure the current consumtion of a device.
Therefor I’m using an INA219 sensor to measure the power in W. I also have an integration sensor to get the energy value in kWh.
Now I want to have some statistics for the energy consumption on Monday, Thuesday,…, this week, last week, this month, last month, and so on.
Unfortunately I have no clue ho to implement this in my code, as I’m new to ESPHome.
Can you give me any advice?
Here is my code:
time:
- platform: sntp
id: sntp_time
ensor:
- platform: ina219
address: 0x40
shunt_resistance: 0.085 ohm
power:
name: "Solar_Leistung"
unit_of_measurement: "W"
icon: "mdi:current-dc"
device_class: "power"
state_class: "measurement"
accuracy_decimals: 2
id: solar_leistung
max_voltage: 32.0V
max_current: 3.2A
update_interval: 10s
- platform: integration
name: "Solar_Energie"
sensor: solar_leistung
time_unit: h
unit_of_measurement: "kWh"
accuracy_decimals: 3
device_class: "energy"
state_class: "total"
filters:
- multiply: 0.001
Thanks for your help.
Bernd