Thanks. So far so good with what we are looking at..
Sorry about step 13 - my omission and making an assumption. You need the powerful system tool Spook installed from HACS - written by one of the HomeAssistant developers.
See Installing Spook in Home Assistant - Spook 👻 a scary powerful toolbox for Home Assistant. and Background and the history of Spook 👻 - Spook 👻 a scary powerful toolbox for Home Assistant.
This will add the required automation: Entity management - Spook 👻 a scary powerful toolbox for Home Assistant. You may find it gets cheeky and finds other things wrong in your system and has a grumble about those too. Frenck knows his internals stuff and has a sense of humour.
[I’ve added it to step 2 as an edit for those following later.]
I had a brief glance at your logs. Are your HikVision devices working correctly? How about your Sonoff devices? Your remote for the smart fan? Do you have the latest updates for these integrations/apps in HACS? Will go into more detail later on.
Take your time. No pressure. Breaks are good. Long distance problem debugging can have unique challenges, especially if different time zones. Just want to see it through to completion. It is fortuitous you stopped at step 13, where it starts to get interesting.
Add Spook. Boo!
The overnight database maintenance should be interesting. Should your system crash and restart, do step 4, 5, 6, 7, 8 again to get everything back to a known state and then continue from step 13. If still up, just proceed to step 13 and continue.
Hear from you tomorrow, your time.