Problems with understanding automation

Hey, I’m having trouble creating more complex automations. I have already created simple lighting controls, but even these are not optimal.
I have several building blocks where I can’t get any further.

Creating a heating control depending on the absence or presence of people (via mobile phone). I would like to set a fixed time when the heating is lowered. When you come home, the individual temperature of each room should be set again. In addition, a night setback should also run via a schedule. I also wanted to try Advanced Heating Control, but that only applies to a TRV. So I would have to create it 12 times to be able to control all TRVs.

Modbus and MQTT
My solar system is integrated in HA but the names of the identities I assign are not retained when I restart the system. They fall back to the identity names.