samsungrac icon indicating copy to clipboard operation
samsungrac copied to clipboard

MIM-H03 Module / Request execution failed Missing Elements?

Open Derfington opened this issue 3 years ago • 9 comments

Hi thanks for the module.

I am getting errors trying to configure this module with one of my two samsung ducted air conditioners. (I am just trying to get one to work for now).

After getting my 10 digit token from the MIM-H03 module I installed the hac's addon.

I've added the following to my configuration.yaml

climate:
  - platform: climate_ip
    config_file: '/config/custom_components/climate_ip/mim-h03_heatpump.yaml'
    ip_address: 192.168.1.44
    token: MY10DIGITTOKEN
    cert: '/config/custom_components/climate_ip/ac14k_m.pem'
    debug: true

I then restarted home assistant and then initially it displayed the Climate card in entities but was saying in home assistant logs that there were to many API call's. I then restarted the MIM-H03 module by pressing the reset button on it and then restarted home assistant.

The entity does not come up in home assistant however I can see that it is getting the correct information from the samsung unit "set temperature, mode, etc"

Now I am not sure if it is relevant but home assistant is spitting the following: Detected I/O inside the event loop. This is causing stability issues. Would this cause the module to not continue?

See below all of the related logs to climate-ip. (I have taken out all the other esphome, etc for easy viewing)

2021-05-10 00:29:06 WARNING (MainThread) [homeassistant.loader] You are using a custom integration climate_ip which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

