I have a victron shunt that measures consumed ah as positive and negative values depending on direction to the batteries. But the sensor does never reset and just continues to show the “ah” flow which isnt realy any useful data. I created a victron_smartshunt_energy_consumption_daily with the “utility_meter” but this sensor only records rising changes and not the lowering changes and doesnt seem to care about positive or negative values.
I’d like a sensor that monitors the decrementing values and sums them up and another one for the decrementing values and sums them up. Does anyone know some logic approach for this? Only thing I’ve seen seems to be automations for input numbers that copies values when they change but it seems like an waful lot of config, has to be an easier way?
You mean net_consumption? That would give me the net ofc which would be ok I guess. But I’d ideally want two sensors, one for power in and one for power out
dont really know how to do that with utility_meter, cant find anything about decreasing values
However I could invert the original sensor with a sensor template and then use that one for daily sensor, since it seems to record the incrementing values. kind of a bad way to do it I guess
I’m unsure if I understood your post in the link correctly, but it seems like it would only update the template sensor if the value is over or under 0. But what if the value is 40 for example, and then goes down to 35? Would it record that decrease? I would like to record all decreases but your example wouldnt I guess?
The template sensors update whenever the source sensor changes. That’s how template sensors work.
Both sensors would update (“trigger”) when this change occurs. Only the positive sensor would record the change though. The negative one would remain at zero.
It is not what you want however.
Your sensor is unsuitable for that example.
If I understand you correctly you want two sensors like this:
Also that is not your Victron sensor. It is not measured in Ah. Please share the actual sensor that your battery reports, not the thing you constructed. Also any other sensors the device reports.
exact same but not multiplied with the voltage and divided by 1000 to get Wh in kWh
but yes, I want exactly what you drew. My current test is to have two utility meters, one for the original sensor and another for an inverted version of the original sensor with this:
The other way would be a utility meter with two tariffs, one for energy in, one for energy out. Then create a trend binary sensor that tracks if the energy is increasing or decreasing: