vindaalex / multizone-thermostat

This is a home assistant custom component. It is a thermostat including various control options, such as: on-off, PID, weather controlled. The thermostat can be used in stand-alone mode or as zoned heating (master- satellites).
33 stars 6 forks source link

call to set_integral fails #19

Closed wimfabri closed 1 year ago

wimfabri commented 1 year ago

Hi,

calling set_integral fails with below stacktrace:

2023-04-09 22:03:25.555 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Unexpected error for call_service at pos 1: 'HVACSetting' object has no attribute 'integral' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 452, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 685, in _async_call_service_step await service_task File "/usr/src/homeassistant/homeassistant/core.py", line 1820, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1857, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 809, in handle_service await service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 798, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 977, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 829, in _handle_entity_call result = hass.async_run_job( File "/usr/src/homeassistant/homeassistant/core.py", line 641, in async_run_job return self.async_run_hass_job(HassJob(target), args) File "/usr/src/homeassistant/homeassistant/core.py", line 593, in async_run_hass_job hassjob.target(args) File "/config/custom_components/multizone_thermostat/climate.py", line 1051, in async_set_integral self._hvac_def[hvac_mode].integral(integral) AttributeError: 'HVACSetting' object has no attribute 'integral'

config:

  - platform: multizone_thermostat
    name: valve_controller
    unique_id: valve_controller
    sensor: sensor.temp2_temperature
    #filter_mode: 3
    initial_hvac_mode: "heat"
    precision: 0.1
    detailed_output: on
    heat:
      entity_id: input_number.klep_opening
      min_target_temp: 25
      max_target_temp: 70
      proportional_mode:
        control_interval:
          minutes: 1
        pwm_duration: 0
        PID_mode:
          kp: 1.440316227
          ki: 0.006306803
          kd: 82.23305459
    restore_from_old_state: True
    restore_parameters: True
    restore_integral: True

using latest version downloaded on 2023/04/06

vindaalex commented 1 year ago

Thank you for reporting the bug. I will try to fix it this week

vindaalex commented 1 year ago

Fixed with pr #20