Home assistant repeatedly turning boiler switch on and off

I control a Shelly switch via homeassistant generic thermostat. The homeassistant keeps turning the switch on and off despite the target temperature not being reached. I am not sure how can I debug this. The logs say

Shelly switch turned on triggered by service Home Assistant Core Integration: Generic turn on

And other entry

Shelly switch turned on triggered by service Home Assistant Core Integration: Generic turn off

There are multiple entries of this in the logbook. I the graph of the climate entry created by HA shows how frequently it’s turning on and off the Shelly switch. Would really appreciate if someone can guide me how to debug this

can you show us your config…

- platform: generic_thermostat
  name: "Gas Heater"
  heater: switch.gas_heater
  target_sensor: sensor.bt_lounge_temperature
  min_temp: 15
  max_temp: 30
  ac_mode: False
  target_temp: 20.8
  initial_hvac_mode: "off"
  cold_tolerance: 0.2
  hot_tolerance: 0.2
  away_temp: 16

think it could be your

hot_tolerance: 
cold_tolerance: