I have two issues with tbe collecting sensor in Home Assistant Core 2022.5.4
created a collecting sensor helper via the UI. But once created I can not see or edit all parameters set during creation anymore. I didn’t figure out what the offset line in the UI means, when setin repeat to daily the offset still has the unit days.
Via the developers menue entity tab I get a Yaml overview that looks like this:
I can’t figure out how to reset the counter daily at 7:31:00 am. The cron pattern listed above does not work. Having a look at the source the cron pattern does not support seconds.
Hi Tom,
thanks for the very fast response. I did some tests with an energy meter wihich is triggering with high frequency.
Every time a count event occurs the cron pattern gets over written by a value determined from the meter_period parameter. For exampe quarterly_hour results in 0/15 * * * * or daily in 0 0 * * *. The cron pattern definitely does not support seconds. But nevertheless it makes no sense to set it manually because it gets overwritten with every count event. When having no period set the cron pattern gets deleted with every count event.
I will set meter_period to none and go with your automation suggested.
Unfortunately the automation did not work as expected, because the collecting entity is created as sensor. The service utility_meter.reset does not work with sensors. I had to use calibrate instead.
I have the same problem as DonKracho. .reset is not working for my utility_meters, (because they are generated as sensors?) or in general. Is this expected behavior and I should file an issue?
I have a similiar issue with a power meter sensor I had to create from current x voltage to then build another sensor based power over time as a Riemann Integral sensor I now have to reset and can not.
I am not sure what your code has to be used but I could not get that into my script section.
FOR ALL THOSE WHO ARE STRUGGLING TO RESET A COUNTER MANUALLY
New Years day and my yearly counter has not reset for what ever reason while
daily and monthly have resetted properly,
weekly has not cause it is not a new monday so that was right
But my yearly counter sensor.verbrauch_gesamt_4_jahr did not reset
To solve that and reset I have used this calibration an set a trigger time at 14:00:00 to a value of 4.95
Make sure to use the . as decimal separator and not the “,” as used in german speaking countries and a lot of others.
Create an automation and switch to yaml mode (upper right menu) to paste this code
My alias starts with “-” to stay on top of the list till I have tested it enough and give that a proper name, so adjust your alias.
It is reseting my yearly counter called sensor.verbrauch_gesamt_4_jahr which is based on a Riemann Sum integral.
Once that has been saved then turn the automation on and adjust the trigger time a minute ahead in the future, use TAB to jump to the next and then you get the “save” button.
After saving turn the automation on and wait till it has run, check the data
AND DO NOT FORGET TO DEACTIVATE THIS AUTOMATION
till next time it will be needed.
If you forget that you get a daily reset at 16:00:00 to the same value.
Thanks a lot.
I am not sure yet if I will need that next year again.
I do not know why the counter has not been reset - I have started that 3 months ago and I do not believe that this counter will be reset after 1 year so in 9 months or next new year.