So, i have a SDM120 that gives me the whole house energy measurement, and have a guest house connected to the same grid, the SDM120 gives me the energy of the house and guest house, so i did this template sensor to calculate the energy that the house is using:
Can anyone help me with a calculation.
I use the below template to calculate what my house is consuming, since the apartment uses power from the house, (i could setup another sensor just for the house, but i dont have anymore space on the electric board), i have HA calculate what the house is using by subtracting the apartment power from the house sensor and i get what power im using, works great most of the time, but i have solar panels, and when the house sensor is giving negative values, it gives me wrong values.
Is there a way to make it that when the template sensor result is negative value, the result would be a zero?