### Autotune Configuration Example - YAML Source: https://context7.com/scratman/hasmartthermostat/llms.txt This YAML configuration enables automatic PID tuning for a smart thermostat on its first startup. It specifies the autotune method ('ziegler-nichols'), noiseband, and lookback period, leveraging the relay feedback test to determine optimal PID parameters. ```yaml climate: - platform: smart_thermostat name: Auto-Tuning Thermostat unique_id: autotuning_thermostat heater: switch.heater target_sensor: sensor.room_temperature min_temp: 15 max_temp: 28 target_temp: 21 keep_alive: seconds: 60 pwm: 00:15:00 autotune: "ziegler-nichols" noiseband: 0.5 lookback: 02:00:00 ``` -------------------------------- ### Home Assistant Configuration: Multiple Valves Source: https://github.com/scratman/hasmartthermostat/blob/master/README.md Example configuration for integrating multiple radiator valves with the HASmartThermostat in Home Assistant. This setup showcases how to manage multiple output devices for heating control and specifies PID tuning parameters and output limits. ```yaml climate: - platform: smart_thermostat name: Smart Thermostat Multiple Valves Example unique_id: smart_thermostat_m_valve_example heater: - valve.radiator_valve_1 - valve.radiator_valve_2 - valve.radiator_valve_3 target_sensor: sensor.ambient_temperature min_temp: 7 max_temp: 28 ac_mode: False target_temp: 19 keep_alive: seconds: 60 away_temp: 14 kp: 5 ki: 0.01 kd: 500 output_min: 0 output_max: 99 pwm: 0 ``` -------------------------------- ### Configure Climate Platform with PID Control (YAML) Source: https://context7.com/scratman/hasmartthermostat/llms.txt Configuration entry in Home Assistant's configuration.yaml to set up a smart thermostat climate entity utilizing PID control. This example demonstrates basic configuration with essential parameters for heating, target sensors, and PID gains. ```yaml climate: - platform: smart_thermostat name: Living Room Smart Thermostat unique_id: living_room_thermostat_001 heater: switch.living_room_heater target_sensor: sensor.living_room_temperature outdoor_sensor: sensor.outdoor_temperature min_temp: 15 max_temp: 28 ac_mode: false target_temp: 21 keep_alive: seconds: 60 away_temp: 16 eco_temp: 18 boost_temp: 24 kp: 50 ki: 0.01 kd: 2000 ke: 0.6 pwm: 00:15:00 min_cycle_duration: 00:03:00 sampling_period: 00:00:00 sensor_stall: 06:00:00 output_safety: 10.0 cold_tolerance: 0.3 hot_tolerance: 0.3 precision: 0.1 debug: false ``` -------------------------------- ### Home Assistant Configuration: Single ON/OFF Heater Source: https://github.com/scratman/hasmartthermostat/blob/master/README.md Example configuration for adding a single ON/OFF heater to the HASmartThermostat integration in Home Assistant. This setup defines the thermostat's name, unique ID, heater entity, temperature sensor, operating range, and PID controller parameters. ```yaml climate: - platform: smart_thermostat name: Smart Thermostat Single ON/OFF Heater Example unique_id: smart_thermostat_single_on_off_heat_example heater: switch.on_off_heater target_sensor: sensor.ambient_temperature min_temp: 7 max_temp: 28 ac_mode: False target_temp: 19 keep_alive: seconds: 60 away_temp: 14 kp: 50 ki: 0.01 kd: 2000 pwm: 00:15:00 ``` -------------------------------- ### Configure Multi-Zone Floor Heating with Continuous Valves (YAML) Source: https://context7.com/scratman/hasmartthermostat/llms.txt Configuration for controlling multiple heating valves using continuous output (0-100%) with the smart_thermostat platform. This setup is suitable for systems like multi-zone floor heating where precise valve modulation is needed. ```yaml climate: - platform: smart_thermostat name: Multi-Zone Floor Heating unique_id: floor_heating_multizone heater: - number.bedroom_valve - number.bathroom_valve - number.hallway_valve target_sensor: sensor.zone_avg_temperature outdoor_sensor: sensor.weather_temperature min_temp: 18 max_temp: 26 target_temp: 22 keep_alive: seconds: 30 kp: 5 ki: 0.01 kd: 500 ke: 0.8 output_min: 0 output_max: 99 output_precision: 0 pwm: 0 away_temp: 18 home_temp: 22 ``` -------------------------------- ### Set Preset Temperatures using smart_thermostat.set_preset_temp Service Source: https://github.com/scratman/hasmartthermostat/blob/master/README.md This service enables the configuration of temperatures for various preset modes (e.g., away, boost, home). If a preset mode is not defined in YAML, it will be enabled. Values are saved to the entity's state in the database and restored after a restart, overriding YAML configurations. Disable options are available to remove active presets. Example parameters: away_temp, boost_temp, home_temp_disable. ```YAML service: smart_thermostat.set_preset_temp data: away_temp: 14.6 boost_temp: 22.5 home_temp_disable: true target: entity_id: climate.smart_thermostat_example ``` -------------------------------- ### Initialize and Use PID Controller - Python Source: https://context7.com/scratman/hasmartthermostat/llms.txt This code initializes a PID controller with specific gains and limits, sets it to automatic mode, and then calculates the control output based on current and target temperatures, including external temperature compensation. It outputs the control value and component terms for debugging. ```python import pid_controller import time # Initialize PID controller with gains and limits controller = pid_controller.PID( kp=50.0, # Proportional gain ki=0.01, # Integral gain kd=2000.0, # Derivative gain ke=0.6, # External temperature compensation gain out_min=0.0, # Minimum output (0%) out_max=100.0, # Maximum output (100%) sampling_period=0, # Calculate on every sensor update (0 = no fixed period) cold_tolerance=0.3, hot_tolerance=0.3 ) # Set controller to AUTO mode controller.mode = "AUTO" # Calculate control output current_temp = 19.5 target_temp = 21.0 current_time = time.time() previous_time = time.time() - 30 outdoor_temp = 5.0 output, updated = controller.calc( input_val=current_temp, set_point=target_temp, input_time=current_time, last_input_time=previous_time, ext_temp=outdoor_temp ) # Output: control value between out_min and out_max # updated: True if calculation was performed, False if skipped print(f"PID Output: {output}%") print(f"Proportional: {controller.proportional}") print(f"Integral: {controller.integral}") print(f"Derivative: {controller.derivative}") print(f"External: {controller.external}") ``` -------------------------------- ### Initialize PID Controller Class (Python) Source: https://context7.com/scratman/hasmartthermostat/llms.txt Core PID controller initialization from the `pid_controller/__init__.py` file. This snippet demonstrates the import statement for accessing the PID controller logic within the custom component. ```python from custom_components.smart_thermostat import pid_controller ``` -------------------------------- ### PID Autotune Class Usage - Python Source: https://context7.com/scratman/hasmartthermostat/llms.txt This Python code demonstrates the usage of the PIDAutotune class for automatically tuning PID parameters using a relay feedback test. It initializes the autotuner, runs it periodically with sensor updates, and retrieves the tuned PID parameters using different tuning rules. ```python from custom_components.smart_thermostat import pid_controller import time # Assume these functions are defined elsewhere def get_current_temperature(): # Replace with your actual sensor reading logic return 20.0 def set_heater_power(power): # Replace with your actual heater control logic print(f"Setting heater power to {power}%") # Initialize autotuner autotuner = pid_controller.PIDAutotune( out_step=50.0, # Output step size for relay test (% of range) lookback=7200, # Analysis window in seconds (2 hours) out_min=0.0, out_max=100.0, noiseband=0.5, # Temperature oscillation band (°C) time_func=time.time ) # Run autotune loop (call periodically with sensor updates) target_temperature = 21.0 is_complete = False while not is_complete: current_temp = get_current_temperature() # Your sensor reading function is_complete = autotuner.run(current_temp, target_temperature) # Apply the autotuner output to your heater heater_output = autotuner.output set_heater_power(heater_output) print(f"Autotune Status: {autotuner.state}") print(f"Peak Count: {autotuner.peak_count}") print(f"Buffer: {autotuner.buffer_full * 100:.0f}%") time.sleep(30) # Wait for next sensor update # Get tuned parameters if autotuner.state == 'succeeded': params = autotuner.get_pid_parameters('ziegler-nichols') print(f"Tuned PID Parameters:") print(f" Kp: {params.Kp:.2f}") print(f" Ki: {params.Ki:.5f}") print(f" Kd: {params.Kd:.2f}") # Try other tuning rules for rule in autotuner.tuning_rules: params = autotuner.get_pid_parameters(rule) print(f"{rule}: Kp={params.Kp:.2f}, Ki={params.Ki:.5f}, Kd={params.Kd:.2f}") ``` -------------------------------- ### Smart Thermostat Configuration Source: https://github.com/scratman/hasmartthermostat/blob/master/README.md This section details the parameters required to configure a smart thermostat. ```APIDOC ## Smart Thermostat Configuration ### Description This endpoint allows you to configure a smart thermostat by specifying various parameters related to heating, cooling, sensors, and control logic. ### Method POST (or equivalent for creation/configuration) ### Endpoint /scratman/hasmartthermostat ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **name** (Optional, string): Name of the thermostat. - **unique_id** (Optional, string): Unique entity_id for the smart thermostat. - **heater** (Required, string or list): entity_id for heater control. Should be a single or list of toggle device (switch or input_boolean), light or valve (light, number, input_number). If a valve or a light entity is used, `pwm` parameter should be set to 0. Becomes air conditioning switch when `ac_mode` is set to true. - **cooler** (Optional, string or list): entity_id for cooling control. Should be a single or list of toggle device (switch or input_boolean), light or valve (light, number, input_number). If a valve or a light is used, `pwm` parameter should be set to 0. Becomes air conditioning switch when `ac_mode` is set to true. - **invert_heater** (Optional, boolean): If set to true, inverts the polarity of the heater switch (switch is on while idle and off while active). Defaults to false. - **target_sensor** (Required, string): entity_id for a temperature sensor. `target_sensor.state` must be temperature. - **outdoor_sensor** (Optional, string): entity_id for an outdoor temperature sensor. `outdoor_sensor.state` must be temperature. - **keep_alive** (Required, float or string): Sets update interval for the PWM pulse width. Can be float in seconds, or time hh:mm:ss. - **kp** (Recommended, float): Set PID parameter, proportional (p) control value. Defaults to 100. - **ki** (Recommended, float): Set PID parameter, integral (i) control value. Defaults to 0. - **kd** (Recommended, float): Set PID parameter, derivative (d) control value. Defaults to 0. - **ke** (Optional, float): Set outdoor temperature compensation gain (e) control value. Defaults to 0. - **pwm** (Optional, float or string): Set period of the pulse width modulation. Can be float in seconds or time hh:mm:ss. Defaults to 15 minutes. Set to 0 when using heater entity with direct input of 0/100% values like valves or lights. - **min_cycle_duration** (Optional, float or string): Set a minimum amount of time that the switch specified in the heater option must be in its current state prior to being switched either off or on. Can be float in seconds or time hh:mm:ss. Defaults to 0s. - **min_off_cycle_duration** (Optional, float or string): When `min_cycle_duration` is specified, set a minimum amount of time that the switch specified in the heater option must remain in OFF state prior to being switched ON. Defaults to `min_cycle_duration` value. - **min_cycle_duration_pid_off** (Optional, float or string): Minimum cycle duration specifically when PID is set to OFF. Defaults to `min_cycle_duration` value. - **min_off_cycle_duration_pid_off** (Optional, float or string): Minimum off cycle duration specifically when PID is set to OFF. Defaults to `min_cycle_duration_pid_off` value. - **sampling_period** (Optional, float or string): Interval between two computations of the PID. Can be float in seconds or time hh:mm:ss. Defaults to 0. - **target_temp_step** (Optional, float): The adjustment step of target temperature. Valid values are 0.1, 0.5, and 1.0. - **precision** (Optional, float): The displayed temperature precision. Valid values are 0.1, 0.5, and 1.0. - **min_temp** (Optional, float): Set minimum set point available. Defaults to 7. - **max_temp** (Optional, float): Set maximum set point available. Defaults to 35. - **target_temp** (Optional, float): Set initial target temperature. - **cold_tolerance** (Optional, float): Minimum difference between the temperature sensor reading and the target temperature that must change prior to switching on when PID is off. Defaults to 0.3. - **hot_tolerance** (Optional, float): Minimum difference between the temperature sensor reading and the target temperature that must change prior to switching off when PID is off. ### Request Example ```json { "name": "Living Room Thermostat", "heater": "switch.living_room_heater", "target_sensor": "sensor.living_room_temperature", "keep_alive": "00:05:00", "kp": 120.5, "ki": 0.8, "kd": 5.2, "target_temp": 22.5 } ``` ### Response #### Success Response (200) - **entity_id** (string) - The entity ID of the created smart thermostat. #### Response Example ```json { "entity_id": "climate.living_room_thermostat" } ``` ``` -------------------------------- ### Dynamically Set PID Gain Parameters (Service YAML) Source: https://context7.com/scratman/hasmartthermostat/llms.txt This service call allows for real-time adjustment of the Proportional (kp), Integral (ki), Derivative (kd), and Error (ke) gain parameters of the PID controller without requiring a Home Assistant restart. It's useful for fine-tuning the thermostat's performance. ```yaml service: smart_thermostat.set_pid_gain target: entity_id: climate.living_room_smart_thermostat data: kp: 45.5 ki: 0.015 kd: 1800.0 ke: 0.7 ``` -------------------------------- ### Debug Sensor Template Configuration - YAML Source: https://context7.com/scratman/hasmartthermostat/llms.txt This YAML configuration defines Home Assistant template sensors to expose internal PID controller values. These sensors are useful for monitoring the controller's state, including output, proportional, integral, derivative terms, external compensation, and operating mode. ```yaml sensor: - platform: template sensors: thermostat_pid_output: friendly_name: "PID Control Output" unit_of_measurement: "%" value_template: "{{ state_attr('climate.living_room_smart_thermostat', 'control_output') | float(0) }}" thermostat_pid_p: friendly_name: "PID Proportional Term" unit_of_measurement: "%" value_template: "{{ state_attr('climate.living_room_smart_thermostat', 'pid_p') | float(0) }}" thermostat_pid_i: friendly_name: "PID Integral Term" unit_of_measurement: "%" value_template: "{{ state_attr('climate.living_room_smart_thermostat', 'pid_i') | float(0) }}" thermostat_pid_d: friendly_name: "PID Derivative Term" unit_of_measurement: "%" value_template: "{{ state_attr('climate.living_room_smart_thermostat', 'pid_d') | float(0) }}" thermostat_pid_e: friendly_name: "PID External Compensation" unit_of_measurement: "%" value_template: "{{ state_attr('climate.living_room_smart_thermostat', 'pid_e') | float(0) }}" thermostat_pid_mode: friendly_name: "PID Operating Mode" value_template: "{{ state_attr('climate.living_room_smart_thermostat', 'pid_mode') }}" ``` -------------------------------- ### Configure Preset Sync Mode with HASmartThermostat Source: https://context7.com/scratman/hasmartthermostat/llms.txt This configuration sets up the HASmartThermostat to automatically activate presets when the target temperature matches preset values. It defines various temperature presets like 'away', 'home', 'eco', 'boost', and 'sleep', along with PID parameters and PWM settings. ```yaml climate: - platform: smart_thermostat name: Smart Sync Thermostat unique_id: sync_thermostat heater: switch.heating_element target_sensor: sensor.temperature preset_sync_mode: sync target_temp: 20 away_temp: 16 home_temp: 20 eco_temp: 18 boost_temp: 24 sleep_temp: 19 keep_alive: seconds: 60 kp: 50 ki: 0.01 kd: 2000 pwm: 00:15:00 ``` -------------------------------- ### Set PID Gain using smart_thermostat.set_pid_gain Service Source: https://github.com/scratman/hasmartthermostat/blob/master/README.md This service allows for the adjustment of PID gains (kp, ki, kd) without requiring a Home Assistant restart. The new values are saved to the database and restored upon restart. It is recommended to also save these parameters in the YAML configuration for persistence. Optional parameters: kp, ki, and kd as floats. ```YAML service: smart_thermostat.set_pid_gain data: kp: 11.8 ki: 0.00878 target: entity_id: climate.smart_thermostat_example ``` -------------------------------- ### Update Preset Temperature Modes (Service YAML) Source: https://context7.com/scratman/hasmartthermostat/llms.txt This service enables runtime modification of preset temperature values such as away, eco, boost, home, and sleep. It allows for dynamic adjustment of temperature profiles based on occupancy or desired comfort levels. ```yaml service: smart_thermostat.set_preset_temp target: entity_id: climate.living_room_smart_thermostat data: away_temp: 15.5 eco_temp: 17.0 boost_temp: 25.0 home_temp: 21.5 sleep_temp: 19.0 ``` ```yaml service: smart_thermostat.set_preset_temp target: entity_id: climate.living_room_smart_thermostat data: comfort_temp_disable: true activity_temp_disable: true ``` -------------------------------- ### Configure Smart Thermostat Debug Sensors in Home Assistant Source: https://github.com/scratman/hasmartthermostat/blob/master/README.md This snippet shows how to configure template sensors in Home Assistant's configuration.yaml to expose internal PID controller states from a smart thermostat for debugging purposes. It requires the 'debug' option to be enabled in the thermostat's configuration. The sensors display PID output, P, I, D, and error terms. ```yaml sensor: - platform: template sensors: smart_thermostat_output: friendly_name: PID Output unit_of_measurement: "%" value_template: "{{ state_attr('climate.smart_thermostat_example', 'control_output') | float(0) }}" smart_thermostat_p: friendly_name: PID P unit_of_measurement: "%" value_template: "{{ state_attr('climate.smart_thermostat_example', 'pid_p') | float(0) }}" smart_thermostat_i: friendly_name: PID I unit_of_measurement: "%" value_template: "{{ state_attr('climate.smart_thermostat_example', 'pid_i') | float(0) }}" smart_thermostat_d: friendly_name: PID D unit_of_measurement: "%" value_template: "{{ state_attr('climate.smart_thermostat_example', 'pid_d') | float(0) }}" smart_thermostat_e: friendly_name: PID E unit_of_measurement: "%" value_template: "{{ state_attr('climate.smart_thermostat_example', 'pid_e') | float(0) }}" ``` -------------------------------- ### Toggle PID Control Mode (Service YAML) Source: https://context7.com/scratman/hasmartthermostat/llms.txt This service allows switching the thermostat's control mode between automatic PID regulation and a simpler ON/OFF hysteresis mode. 'off' disables PID, while 'auto' enables it, providing flexibility in temperature control strategies. ```yaml service: smart_thermostat.set_pid_mode target: entity_id: climate.living_room_smart_thermostat data: mode: 'off' ``` ```yaml service: smart_thermostat.set_pid_mode target: entity_id: climate.living_room_smart_thermostat data: mode: 'auto' ``` -------------------------------- ### smart_thermostat.set_preset_temp Source: https://github.com/scratman/hasmartthermostat/blob/master/README.md Configures the target temperatures for various preset modes (e.g., away, home, boost). These settings are saved to the entity's state and persist across restarts. ```APIDOC ## POST /services/smart_thermostat/set_preset_temp ### Description Sets the target temperatures for predefined thermostat modes like 'away', 'home', and 'boost'. It can also disable specific presets. ### Method POST ### Endpoint /services/smart_thermostat/set_preset_temp ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **away_temp** (float) - Optional - The target temperature for the 'away' preset. - **home_temp** (float) - Optional - The target temperature for the 'home' preset. - **away_temp_disable** (boolean) - Optional - Set to true to disable the 'away' preset. - **home_temp_disable** (boolean) - Optional - Set to true to disable the 'home' preset. - **boost_temp** (float) - Optional - The target temperature for the 'boost' preset. - **boost_temp_disable** (boolean) - Optional - Set to true to disable the 'boost' preset. - **entity_id** (string) - Required - The entity ID of the smart thermostat to configure. ### Request Example ```json { "away_temp": 14.6, "boost_temp": 22.5, "home_temp_disable": true, "entity_id": "climate.smart_thermostat_example" } ``` ### Response #### Success Response (200) An empty object or a success indicator from Home Assistant's service call. #### Response Example ```json { "message": "Service called successfully" } ``` ``` -------------------------------- ### smart_thermostat.set_pid_gain Source: https://github.com/scratman/hasmartthermostat/blob/master/README.md Adjusts the PID gains (Kp, Ki, Kd) for the smart thermostat without requiring a Home Assistant restart. The changes are saved to the database and restored upon restart. ```APIDOC ## POST /services/smart_thermostat/set_pid_gain ### Description Sets the proportional (kp), integral (ki), and derivative (kd) gains for the PID controller of the smart thermostat. ### Method POST ### Endpoint /services/smart_thermostat/set_pid_gain ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **kp** (float) - Optional - The proportional gain. - **ki** (float) - Optional - The integral gain. - **kd** (float) - Optional - The derivative gain. - **entity_id** (string) - Required - The entity ID of the smart thermostat to configure. ### Request Example ```json { "kp": 11.8, "ki": 0.00878, "entity_id": "climate.smart_thermostat_example" } ``` ### Response #### Success Response (200) An empty object or a success indicator from Home Assistant's service call. #### Response Example ```json { "message": "Service called successfully" } ``` ``` -------------------------------- ### Configure Air Conditioning Mode with HASmartThermostat Source: https://context7.com/scratman/hasmartthermostat/llms.txt This configuration enables air conditioning mode for the HASmartThermostat. It assumes an inverted output logic where the 'heater' controls the compressor and the 'cooler' controls the fan. It includes settings for temperature control, PID parameters, and PWM. ```yaml climate: - platform: smart_thermostat name: Living Room AC unique_id: living_room_ac_unit heater: switch.ac_compressor cooler: switch.ac_fan_high target_sensor: sensor.living_room_temperature min_temp: 18 max_temp: 30 ac_mode: true target_temp: 24 keep_alive: seconds: 45 kp: 40 ki: 0.008 kd: 1500 pwm: 00:10:00 min_cycle_duration: 00:05:00 cold_tolerance: 0.5 hot_tolerance: 0.5 ``` -------------------------------- ### Set PID Mode using smart_thermostat.set_pid_mode Service Source: https://github.com/scratman/hasmartthermostat/blob/master/README.md This service is used to switch the PID controller between 'auto' and 'off' modes. In 'auto' mode, the PID modulates heating based on temperature and its variation. In 'off' mode, it acts as a basic hysteresis thermostat. The selected mode is persisted across Home Assistant restarts. Required parameter: mode as a string in ['auto', 'off']. ```YAML service: smart_thermostat.set_pid_mode data: mode: 'off' target: entity_id: climate.smart_thermostat_example ``` -------------------------------- ### Clear Integral Part using smart_thermostat.clear_integral Service Source: https://github.com/scratman/hasmartthermostat/blob/master/README.md This service resets the integral component of the PID controller to zero. It is particularly useful during PID gain tuning to observe the system's behavior without the influence of a stabilized integral term, allowing for quicker testing cycles. ```YAML service: smart_thermostat.clear_integral target: entity_id: climate.smart_thermostat_example ``` -------------------------------- ### Reset PID Controller Integral Component (Service YAML) Source: https://context7.com/scratman/hasmartthermostat/llms.txt This service resets the integral component of the PID controller to zero. This action is typically performed during PID tuning or after prolonged periods where the system has maintained a significant temperature offset, helping to prevent wind-up. ```yaml service: smart_thermostat.clear_integral target: entity_id: climate.living_room_smart_thermostat data: {} ``` -------------------------------- ### smart_thermostat.set_pid_mode Source: https://github.com/scratman/hasmartthermostat/blob/master/README.md Sets the PID control mode to either 'auto' or 'off'. In 'auto' mode, the PID modulates heating; in 'off' mode, it acts as a basic hysteresis thermostat. ```APIDOC ## POST /services/smart_thermostat/set_pid_mode ### Description Sets the operating mode of the PID controller. 'auto' enables PID modulation, while 'off' reverts to basic hysteresis control. ### Method POST ### Endpoint /services/smart_thermostat/set_pid_mode ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **mode** (string) - Required - The PID mode. Must be one of 'auto' or 'off'. - **entity_id** (string) - Required - The entity ID of the smart thermostat to configure. ### Request Example ```json { "mode": "off", "entity_id": "climate.smart_thermostat_example" } ``` ### Response #### Success Response (200) An empty object or a success indicator from Home Assistant's service call. #### Response Example ```json { "message": "Service called successfully" } ``` ``` -------------------------------- ### smart_thermostat.clear_integral Source: https://github.com/scratman/hasmartthermostat/blob/master/README.md Resets the integral component of the PID controller to zero. This is useful for PID tuning to observe the system's behavior without the influence of accumulated integral error. ```APIDOC ## POST /services/smart_thermostat/clear_integral ### Description Resets the integral term of the PID controller to zero. This is helpful during PID tuning to analyze the system's response without the integral component affecting the output. ### Method POST ### Endpoint /services/smart_thermostat/clear_integral ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **entity_id** (string) - Required - The entity ID of the smart thermostat whose PID integral should be cleared. ### Request Example ```json { "entity_id": "climate.smart_thermostat_example" } ``` ### Response #### Success Response (200) An empty object or a success indicator from Home Assistant's service call. #### Response Example ```json { "message": "Service called successfully" } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.