There’s nearly 400 lines of code to my lounge heating and cooling automations so I pastebinned it: https://paste.ubuntu.com/p/WH7wGB7ppN/
These take care of:
- manually selecting a heating or cooling mode
- scheduled heating and cooling on/off
- switching off the heating/cooling if an external door or window is opened
- manual temperature set point adjustment
- automatically boosting/retarding the heat or cooling power as required to quickly get to the set point
- automatic temperature set point adjustment based on season and morning weather forecast
There are also a bunch of binary sensors associated with these automations: https://paste.ubuntu.com/p/BxWXpSw3Vj/