Dearest community .
I was following this two guide for an energy monitor.
https://www.makeuseof.com/how-to-build-a-diy-household-energy-monitor-using-esp8266/
and after some tweaking i think i got the values correct on the lovelace card and the log.
But i would like it to display WATTS. As you know amps = watts ÷ volts
But i dont know enough code to make it display. I just broke the code too many times already
Any kind soul that could help me or point me in the right direction?
This it the part I am using in ESPHOME
captive_portal:
sensor:
- platform: ct_clamp
sensor: adc_sensor
name: "Measured Current"
update_interval: 5s #You may change this value (in seconds)
id: measured_current #Measured in ampere (I)
filters:
- calibrate_linear:
- 0 -> 0
- 0.49 -> 11.82
# Example source sensor
- platform: adc
pin: A0
id: adc_sensor
- platform: total_daily_energy
name: "Total Daily Power Usage"
power_id: my_power
- platform: template
id: my_power
name: "Measured Power"
lambda: return id(measured_current).state * 125 / 1000; #Power = V*I/1000. So change 230V to whatever your mains voltage is)
unit_of_measurement: 'kW'
update_interval: 5s #You may change this value (in seconds)
time:
- platform: sntp
id: my_time
all pointers are greatly appreciated.