I give up trying by myself. It’s been 3 days constantly trying different things but I can’t find the solution. But I bet it is a very simple thing for you guys.
I’m trying to get the nice energy graph to work with the total power from my house. I can get this graph working just fine with ESPHOME using the ADS1115 like this:
> sensor:
> - platform: ads1115
> multiplexer: 'A0_GND'
> gain: 2.048
> name: "ADS1115 Channel A0-GND"
> ads1115_id: ads1115_0
> update_interval: 2s
> id: sens0
>
> - platform: ct_clamp
> sensor: sens0 #adc_sensor
> name: "Measured Current 0"
> update_interval: 2s
> sample_duration: 700ms
> accuracy_decimals: 5
> id: ampere_ct1
> device_class: current
> unit_of_measurement: A
> filters:
> - lambda: |-
> if (x < 0.0040) return {0};
> float rs = 22.2;
> return {rs * x};
>
> - platform: template
> name: "Puissance"
> lambda: |-
> if ( id(ampere_ct1).state <0) {
> return 0;
> }
> return( 120 * id(ampere_ct1).state);
> accuracy_decimals: 2
> update_interval: 5s
> state_class: measurement
> device_class: power
> unit_of_measurement: "W"
> id: ac_puissance
>
> - platform: total_daily_energy
> name: "Total Daily Energy"
> power_id: ac_puissance
> filters:
> - multiply: 0.001
> unit_of_measurement: kWh
> device_class: energy
> restore: False
> state_class: total_increasing
This is working fine for my coffee machine. This is using the platform “total_daily_energy” in the energy card as expected. What I want to do is to bring the total wattage from my already existing system that I built several years ago (which is working already perfectly good after many many fine tuning). So I added a POST tcp line in my old system to bring the actual running wattage in home assistant. For now, it is coming in a counter. Like this;
I understand that I would need to bring this wattage into a usage kwh. I used an INTEGRAL HELPER to accumulate the usage. Like this:
This helper seems to be doing its right calculation. But since it is not a device_class = energy and not either a state_class = total_increasing, and it doesn’t have any unit_of_measurement, then it is not available to the energy card.
I tried so many different things, but I couldn’t get it right. What am I missing?