Giter VIP home page Giter VIP logo

samsungrac's People

Contributors

atxbyea avatar cookingblight avatar cybersmurfen avatar d3m3trius avatar gaep90 avatar ishioni avatar kirichkov avatar ktibow avatar lucadjc avatar mauriziosacca avatar mikdsouza avatar postlund avatar sebuzet avatar thomasja27 avatar thywolf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

samsungrac's Issues

climate_ip: error while creating controller!

Dear atxbyea,
I have a problem with this custom component.
Can you help me pls?

Best regards.
Daniele

HA Version
Home Assistant 0.115.2

configuration.yaml
climate:

  • platform: climate_ip
    name: 'AC Living Room'
    config_file: 'mim-h03_heatpump.yaml'
    ip_address: 'xxx.xxx.xxxx.xxxx'
    token: 'xxxxxxxxxxxxx'
    cert: 'ac14k_m.pem'
    debug: True

LOG

Oct 30 14:37:17 DVSL_HomeAssistant hass: 2020-10-30 14:37:17 INFO (MainThread) [custom_components.climate_ip.climate] Updating operations...
Oct 30 14:37:17 DVSL_HomeAssistant hass: 2020-10-30 14:37:17 INFO (MainThread) [custom_components.climate_ip.climate] Updating properties...
Oct 30 14:37:17 DVSL_HomeAssistant hass: 2020-10-30 14:37:17 ERROR (MainThread) [custom_components.climate_ip.climate] climate_ip: error while creating controller!
Oct 30 14:37:17 DVSL_HomeAssistant hass: 2020-10-30 14:37:17 ERROR (MainThread) [homeassistant.components.climate] Error while setting up climate_ip platform for climate
Oct 30 14:37:17 DVSL_HomeAssistant hass: Traceback (most recent call last):
Oct 30 14:37:17 DVSL_HomeAssistant hass: File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity_platform.py", line 192, in _async_setup_platform
Oct 30 14:37:17 DVSL_HomeAssistant hass: await asyncio.shield(task)
Oct 30 14:37:17 DVSL_HomeAssistant hass: File "/home/homeassistant/.homeassistant/custom_components/climate_ip/climate.py", line 124, in async_setup_platform
Oct 30 14:37:17 DVSL_HomeAssistant hass: device_controller = create_controller(
Oct 30 14:37:17 DVSL_HomeAssistant hass: File "/home/homeassistant/.homeassistant/custom_components/climate_ip/controller.py", line 71, in create_controller
Oct 30 14:37:17 DVSL_HomeAssistant hass: if c.initialize():
Oct 30 14:37:17 DVSL_HomeAssistant hass: File "/home/homeassistant/.homeassistant/custom_components/climate_ip/controller_yaml.py", line 169, in initialize
Oct 30 14:37:17 DVSL_HomeAssistant hass: self.update_state()
Oct 30 14:37:17 DVSL_HomeAssistant hass: File "/home/homeassistant/.homeassistant/custom_components/climate_ip/controller_yaml.py", line 226, in update_state
Oct 30 14:37:17 DVSL_HomeAssistant hass: prop.update_state(device_state, debug)
Oct 30 14:37:17 DVSL_HomeAssistant hass: File "/home/homeassistant/.homeassistant/custom_components/climate_ip/properties.py", line 233, in update_state
Oct 30 14:37:17 DVSL_HomeAssistant hass: v = self.status_template.render(device_state=device_state)
Oct 30 14:37:17 DVSL_HomeAssistant hass: File "/srv/homeassistant/lib/python3.8/site-packages/jinja2/environment.py", line 1090, in render
Oct 30 14:37:17 DVSL_HomeAssistant hass: self.environment.handle_exception()
Oct 30 14:37:17 DVSL_HomeAssistant hass: File "/srv/homeassistant/lib/python3.8/site-packages/jinja2/environment.py", line 832, in handle_exception
Oct 30 14:37:17 DVSL_HomeAssistant hass: reraise(*rewrite_traceback_stack(source=source))
Oct 30 14:37:17 DVSL_HomeAssistant hass: File "/srv/homeassistant/lib/python3.8/site-packages/jinja2/_compat.py", line 28, in reraise
Oct 30 14:37:17 DVSL_HomeAssistant hass: raise value.with_traceback(tb)
Oct 30 14:37:17 DVSL_HomeAssistant hass: File "", line 1, in top-level template code
Oct 30 14:37:17 DVSL_HomeAssistant hass: File "/srv/homeassistant/lib/python3.8/site-packages/jinja2/environment.py", line 471, in getattr
Oct 30 14:37:17 DVSL_HomeAssistant hass: return getattr(obj, attribute)
Oct 30 14:37:17 DVSL_HomeAssistant hass: jinja2.exceptions.UndefinedError: list object has no element 2

SSL errors all of a sudden, not sure of its SSL Lib, or Certificate

Hi
I run HA in ubuntu 20.04, climate_ip stopped working somewhere in the last month. I've made no changes and it was controlling two Samsung AC units perfectly. When it stopped working added debug clauses for climate_ip to HA and didn't really see any additional details, however after updating HA today to 20210303 I can now see all these errors related to climate_ip coming through the logs.
This is using 3.5.1 of Climate Ip installed via HACS - this has not been updated for a while and was working fine on this version.
As per title, not sure if this is a new SSL library that now enforces something stronger, or the cert is at fault.
I pasted all the certs into a decoder and they all expire in 2059 - but my knowledge is pretty limited with this so hopefully you can help.
(Note I replaced part of token with xxxxx)

2021-03-10 16:28:49 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-03-10 16:28:49 WARNING (MainThread) [homeassistant.loader] No 'version' key in the manifest file for custom integration 'climate_ip'. This will not be allowed in a future version of Home Assistant. Please report this to the maintainer of 'climate_ip'
2021-03-10 16:28:51 INFO (MainThread) [roonapi] Connecting to Roon server 192.168.0.10:9100
2021-03-10 16:28:51 INFO (Dummy-7) [roonapi] Connection with roon websockets (re)created.
2021-03-10 16:28:51 INFO (Dummy-7) [roonapi] Confirming previous registration with Roon...
2021-03-10 16:28:51 INFO (Thread-4) [roonapi] Registered to Roon server zotac
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] climate_ip: async setup platform
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Loading configuration file: /home/homeassistant/.homeassistant/custom_components/climate_ip/samsung_2878.yaml
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] ip_address: 192.168.0.40
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] token: 8a16xxxx-xxxx-xxxx-xxxx-e4599exxxxx
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Validate properties: False (False)
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Configuration, host: 192.168.0.40:2878
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Configuration, token: 8a16xxxx-xxxx-xxxx-xxxx-e4599exxxxx
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Configuration, duid: bc8ccdd79b0a
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Configuration, cert: /home/homeassistant/.homeassistant/custom_components/climate_ip/ac14k_m.pem
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Updating state...
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Updating getter...
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Executing params: {'duid': 'bc8ccdd79b0a', 'token': '8a16b480-8103-4ba9-a7ba-e4599e20f905', 'host': '192.168.0.40', 'connection_template': '<Request Type="AuthToken"><User Token="{{token}}" /></Request>', 'power_template': '{% if value != none %}{% for key, value in device_state.items() %}{% if key == "AC_FUN_POWER" %}{% if value == "Off" %}<Request Type="DeviceControl"><Control CommandID="AC_FUN_POWER" DUID="{{duid}}"><Attr ID="AC_FUN_POWER" Value="On" /></Control></Request>{% endif %}{% endif %}{% endfor %}{% endif %}', 'value': None, 'device_state': 'unknown'}
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Checking power on template: <Template memory:7f6bde953070>
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Power on template found, rendering
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Power on message:
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Executing command: <Request Type="DeviceState" DUID="bc8ccdd79b0a"></Request>

