ScratMan / HASmartThermostat

Smart Thermostat with PID controller for HomeAssistant
352 stars 50 forks source link

Heater switch doesn't seem to be triggered #126

Closed somerandoname closed 1 year ago

somerandoname commented 1 year ago

I'm trying to do the initial configuration and have created a new switch for the heater for it. When the switch is triggered manually, the heating starts successfully, but restarting doesn't start the autotune mode and manually activating the heating mode of the smart thermostat doesn't do anything either.

climate:
  - platform: smart_thermostat
    name: Smartes Thermostat Wohnzimmer
    unique_id: smartes_thermostat_wohnzimmer
    heater: switch.ac_toggle
    target_sensor: sensor.govee_wohnzimmer_temperatur
    min_temp: 15
    max_temp: 23
    ac_mode: False
    keep_alive:
      seconds: 60
    away_temp: 17
    kp: 5
    ki: 0.4
    kd: 60
    pwm: 00:15:00
    min_cycle_duration: 00:06:00
    min_off_cycle_duration: 00:01:00
    target_temp_step: 0.1
    target_temp: 21
    eco_temp: 17
    comfort_temp: 21
    sensor_stall: 0
    autotune: "ziegler-nichols"

switch:
  - platform: template
    switches:
      ac_toggle:
        friendly_name: "Klima Wohnzimmer toggle"
        value_template: "{{ not is_state('climate.wohnzimmer', 'off') }}"
        turn_on:
          service: climate.turn_on
          target:
            entity_id: climate.wohnzimmer
        turn_off:
          service: climate.turn_off
          target:
            entity_id: climate.wohnzimmer
ScratMan commented 1 year ago

Hello, if you start with autotuner it requires several temperature samples from the sensor before starting to switch the heater. I don't recommend using the auto-tune, anyway. It's easier to set the pid_mode to off using service to switch to hysteresis mode, and once you have a full oscillation period of the temperature, you can compute the gains using manual method described in one of the conversations on GitHub discussions.

somerandoname commented 1 year ago

Thanks, it started heating after waiting for a while. I used the manual method as recommended and cycling works now too.