2021-05-10 00:29:06 INFO (MainThread) [custom_components.climate_ip.climate] climate_ip: async setup platform
2021-05-10 00:29:06 INFO (MainThread) [custom_components.climate_ip.climate] Loading configuration file: /config/custom_components/climate_ip/mim-h03_heatpump.yaml
2021-05-10 00:29:06 INFO (MainThread) [custom_components.climate_ip.climate] ip_address: 192.168.1.44
2021-05-10 00:29:06 INFO (MainThread) [custom_components.climate_ip.climate] token: MY10DIGITTOKEN
2021-05-10 00:29:06 INFO (MainThread) [custom_components.climate_ip.climate] Validate properties: False (False)
2021-05-10 00:29:06 INFO (MainThread) [custom_components.climate_ip.climate] Updating state...
2021-05-10 00:29:06 INFO (MainThread) [custom_components.climate_ip.climate] Updating getter...
2021-05-10 00:29:06 INFO (MainThread) [custom_components.climate_ip.climate] Checking execute condition
2021-05-10 00:29:06 WARNING (MainThread) [custom_components.climate_ip.climate] Execute condition not found, executing
2021-05-10 00:29:06 INFO (MainThread) [custom_components.climate_ip.climate] Executing command...
2021-05-10 00:29:06 INFO (MainThread) [custom_components.climate_ip.climate] {'timeout': 5, 'cert': '/config/custom_components/climate_ip/ac14k_m.pem', 'verify': False, 'headers': {'Authorization': 'Bearer MY10DIGITTOKEN', 'Content-Type': 'application/json'}, 'method': 'GET', 'url': 'https://192.168.1.44:8888/devices'}
2021-05-10 00:29:07 WARNING (MainThread) [homeassistant.util.async_] Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for climate_ip doing I/O at custom_components/climate_ip/connection_request.py, line 105: resp = session.request(**self._params)
2021-05-10 00:29:07 ERROR (MainThread) [custom_components.climate_ip.climate] Request execution failed. Stack trace:
Traceback (most recent call last):
  File "/config/custom_components/climate_ip/connection_request.py", line 105, in execute_internal
    resp = session.request(**self._params)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 394, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 234, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/usr/local/lib/python3.8/http/client.py", line 1252, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1263, in _send_request
    self.putrequest(method, url, **skips)
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 214, in putrequest
    return _HTTPConnection.putrequest(self, method, url, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 151, in protected_loop_func
    check_loop()
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 140, in check_loop
    raise RuntimeError(
RuntimeError: I/O must be done in the executor; Use `await hass.async_add_executor_job()` at custom_components/climate_ip/connection_request.py, line 105: resp = session.request(**self._params)
2021-05-10 00:29:07 INFO (MainThread) [custom_components.climate_ip.climate] Getter updated with value: None
2021-05-10 00:29:07 INFO (MainThread) [custom_components.climate_ip.climate] Updating operations...
2021-05-10 00:29:07 INFO (MainThread) [custom_components.climate_ip.climate] Updating properties...

2021-05-10 00:29:09 INFO (SyncWorker_5) [custom_components.climate_ip.climate] update
2021-05-10 00:29:09 INFO (SyncWorker_5) [custom_components.climate_ip.climate] Updating state...
2021-05-10 00:29:09 INFO (SyncWorker_5) [custom_components.climate_ip.climate] Updating getter...
2021-05-10 00:29:09 INFO (SyncWorker_5) [custom_components.climate_ip.climate] Checking execute condition
2021-05-10 00:29:09 WARNING (SyncWorker_5) [custom_components.climate_ip.climate] Execute condition not found, executing
2021-05-10 00:29:09 INFO (SyncWorker_5) [custom_components.climate_ip.climate] Executing command...
2021-05-10 00:29:09 INFO (SyncWorker_5) [custom_components.climate_ip.climate] {'timeout': 5, 'cert': '/config/custom_components/climate_ip/ac14k_m.pem', 'verify': False, 'headers': {'Authorization': 'Bearer MY10DIGITTOKEN', 'Content-Type': 'application/json'}, 'method': 'GET', 'url': 'https://192.168.1.44:8888/devices'}
2021-05-10 00:29:09 INFO (SyncWorker_5) [custom_components.climate_ip.climate] Command executed with code: 200, text: {"Devices":[{"ConfigurationLink":{"href":"/devices/0/configuration"},"InformationLink":{"href":"/devices/0/information"},"Operation":{"dhwPower":"Off","power":"On","ventilationPower":"Off"},"Temperatures":[{"desired":0,"id":"0","increment":1,"unit":"Celsius"}],"id":"0","name":"Wifi-kit","resources":["Alarms","Operation","Temperatures","Information","Configuration"],"type":"Air_Conditioner","uuid":"REDACTED"},{"Alarms":[{"alarmType":"Device","code":"0","id":"0","triggeredTime":"2021-05-10T00:29:51"}],"ConfigurationLink":{"href":"/devices/032000000/configuration"},"InformationLink":{"href":"/devices/032000000/information"},"Mode":{"modes":["Opmode_Heat"],"options":["Volume_100"],"supportedModes":["Opmode_Auto","Opmode_Cool","Opmode_Dry","Opmode_Fan","Opmode_Heat"]},"Operation":{"power":"On"},"Temperatures":[{"current":23.8,"desired":23,"id":"0","increment":1,"maximum":30,"minimum":16,"name":"INDOOR","unit":"Celsius"}],"Wind":{"direction":"Off","speedLevel":0,"supportedWindModes":["0","4","3","2","Off"]},"description":"DUCT","id":"032000000","name":"BackAircon","resources":["Operation","Wind","Mode","Temperatures","Information","Configuration","Alarms"],"type":"Air_Conditioner","uuid":"REDACTED"},{"Alarms":[{"alarmType":"Device","code":"0","id":"0","triggeredTime":"2021-05-10T00:29:51"}],"ConfigurationLink":{"href":"/devices/016000000/configuration"},"EnergyConsumption":{"instantaneousPower":2.43,"saveLocation":"/EnergyDatabases/Monthly.db"},"InformationLink":{"href":"/devices/016000000/information"},"Operation":{"power":"On"},"id":"016000000","name":"16:00:00","resources":["Operation","EnergyConsumption","Information","Configuration","Alarms"],"type":"Air_Conditioner","uuid":"REDACTED"}]}

2021-05-10 00:29:09 INFO (SyncWorker_5) [custom_components.climate_ip.climate] Getter updated with value: {'Alarms': [{'alarmType': 'Device', 'code': '0', 'id': '0', 'triggeredTime': '2021-05-10T00:29:51'}], 'ConfigurationLink': {'href': '/devices/032000000/configuration'}, 'InformationLink': {'href': '/devices/032000000/information'}, 'Mode': {'modes': ['Opmode_Heat'], 'options': ['Volume_100'], 'supportedModes': ['Opmode_Auto', 'Opmode_Cool', 'Opmode_Dry', 'Opmode_Fan', 'Opmode_Heat']}, 'Operation': {'power': 'On'}, 'Temperatures': [{'current': 23.8, 'desired': 23, 'id': '0', 'increment': 1, 'maximum': 30, 'minimum': 16, 'name': 'INDOOR', 'unit': 'Celsius'}], 'Wind': {'direction': 'Off', 'speedLevel': 0, 'supportedWindModes': ['0', '4', '3', '2', 'Off']}, 'description': 'DUCT', 'id': '032000000', 'name': 'BackAircon', 'resources': ['Operation', 'Wind', 'Mode', 'Temperatures', 'Information', 'Configuration', 'Alarms'], 'type': 'Air_Conditioner', 'uuid': 'REDACTED'}
2021-05-10 00:29:09 INFO (SyncWorker_5) [custom_components.climate_ip.climate] Updating operations...
2021-05-10 00:29:09 INFO (SyncWorker_5) [custom_components.climate_ip.climate] Updating properties...
2021-05-10 00:29:09 ERROR (MainThread) [homeassistant.components.climate] climate_ip: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 407, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 516, in async_device_update
    await task
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/climate_ip/climate.py", line 261, in update
    self.rac.update_state()
  File "/config/custom_components/climate_ip/controller_yaml.py", line 226, in update_state
    prop.update_state(device_state, debug)
  File "/config/custom_components/climate_ip/properties.py", line 233, in update_state
    v = self.status_template.render(device_state=device_state)
  File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 1090, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/usr/local/lib/python3.8/site-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "<template>", line 1, in top-level template code
  File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 471, in getattr
    return getattr(obj, attribute)
jinja2.exceptions.UndefinedError: list object has no element 2

Thanks

Derfington avatar May 09 '21 14:05 Derfington