I’m a pretty new user to Home Assistant, but I have developed a decently integrated system of Tuya, Google Nest, MyQ, and other devices, and this platform is wonderful!
I am stumped, however, on how to create a usable solution for power consumption.
I “rolled my own” pulse counter for the IR emitter on the top of an iTron power meter with a NodeMCU ESP8266 board. When going to its website http://192.168.2.x/msg?command=pulses, it returns a single number. This number starts at 0 when the ESP8266 is powered on, and increments with an integer during every pulse of the IR LED. This can be read as often as needed of course by going to that URL.
I have integrated this so far with a rest platform sensor…
sensor:
- platform: rest
name: power_meter_ir
resource: http://192.168.2.x/msg?command=pulses
unit_of_measurement: 'pulses'
scan_interval: 15
device_class: power
state_class: total_increasing
I created a sensor card in Lovelace to view this information as a graph, and the graph itself gives a valuable indication on when my power usage is greater or lower. However, the actual pulse number is rather useless.
What is the best way to create an entity in the program to read this as watts? From what I understand, every pulse of an iTron power meter is 1 watt/hour. The scan interval can be changed as needed. The goal is to get the most “realtime” measurement of wattage consumption as possible.