Programme to track myphone moving and triggering action on my heatpump or thermostat

Hello, I am relatively new to the HA world. I am trying to load some automations. So far successful for some simple ones.
However I would greatly benefit from a program that allows me to action (On or Off) my home heatpump or thermostat depending on how I move outside the house.
In few words, triggering an action to “On” if my phone tracking would show me approaching the house in a radius of 30km and the same “Off” logic when I leave beyond a radius of 30km. Thanks in advance