2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Getting socket connection
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Connection invalid, creating!
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Creating ssl context
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Setting up ciphers
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Setting up verify mode
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Setting up verify location: /home/homeassistant/.homeassistant/custom_components/climate_ip/ac14k_m.pem
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Setting up load cert chain: /home/homeassistant/.homeassistant/custom_components/climate_ip/ac14k_m.pem
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Sending command failed
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Traceback (most recent call last):
  File "/home/homeassistant/.homeassistant/custom_components/climate_ip/samsung_2878.py", line 219, in send_socket_command
    sslSocket = self.socket
  File "/home/homeassistant/.homeassistant/custom_components/climate_ip/samsung_2878.py", line 281, in socket
    self.create_connection()
  File "/home/homeassistant/.homeassistant/custom_components/climate_ip/samsung_2878.py", line 257, in create_connection
    sslContext.load_cert_chain(cfg.cert)
ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:4022)

2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Retrying sending command...
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Getting socket connection
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Connection invalid, creating!
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Creating ssl context
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Setting up ciphers
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Setting up verify mode
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Setting up verify location: /home/homeassistant/.homeassistant/custom_components/climate_ip/ac14k_m.pem
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Setting up load cert chain: /home/homeassistant/.homeassistant/custom_components/climate_ip/ac14k_m.pem
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Sending command failed
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Traceback (most recent call last):
  File "/home/homeassistant/.homeassistant/custom_components/climate_ip/samsung_2878.py", line 219, in send_socket_command
    sslSocket = self.socket
  File "/home/homeassistant/.homeassistant/custom_components/climate_ip/samsung_2878.py", line 281, in socket
    self.create_connection()
  File "/home/homeassistant/.homeassistant/custom_components/climate_ip/samsung_2878.py", line 257, in create_connection
    sslContext.load_cert_chain(cfg.cert)
ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:4022)

2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Getter updated with value: {}
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Updating operations...
2021-03-10 16:28:54 INFO (MainThread) [custom_components.climate_ip.climate] Updating properties...

Turn On/Off Display on Samsung AC

Would it be possible to add State attribute for the Display on Samsung AC and have it turned ON/Off by Home Assistant automation?

New certificate and fix for cypher configuration

Hi,
i created a new releases with 2 main changes:

  • new certificate from Samsung with expiration date 2060
  • change on samsung_2878.py the cyphersuite setting as following (in bold the new rows).

This is allowing my home setting to work properly both with C/A that are requiring the certificates and the once without.

def create_connection(self):
sslSocket = None
cfg = self._cfg
self.logger.info("Creating ssl context")
sslContext = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
self.logger.info("Setting up ciphers")
sslContext.set_ciphers("HIGH:!DH:!aNULL")
self.logger.info("Setting up verify mode")
sslContext.verify_mode = (
ssl.CERT_REQUIRED if cfg.cert is not None else ssl.CERT_NONE
)
if cfg.cert is not None:
sslContext.set_ciphers("ALL:@SECLEVEL=0")
self.logger.info("Setting up verify location: {}".format(cfg.cert))
sslContext.load_verify_locations(cafile=cfg.cert)
self.logger.info("Setting up load cert chain: {}".format(cfg.cert))
sslContext.load_cert_chain(cfg.cert)

Support Samsung AC with Wind Free mode

