I’m new to Homeassistant (about 3 weeks in now) and am really struggling to get my energy usage dashboard working correctly.
I have Solar & Batteries which I believe is maybe where the problem lies as all was fine before when I tested HA with a clamp meter.
I’ve got the “Solarman” integration which monitors the inverter, this sends data from modbus registers to a sensor in homeassistant “Total Energy Imported” The data appears to be correct if I view the sensor state in HA and if I look at a graph of the values over time it looks ok, apart from dropping out a few times.
However, the energy numbers are all over the place. As an example, grid usage today has several spikes,
When I look at a graph of the sensor, I see it seems to be dropping out the odd time and wonder if that’s something to do with the crazy numbers, but none of the drop outs correspond to the big spikes showing on the dashboard.
Just one final question on this, one of the values (for solar export) is dipping to 0 but also for some weird reason spikes to over 150 million kWh. So, I need to set availability to be between two values.
I’ve pasted the template below (it doesn’t work but just to illustrate what i’m trying to do), I just don’t understand the actual code I need to use.
- name: "Filtered Total Energy Exported"
icon: mdi-counter
unit_of_measurement: "kWh"
state: "{{ states('sensor.solis_total_energy_exported')|float(0) }}"
availability: "{{ states('sensor.solis_total_energy_exported')|float(0) >10 & < 1000000 }}"
device_class: energy
state_class: "total_increasing"