Allow flaggin any entity/helper with state class measurement and enable long-term statistics

It would be very useful to be able to add state class to number and input_number.
This would make much more sense than creating duplicating template sensor to get data in long-term statistics for values stored by scripts or automation’s.

You can add this via customize.yaml without creating a duplicate template sensor.

I tried to google about this but mostly found suggestion about duplicating with template.
Can you point to some instructions or give examples?

homeassistant:
  customize:
    sensor.abc:
      state_class: measurement

Based on that sample I now have this in my config.

homeassistant:
  packages:
    #cheapest_hours: !include advanced_cheapest_hours.yaml
    fingrid: !include json-kysely.yaml

  customize:
    input_number.testnumber:
      state_class: measurement

I cannot see this sensor in Developer tools → Statistics.
In Developer tools → States there is state_class: measurement for this sensor.
With Statistics card find this sensor.

I have done full reboot.
Does it take time and/or value changes to get statistics?
This is number I have used in testing before so there is existing history.

That’s not a sensor…

I know.
My question included input_number.