Generic Thermostat powers down AC instead of just switching off cooling and keep fan on like built in thermostats

A built in AC thermostat will typically, if the temperature drops below the set threshold, will let the

AC fan be on and not entirely power it down/switch off.

Whereas the generic thermostat in Home Assistant typically completely switches off the AC unit.

How can we make the HA thermostat emulate the built in AC thermostat and set it to run the fan on reaching the temperature instead of powering off?

One obvious workaround is to replace the IR code for ‘Off’ with fan only or very high temperature so the AC will use its built in thermostat to turn off cooling and just run the fan. But now the AC cannot be fully powered off by the thermostat.

Any solutions?