Some air conditioning models from Samsung have a Wind Free mode. To handle it you need to add the following mode and special mode in samsungrac.yaml

'Wind Free': { value : 'Comode_Nano', connection: { params: { json: { "options": ["Comode_Nano"] } } } }

climate_ip integration fail to start

Hello, for a few days I have been experiencing a problem: climate_ip does not start anymore.
In the logs, I see this error message:

2022-07-07 05:50:55 ERROR (SyncWorker_11) [custom_components.climate_ip.climate] Request execution failed. Stack trace:
2022-07-07 05:50:57 ERROR (MainThread) [homeassistant.components.climate] Error adding entities for domain climate with platform climate_ip
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 397, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 641, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 776, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 532, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 570, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 538, in _stringify_state
if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 220, in state
return HVACMode(self.hvac_mode).value
File "/usr/local/lib/python3.10/enum.py", line 385, in call
return cls.new(cls, value)
File "/usr/local/lib/python3.10/enum.py", line 710, in new
raise ve_exc
ValueError: 'unknown' is not a valid HVACMode

The message repeats several times, once for each air conditioner that I have configured in the configuration.yaml.

The version of HA I'm using is this:
Home Assistant 2022.7.0
Supervisor 2022.06.2
Operating System 8.2 Frontend 20220706.0 - latest

The version of climate_ip I am using is 4.0

This is my setup:
climate:

  • platform: climate_ip
    name: 'AC Cucina'
    config_file: 'samsungrac.yaml'
    ip_address: 'myip'
    token: 'mytoken'
    cert: 'ac14k_m.pem'

  • platform: climate_ip
    name: 'AC Sala'
    config_file: 'samsungrac.yaml'
    ip_address: '192.168.168.104'
    token: '9XI6E6jV9w'
    cert: 'ac14k_m.pem'

  • platform: climate_ip
    name: 'AC Camera Yuri and Roby'
    config_file: 'samsungrac.yaml'
    ip_address: 'myip'
    token: 'mytoken'
    cert: 'ac14k_m.pem'

  • platform: climate_ip
    name: 'AC Camera Leo'
    config_file: 'samsungrac.yaml'
    ip_address: 'myip'
    token: 'mytoken'
    cert: 'ac14k_m.pem'

  • platform: climate_ip
    name: 'AC Camera Cri'
    config_file: 'samsungrac.yaml'
    ip_address: 'myip'
    token: 'mytoken'
    cert: 'ac14k_m.pem'

I installed climate_ip a few weeks ago, and it worked fine for a while. Now it doesn't work anymore.

I have already tried to turn the air conditioners off and on again, but the problem did not go away.

How can I solve?
Thank you!

Juri

Integration no longer loads in 2021.6

Hi

Component no longer loads in 2021.6

Taken form release notes

Custom integrations (custom_components) - https://www.home-assistant.io/blog/2021/06/02/release-20216/#breaking-changes
As mentioned in every release since 2021.3, custom integrations will require a version key in their manifest file.

As of this release, if that version key is missing in the manifest, the custom integration will no longer be loaded.

For more details see our developer blog about it

Will the version key be provided for this integration (assuming that is whats needed) ?

Thanks

Not working

hi,
i have installed component but on log of home assistant i have this error:

2021-01-14 17:54:06 WARNING (MainThread) [homeassistant.components.climate] Updating climate_ip climate took longer than the scheduled update interval 0:00:15
2021-01-14 17:54:21 WARNING (MainThread) [homeassistant.components.climate] Updating climate_ip climate took longer than the scheduled update interval 0:00:15

Home Assistant 2021.1.1

MIM-H03 - timeout issues

I have been having timeout issues with MIM-H03 from last couple of weeks. This has been working with out any issues on 5.1 so something must have changed on samsung server side. Does anyone else having any timeout issues with MIM-H03?

ERROR:

Request result exception: HTTPSConnectionPool(host='192.168.1.29', port=8888): Read timed out. (read timeout=15)

GET https://IP:8888/devices returns two separate AC devices

Problem
For certain AC models Samsung is selling, "GET https://IP:8888/devices" returns two separate AC devices values.

Background
I have a Samsung AC set, one main AC with WIFI, and the other just connected to the main AC.
So one can install two AC's in different rooms with merit of installing only one heat exchanger outside.
Smartthings natively supports such configuration too.

10165396_h

(sold as one product with two separate remotes for each AC, but only one outside heat exchanger unit to save energy and space)

Details

