MQTT Discovery climate

I want to create a climate tru MQTT discovery, but it doen’t trigger, just to heat home. But when i move the web temp, never changes to idle when i move the temp below the readable.

The configuration.yaml that works via template

  - platform: generic_thermostat
    name: Termostat
    heater: switch.encentre_apagar_4
    target_sensor: sensor.temp_aparell_2

States not working one:
hvac_modes: off,heat
current_temperature: 20
min_temp: 7
max_temp: 35
target_temp_step: 1
temperature: 19
friendly_name: Termostat
supported_features: 1

This is shown on the working one:
hvac_modes: heat,off
current_temperature: 17.6
min_temp: 7
max_temp: 35
temperature: 12.5
hvac_action: idle <-- missing on the other one
friendly_name: Termostat
supported_features: 1

The not working one:

    paquetMqtt = {
      "modes":["off", "heat"]

What am i doing wriong?