I have a strange problem with my total reading.
After a restart of home assistant there is a one time that the value is increased with the total amount of the readed sensor, and not the different from the last state.
where do i have to look for the problem.
I’m curently running version 2022 8.0
The total sensor is from a grott server (mqtt sensor value) this is becaus i’m not happy with the update time of the original growatt app and intergration, it is very often offline and then there are no readings. so i wen’t for the local setup with the above grott configuration.
below one could see what happens with the values after a restart.
a small update, seems that i have found out a solution to my problem.
I changed the very first value that is been reading and changed it to its initial total output value.
and it looks like on restart it now goes right.
Maybee someone could point out how to enter an initial value, now my monthly readings are way of scale for the month Juli and that is not what i like.
it looks like it has somthing to do with this state_class attribute.
i think after a reset, the value is lower then the previeus value so it count’s as a new meter value, but i don’t know how to solve this, if it is solvabel.
I thought what may have been happening is that after a restart the mqtt sensor state is not restored. And so your template retuned a null value. But my updated version of the template should have fixed that (maybe).
There is one way to guarantee that the mqtt sensor is restored correctly after a restart. And that is to ensure that the growatt device sends mqtt messages with the retained flag set. That way as soon as home assistant starts it can obtain the value from the broker.
Is there any way you can enable this for your device?
found the problem, within the broker there was an old retained message from an early test setup.
I don’t use retain in mqtt. deleted the old values and now evertything is working fine.