# curl -s -k -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxx" --cert /root/ac/cert.pem --insecure -X GET https://192.168.45.232:8888/devices
{"Devices":[
{"Alarms":[{"alarmType":"Device","code":"ErrorCode_OFF","id":"0","triggeredTime":"2021-08-12T01:15:15"},{"alarmType":"Device","code":"FilterAlarm_OFF","id":"1","triggeredTime":"2021-08-12T01:15:15"}],"ConfigurationLink":{"href":"/devices/1/configuration"},"EnergyConsumption":{"saveLocation":"/files/usage.db"},"InformationLink":{"href":"/devices/1/information"},"Mode":{"modes":["Auto"],"options":["Comode_Off","Sleep_0","Autoclean_Off","Light_Off","Volume_100","RacOptionCode_0","FilterCleanAlarm_0","AI_Enable","ArtificialWork_Off","DisplayArtificial_Off"],"supportedModes":["Cool","Dry","Wind","CoolClean","DryClean","Auto"]},"Operation":{"power":"Off"},"Temperatures":[{"current":29.0,"desired":26.0,"id":"0","maximum":30,"minimum":16,"unit":"Celsius"}],"Wind":{"direction":"Fix","speedLevel":0},"connected":true,"description":"FAC_BORA_RAC_17K","id":"1","name":"Room Air Conditioner","resources":["Alarms","Configuration","Diagnosis","EnergyConsumption","Humidity","Information","Mode","Operation","Sensors","Temperatures","Wind"],"type":"Air_Conditioner","uuid":"C0972775-XXXX-0000-0000-000000000001"},
{"Alarms":[{"alarmType":"Device","code":"","id":"0","triggeredTime":"2021-08-12T01:15:16"},{"alarmType":"Device","code":"FilterAlarm_OFF","id":"1","triggeredTime":"2021-08-12T01:15:16"},{"alarmType":"Device","code":"AC_V_0002_OFF","id":"2","triggeredTime":"2021-08-12T01:15:16"}],"ConfigurationLink":{"href":"/devices/0/configuration"},"Diagnosis":{"diagnosisStart":"Ready"},"EnergyConsumption":{"cumulativeConsumption":100.0,"instantaneousPower":0.0,"saveLocation":"/files/usage.db","usageThreshold":0.0},"Humidity":{"current":0.0,"unit":"Percentage"},"InformationLink":{"href":"/devices/0/information"},"Mode":{"modes":["Wind"],"options":["Operation_Family","Comode_Off","Sleep_0","Autoclean_Off","FilterCleanAlarm_0","Panel_Close","Light_Off","Smarton_LockOff","Weather_Off","Volume_33","OptionCode_797","UpdateAllow_NotAllowed","WattNotice_0","RacInfo_First","ModelInfo_16K_BORA_VENT3","Blooming_0","UsagesDB_ok","EnergySaveIcon_Off","Dehumidification_0","AirMonitoring_Off","AI_Enable","ArtificialWork_Off","DisplayArtificial_Off"],"supportedModes":["Cool","Dry","Wind","CoolClean","DryClean","Auto"]},"Operation":{"power":"Off"},"Sensors":[{"id":"0","type":"CleanLevel","values":[2.0]},{"id":"1","type":"Odor","values":[0.0]},{"id":"2","type":"Dust","values":[9.0,0.0]},{"id":"3","type":"FineDust","values":[9.0,0.0]}],"Temperatures":[{"current":30.0,"desired":24.0,"id":"0","maximum":30,"minimum":18,"unit":"Celsius"}],"Wind":{"direction":"Off","speedLevel":3},"connected":true,"description":"FAC_BORA_17K","id":"0","name":"Stand Air Conditioner","resources":["Alarms","Configuration","Diagnosis","EnergyConsumption","Humidity","Information","Mode","Operation","Sensors","Temperatures","Wind"],"type":"Air_Conditioner","uuid":"C0972775-XXXX-0000-0000-000000000000"}]}

If you see the returned JSON above carefully, there are two different sets of device values. device/0 and device/1.
Which is actually correct behavior, since it's Dual AC-set model.
(You can use 'GET https://IP:8888/devices/0' or 'GET https://IP:8888/devices/1' to have just one set of device status values returned)

The problem is that in Homeassistant, climate_ip attributes are populated by the result of 'GET https://IP:8888/devices' call which contains TWO sets of almost identical JSON values. HOMEASSISTANT is parsing it only once. so Guess which values HOMEASSISTANT is using then? Always the first device's.

Example
When I turn on device 0. the default device for climate_ip, HOMEASSISTANT populates attributes with device 1 values which is, for some reason, returned sequentially ahead of device 0. Since device 1 is not turned on, HOMEASSISTANT think the climate device is still Power off, Mode off and so on.

Digging
I have tried to put '/0' in the end of

  status:
    type: 'json_status'
    connection:
      params: { method : 'GET', url: 'https://__CLIMATE_IP_HOST__:8888/devices' }

so it would look like,

      params: { method : 'GET', url: 'https://__CLIMATE_IP_HOST__:8888/devices/0' }

in samsungrac.yaml without success. It produces bellow error in HOMEASSISTANT.

2021-08-12 08:19:39 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 432, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 601, in async_device_update
    await task
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, 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 222, in update_state
    op.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.9/site-packages/jinja2/environment.py", line 1304, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 925, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 1, in top-level template code
  File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 455, in getitem
    return obj[argument]
jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'Devices'

I think it would solve the problem, if only I could put "/0" or "/1" at the end of
params: { method : 'GET', url: 'https://__CLIMATE_IP_HOST__:8888/devices' }
to
params: { method : 'GET', url: 'https://__CLIMATE_IP_HOST__:8888/devices/0' }

or '/1' then modify all /0 in samsungrac.yaml to /1. Actually, in this way I can separately control both AC's, with two different yamls.
I have confirmed that with the same IP and port, '/devices/0' and '/devices/1' are what differentiates two AC's, only tried on/off operation, but I am sure others work too.

I do not have the expertise to find what is causing "jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'Devices'" when I put /0 at the end of json_status params. Please help.

By the way, I think even Google nests and Alexa devices are currently supporting only the first device in this kind configuration.

Update

