Helper type "History Stats" - set a starting value

Hi all,

I created a helper to count the number of hours a binary sensor is on.
Since I’m migrating from another platform, I want to add the operating hours of that device from before the helper (or the related binary sensor) was created.

I tried setting the state using developer tools to that initial value, but it just gets overwritten. I think that makes sense, since HA also will not find any history related to that counter.

Is there a way I can migrate that history? I just need a total number of operating hours, not the full history.

You can’t change that sensor, but you can create a “utility meter” helper which is based off that history_stats sensor, and you can change the starting value of that utility meter sensor by using the utility_meter.calibrate action

Thanks! I wasn’t familiar with the utility meter helper, but this works!