Correct the last changed time/date of entities/devices

When HA restarts, all the last updated/changed info of entities/devices are set to when HA was restarted even though most have not really changed. This results in unreliable information on when the device was really last changed. For example, a door sensor will have a last changed date/time based on when HA was restarted even though it has not been opened for months.

See the image below as an example. HA was restarted 5 hours ago and the Last Changed data has been set to this time. However, the door and windows have not been opened for weeks/months.