'GET https://192.168.1.132:8888/devices' gets,
{"Devices":[{"Alarms":[{"alarmType":"Device","code........

'GET https://192.168.1.132:8888/devices/0' gets,
{"Device":{"Alarms":[{"alarmType":"Device","code.....

Note the beginning of the returned JSON, "Devices:[" and "Device:"
The structural difference is causing the error on HA run, I guess.
How can I fix this?

Error adding entities for domain climate with platform climate_ip

climate_ip not working after recent updates
HA: 2022.7.5
climate_ip: 4.2

Logger: homeassistant.components.climate
Source: components/climate/init.py:220
Integration: Climate (documentation, issues)
First occurred: 9:08:08 AM (2 occurrences)
Last logged: 9:08:08 AM

Error adding entities for domain climate with platform climate_ip
Error while setting up climate_ip platform for climate
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 397, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 641, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 776, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 532, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 570, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 538, in _stringify_state
if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 220, in state
return HVACMode(self.hvac_mode).value
File "/usr/local/lib/python3.10/enum.py", line 385, in call
return cls.new(cls, value)
File "/usr/local/lib/python3.10/enum.py", line 710, in new
raise ve_exc
ValueError: '' is not a valid HVACMode

Creating socket failed!

v4.2
HA docker version

Logger: custom_components.climate_ip.climate
Source: custom_components/climate_ip/samsung_2878.py:308
Creating socket failed!

Which is line self.send_socket_command(message, 1)

This is followed by next error Error adding entities for domain climate with platform climate_ip:

Logger: homeassistant.components.climate
Source: components/climate/__init__.py:245
Integration: Climate (documentation, issues)
First occurred: 10:48:49 PM (1 occurrences)
Last logged: 10:48:49 PM

Error adding entities for domain climate with platform climate_ip
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 691, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 777, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 533, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 571, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 539, in _stringify_state
    if (state := self.state) is None:
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 245, in state
    return HVACMode(self.hvac_mode).value
  File "/usr/local/lib/python3.10/enum.py", line 385, in __call__
    return cls.__new__(cls, value)
  File "/usr/local/lib/python3.10/enum.py", line 710, in __new__
    raise ve_exc
ValueError: '' is not a valid HVACMode

Turning on or off when selecting a mode does not work

Hi!
Turn on (when I choose a mode) or Turn off (when I choose 'off' in the mode) do not work. The mode changes correctly but does not turn on.
It works correctly when I just turn off or on (climate.turn_on, climate.turn_off).
Everything else (temperature, fan...) works perfectly.
I have the "mim-h03_heatpump" option selected.
I've tried performing 'curl' commands and found that when I call the 'mode' endpoint, the 'power' operation is ignored.
Has anyone else had this same problem? Any ideas how I can fix it?

HA Update seems to have broken things

Hi,

Since upgrading to HA core-2022.5.4 I get the below error as climate tries to add in climate_ip. It seems to fall over because HVACMode is null. I am not a programmer so I'm not sure where to look to see where this is set.

Thanks

Andrew

`Logger: homeassistant.components.climate
Source: components/climate/init.py:220
Integration: Climate (documentation, issues)
First occurred: 17:29:03 (3 occurrences)
Last logged: 17:29:11

Error adding entities for domain climate with platform climate_ip
Error while setting up climate_ip platform for climate
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 619, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 810, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 533, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 571, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 539, in _stringify_state
if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 220, in state
return HVACMode(self.hvac_mode).value
File "/usr/local/lib/python3.9/enum.py", line 384, in call
return cls.new(cls, value)
File "/usr/local/lib/python3.9/enum.py", line 702, in new
raise ve_exc
ValueError: '' is not a valid HVACMode`

Latest HA updates breaks ClimateIP

Hi

Samsung HVAC using climate IP for some time working well, latest home assistant update looks to have broken it, tried 4.1 as others have suggested, no dice

Logs

Error adding entities for domain climate with platform climate_ip Error while setting up climate_ip platform for climate Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 438, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 709, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 804, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 556, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 597, in _async_write_ha_state state = self._stringify_state(available) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 562, in _stringify_state if (state := self.state) is None: File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 245, in state return HVACMode(self.hvac_mode).value File "/usr/local/lib/python3.10/enum.py", line 385, in __call__ return cls.__new__(cls, value) File "/usr/local/lib/python3.10/enum.py", line 710, in __new__ raise ve_exc ValueError: '' is not a valid HVACMode

Failed to call service error

Ive had some success getting the entity on a MIM-H03 to show up, however it doesnt work stating theres something to do with 'failed to call service climate/set_hvac_mode. 'uknown' is not a valid HVACMode'

Any Ideas?

Deprecated temperature utility

Hi all got this message in my logs today

2022-10-16 04:03:03.046 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that uses temperature utility. This is deprecated since 2022.10 and will stop working in Home Assistant 2022.4, it should be updated to use unit_conversion.TemperatureConverter instead. Please report issue to the custom integration author for climate_ip using this method at custom_components/climate_ip/climate.py, line 223: return convert_temperature(t, TEMP_CELSIUS, self.temperature_unit)
2022-10-16 04:03:03.049 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that uses temperature utility. This is deprecated since 2022.10 and will stop working in Home Assistant 2022.4, it should be updated to use unit_conversion.TemperatureConverter instead. Please report issue to the custom integration author for climate_ip using this method at custom_components/climate_ip/climate.py, line 230: return convert_temperature(t, TEMP_CELSIUS, self.temperature_unit)

Thank you!

Setup failed for climate_ip: No setup function defined.

Hi, I follwed old discussion on the SebuZet original code and arrived to yours forked version.
I installed this version and configured the YAML with my aircon ip, mac address and token.
When HA starts i get always the error : "Setup failed for climate_ip: No setup function defined."

Certificate issues (again)

#38 doesn't work for my AC that need "ALL:@SECLEVEL=0" to works correctly.

So, looking at the commits and issues history, it looks like there are some devices/OS that need:
sslContext.set_ciphers("ALL:@SECLEVEL=0")
and other that need:
sslContext.set_ciphers("HIGH:!DH:!aNULL")

The solution may be adding a config parameter with a default value and the possibility to change it.

Don't see climate ip

After download Climate IP with hacs, i go to integrations, add buttons, but i don't see the climate IP.. do you know why? I'm running home assistant core in a docker

SSL Error: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:3900)

Listening on localhost:8889
/root/server.py:44: DeprecationWarning: ssl.wrap_socket() is deprecated, use SSLContext.wrap_socket()
server.socket = ssl.wrap_socket(server.socket, certfile='cert.pem', server_side=True)
Traceback (most recent call last):
File "/root/server.py", line 48, in
main()
File "/root/server.py", line 44, in main
server.socket = ssl.wrap_socket(server.socket, certfile='cert.pem', server_side=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/ssl.py", line 1443, in wrap_socket
context.load_cert_chain(certfile, keyfile)
ssl.SSLError: [SSL: CA_MD_TOO_WEAK] ca md too weak (_ssl.c:3900)

I get this error

MIM-H03 Module / Request execution failed Missing Elements?

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

climate_ip stopped working

I have been using this component for a while without any issues. but something broke it recently. either 2021.9 or a recent hacs update. not really sure. I could see the below in the log file. please let me know if you need anything else for investigation.

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 206, in update_state
self._state_getter.update_state(self._state_getter.value, debug)
File "/config/custom_components/climate_ip/properties.py", line 257, in update_state
device_state = self.get_connection(None).execute(
File "/config/custom_components/climate_ip/samsung_2878.py", line 308, in execute
self.send_socket_command(message, 1)
File "/config/custom_components/climate_ip/samsung_2878.py", line 219, in send_socket_command
sslSocket = self.socket
File "/config/custom_components/climate_ip/samsung_2878.py", line 281, in socket
self.create_connection()
File "/config/custom_components/climate_ip/samsung_2878.py", line 270, in create_connection
sslSocket.connect((cfg.host, cfg.port))
File "/usr/local/lib/python3.9/ssl.py", line 1342, in connect
self._real_connect(addr, False)
File "/usr/local/lib/python3.9/ssl.py", line 1333, in _real_connect
self.do_handshake()
File "/usr/local/lib/python3.9/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()

Calling climate.turn_off toggles power rather than turning off

When calling the turn_off service as follows (from Node Red):
Domain: climate
Service: turn_off
Entity: (my Samsung AC)

If the current state of the AC is off, the call turns it back on.

This doesn't occur with my Daikin AC (which uses a different integration)

Error in log: [custom_components.climate_ip.climate] Request execution failed. Stack trace:

Hello,

I am getting the below errors in HA log hundreds of time, while actually everything works correctly.
Is there anything I can do about this?

Thank you!

2022-04-04 15:02:35 ERROR (SyncWorker_5) [custom_components.climate_ip.climate] Request execution failed. Stack trace:
2022-04-04 15:02:50 ERROR (SyncWorker_5) [custom_components.climate_ip.climate] Execution failed, unknown error
2022-04-04 15:04:20 ERROR (SyncWorker_0) [custom_components.climate_ip.climate] Request execution failed. Stack trace:
2022-04-04 15:04:35 ERROR (SyncWorker_6) [custom_components.climate_ip.climate] Request execution failed. Stack trace:
2022-04-04 15:04:48 ERROR (SyncWorker_1) [custom_components.climate_ip.climate] Execution failed, unknown error
2022-04-04 15:05:52 ERROR (SyncWorker_0) [custom_components.climate_ip.climate] Request execution failed. Stack trace:
2022-04-04 15:06:07 ERROR (SyncWorker_6) [custom_components.climate_ip.climate] Request execution failed. Stack trace:
2022-04-04 15:06:21 ERROR (SyncWorker_3) [custom_components.climate_ip.climate] Execution failed, unknown error

Installation via HACS

Basically via HACS, the repo gets placed in the custom_components folder but there is no card in HACS (indicating the installation was done).

Error when clicking card, temp showing as farenheight

Hi - Thanks for this, got my AC working again, as i used the older one and it stopped on me

I have a few questions

  1. When i click the entity card in HA, the box comes up all seems normal, but a message pops up as see here
    image

  2. The "Currently" temperature is reading in Fahrenheit, not Celsius, can I change this?
    image

  3. I have an older gen ducted system the swing mode and possibly the pre-sets dont exist for me, is it possible to remove these by commenting something out in the config?
    image

Thanks in advance

Unique ID not assigned

Hi!
I noticed that in the HA front end is not possible to set the climate entities (e.g. by assigning a room or exposing them to voice assistant), because the climate ip entitis do not have a unique ID set.
I even tried to assign one via yaml in tne configuration as customization of the etntitis, but the result is the same.
What can be done to overcome this?

not getting the right status

I have a MIM-H03 and it was linked to 5 indoor unit, I managed to get it working in HA, the controllings are working fine but if I turn the ac on or change the mode by wall panel, it won't show in HA, I've tried to get the status via command curl -vvv -k -H "Content-Type: application/json" -H "Authorization: Bearer MYTOKEN" --cert ./cert.pem --insecure -X GET https://MYIP:8888/devices/032003004, it showed the right status. Anyone know what was going on in HA?

Notifications from API

Hello.
Is there any way to extract some notifications from the Samsung api? For example: Filter cleaning notifications

Disconnect from internet

If I block the internet connection of the air conditioner, the integration does not work. It is normal?

current_temperature (AC_FUN_TEMPNOW) is incorrect

the current temperature shows 73c in HA but on the panel it is 16c. there was a suggestion to reduce 55 from AC_FUN_TEMPNOW, but that is not accurate either. any idea why it shows differently? Thanks in advance.

problem version 5.0 samsung_2878

hello I have two samsung type samsung_2878 after update from 4.3 to 5.0

the integration no longer works, it seems that there is no longer a connection

found problem:

I renamed to in custom folder, ac14k_m.pem

Integration Read MIM-H03, But Send New Commands to MIM-H03.

My old MIM-H02 stopped working when I upgraded HA to 2023.6.
I went and bought a MIM-H03, which fortunately was compatible with my Air Con.

What was unfortunate was that I am now faced with another problem, with not being able to get it to work with HA via this integration.

I've been tweaking my config via trial and error, and managed to get HA to see the air con finally using the following configs via Samsungrac V5.1. I can see the state and temperature of my air con, and they change immediately when I change the air con via the air con build in controller.

However for whatever reason, I cannot control the air con from HA via this integration.
Every command I send via the HA UI seems to be ignored, and nothing happens. There are no obvious errors in the logs.

Anyone that can help me ?

climate:
  - platform: climate_ip
    config_file: 'mim-h03_heatpump.yaml'
    name: ‘Air Conditioner’
    ip_address: xx.xx.xx.xx
    device_id: 032001000
    token: xxxxxxxxxxxx
    cert: 'ac14k_m.pem'
    debug: true

Detected I/O inside the event loop

Hi, I had installed Climate_Ip from your forked repo, but I have the same issue: when I give a command, this error appears in the log "Detected I/O inside the event loop"

not working anymore on up-to-date homeassistant

hi, integration does not work anymore after recent home assistant updates (can's say exactly when it stopped working). i did not make any changes in my config, so i assume recent changes might be the root cause. pls let me know if anything else is needed to help you analyze this issue. thank a lot.

hereinafter my log:
2023-03-19 17:48:24.225 WARNING (SyncWorker_2) [homeassistant.loader] We found 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
2023-03-19 17:48:34.811 INFO (MainThread) [custom_components.climate_ip.climate] climate_ip: async setup platform
2023-03-19 17:48:34.812 INFO (MainThread) [custom_components.climate_ip.climate] Loading configuration file: /config/custom_components/climate_ip/samsungrac.yaml
2023-03-19 17:48:34.812 INFO (MainThread) [custom_components.climate_ip.climate] ip_address: x.x.x.x
2023-03-19 17:48:34.812 INFO (MainThread) [custom_components.climate_ip.climate] token: xxx
2023-03-19 17:48:34.812 INFO (MainThread) [custom_components.climate_ip.climate] device id: 032000000
2023-03-19 17:48:34.876 INFO (MainThread) [custom_components.climate_ip.climate] Validate properties: False (False)
2023-03-19 17:48:34.942 INFO (MainThread) [custom_components.climate_ip.climate] Updating state...
2023-03-19 17:48:34.942 INFO (MainThread) [custom_components.climate_ip.climate] Updating getter...
2023-03-19 17:48:34.942 INFO (MainThread) [custom_components.climate_ip.climate] Checking execute condition
2023-03-19 17:48:34.942 WARNING (MainThread) [custom_components.climate_ip.climate] Execute condition not found, executing
2023-03-19 17:48:34.946 INFO (MainThread) [custom_components.climate_ip.climate] Executing command...
2023-03-19 17:48:34.946 INFO (MainThread) [custom_components.climate_ip.climate] Setting up HTTP Adapter and ssl context
2023-03-19 17:48:34.946 INFO (MainThread) [custom_components.climate_ip.climate] {'timeout': 5, 'cert': '/config/custom_components/climate_ip/ac14k_m.pem', 'verify': False, 'headers': {'Authorization': 'Bearer xxx 'Content-Type': 'application/json'}, 'method': 'GET', 'url': 'https://x.x.x.x:8888/devices'}
2023-03-19 17:48:40.100 ERROR (MainThread) [custom_components.climate_ip.climate] Request result exception: HTTPSConnectionPool(host='x.x.x.x', port=8888): Read timed out. (read timeout=5)
2023-03-19 17:48:40.102 INFO (MainThread) [custom_components.climate_ip.climate] Getter updated with value: None
2023-03-19 17:48:40.102 INFO (MainThread) [custom_components.climate_ip.climate] Updating operations...
2023-03-19 17:48:40.102 INFO (MainThread) [custom_components.climate_ip.climate] Updating properties...
2023-03-19 17:48:41.657 INFO (SyncWorker_1) [custom_components.climate_ip.climate] update
2023-03-19 17:48:41.657 INFO (SyncWorker_1) [custom_components.climate_ip.climate] Updating state...
2023-03-19 17:48:41.657 INFO (SyncWorker_1) [custom_components.climate_ip.climate] Updating getter...
2023-03-19 17:48:41.657 INFO (SyncWorker_1) [custom_components.climate_ip.climate] Checking execute condition

SSL "Fix"" Breaks MIM-H02

The latest release 4.2 / 4.1 which targets SSL fix broke the integration with MIM-H02 (Using 'samsung_2878.yaml')

As soon as I roll back to 4.0, the air con shows up again in Home Assistant.

Release 4.2 breaks Samsung 2878

Get this error with my 2878 samsung AC, on Release 4.2.
Rolled back to Release 4.1. Then everything works fine.

Logger: homeassistant
Source: components/climate/init.py:245
First occurred: 11:21:20 (21 occurrences)
Last logged: 11:31:22

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 813, in _update_entity_states
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 532, in async_update_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 551, in _stringify_state
if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 245, in state
return HVACMode(self.hvac_mode).value
File "/usr/local/lib/python3.10/enum.py", line 385, in call
return cls.new(cls, value)
File "/usr/local/lib/python3.10/enum.py", line 710, in new
raise ve_exc
ValueError: '' is not a valid HVACMode

Climate_ip 3.2 errors

Hi @atxbyea ,
today I have got this errors in HomeAssistant Log:
(Climate_ip 3.2)


Logger: homeassistant.helpers.entity
Source: /usr/local/lib/python3.8/asyncio/events.py:81 
First occurred: 4:23:22 (8 occurrences) 
Last logged: 6:57:08
Update of climate.samsung_ac is taking over 10 seconds

Logger: custom_components.climate_ip.climate
Source: custom_components/climate_ip/connection_request.py:113 
Integration: climate_ip (documentation, issues) 
First occurred: 7:03:19 (89 occurrences) 
Last logged: 9:28:50
Request execution failed. Stack trace:

Logger: custom_components.climate_ip.climate
Source: custom_components/climate_ip/connection_request.py:135 
Integration: climate_ip (documentation, issues) 
First occurred: 7:03:48 (18 occurrences) 
Last logged: 9:29:02
Execution failed, unknown error

Performance - it brings down HA

Dear,

After testing Sebu's custom component and seeing HA performance issues. I was looking at the MQTT built from Sasha (https://github.com/gsasha/hvac_ip_mqtt_bridge) but there were bugs in the code.
Today I looked at your fork but still it seems not to be scalable enough for 6 A/Cs and more. Some of my components just don't work anymore. Also if I look my HDD moves to 90% utilisation. Anything you can do about it ?

I get the following error logs:

'Logger: custom_components.climate_ip.climate
Source: custom_components/climate_ip/samsung_2878.py:236
Integration: climate_ip (documentation, issues)
First occurred: 10:02:22 (224 occurrences)
Last logged: 10:29:58

Traceback (most recent call last): File "/config/custom_components/climate_ip/samsung_2878.py", line 219, in send_socket_command sslSocket = self.socket File "/config/custom_components/climate_ip/samsung_2878.py", line 281, in socket self.create_connection() File "/config/custom_components/climate_ip/samsung_2878.py", line 270, in create_connection sslSocket.connect((cfg.host, cfg.port)) File "/usr/local/lib/python3.8/ssl.py", line 1342, in connect self._real_connect(addr, False) File "/usr/local/lib/python3.8/ssl.py", line 1329, in _real_connect super().connect(addr) ConnectionRefusedError: [Errno 111] Connection refused

Logger: homeassistant.components.climate
Source: /usr/local/lib/python3.8/asyncio/events.py:81
Integration: Klimaat (documentation, issues)
First occurred: 10:02:34 (6 occurrences)
Last logged: 10:02:34

Setup of climate platform climate_ip is taking over 10 seconds.`

regards,
Jens

Obtain Token

Wondering if you had any luck with getting the token guide?

I've got a MIM-H03 wifi unit, runs on port 8888, however none of the scripts out there seem to work for obtaining the token, I get nothing back.

Able to connect it to the SmartThings App etc, but I'm after local control.

Could not resolve host' issue on MIM-H03

Hey fellas,

Ive got a MIM-H03 for my samsung and when i go to run the Device ID command
It always comes up as ' curl: (6) Could not resolve host: CLIMATE_IP_HOST

Ive got it set to the correct IP address.
Previously the 'heatpump' controller has shown up in entities, but always with the error
'This entity is no longer being provided by the climate_ip integration. If the entity is no longer in use, delete it in settings'

Anyone got any ideas what could be going wrong?

Cheers

no data received from ac

Hi All,

I have a fresh install, moving from homebridge (still working fine) plugin to hass, I think I get configured everything well, but I cant see any data and the card is not working. Config:

`climate:

  • platform: climate_ip
    config_file: 'samsung_2878.yaml'
    ip_address: 'XXXX'
    token: 'XXXX'
    mac: 'XXXX'
    name: 'samsung'
    cert: 'ac14k_m.pem'
    poll: True
    debug: True
    `
    The only problematic what I can see in the logs is the following:

Response: <?xml version="1.0" encoding="utf-8" ?><Response Status="Fail" Type="DeviceState" ErrorCode="103" />

Full log: https://pastebin.com/iJas3QPz

Can anyone can assist me what can be the problem?

Many Thanks

HAS 2023.6.1 - Broken

I upgraded HAS today and my Samsung AC has dropped out, it couldn't load so i took a gamble and upgraded the addon to the latest 5.1 (was on 4.0)

Up until now, I have deliberately stuck with v4.0 of this addon as it was the only one that wanted to work but when it didn't load after HAS upgrade i went to the latest to see if it would fix it.

Since going to 5.1 the dial is back, but no temps and control is not working, i can't see any errors in HA logs either.
image

Anyone experiencing the same?

Using 2878 on a MIM-H02

EDIT: Starting to see these
image
image

The Unit is responding OK as i can still use it via the old Samsung app

Fails after upgrading to 2022.7.0

Logger: homeassistant.components.climate
Source: components/climate/init.py:220
Integration: Klima (documentation, issues)
First occurred: 00:58:33 (2 occurrences)
Last logged: 00:58:33

Error adding entities for domain climate with platform climate_ip
Error while setting up climate_ip platform for climate
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 397, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 641, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 776, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 532, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 570, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 538, in _stringify_state
if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 220, in state
return HVACMode(self.hvac_mode).value
File "/usr/local/lib/python3.10/enum.py", line 385, in call
return cls.new(cls, value)
File "/usr/local/lib/python3.10/enum.py", line 710, in new
raise ve_exc
ValueError: '' is not a valid HVACMode

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.