Climate_IP - ClimateDevice for IP based units (not only Samsung AC)

@csirk51 That’s great. Which device are you using? With old API or the new one?
Br,
Sebastian

Im using a 2016 AR7580, it is a new api version. I tried the basic functions, they seem to work well.

@SebuZet, this time didnt work very well. Attributes arent populating.

min_temp: 16
max_temp: 32
fan_mode: 
special_list: wind3,sleep,off,wind1,softcontrol,quiet,smart,wind2
temperature: -1000
target_temp_step: 1
fan_list: mid,high,low,auto,turbo
special_mode: 
name: samsungrac
swing_mode: 
device_state: {}
operation_list: fan_only,heat,auto,dry,cool
current_temperature: -1000
friendly_name: Lounge AC
swing_list: up_down,all,left_right,fixed
power: 
supported_features: 4801
auto_clean: 
operation_mode: 
purify: 

Also, there is a spelling error for property in samsung_2878.py

Mar 30 16:15:03 hass[480]:  INFO (MainThread) [homeassistant.loader] Loaded climate_ip from custom_components.climate_ip
Mar 30 16:15:03 hass[480]:  WARNING (MainThread) [homeassistant.loader] You are using a custom component for climate_ip which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
Mar 30 16:15:03 hass[480]:  INFO (MainThread) [homeassistant.loader] Loaded climate_ip.climate from custom_components.climate_ip.climate
Mar 30 16:15:03 hass[480]:  WARNING (MainThread) [homeassistant.loader] You are using a custom component for climate_ip.climate which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
Mar 30 16:15:03 hass[480]:  INFO (MainThread) [homeassistant.setup] Setting up climate
Mar 30 16:15:07 hass[480]:  INFO (MainThread) [homeassistant.components.climate] Setting up climate.climate_ip
Mar 30 16:15:08 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] climate_ip: async setup platform
Mar 30 16:15:08 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Loading configuration file: /home/homeassistant/.homeassistant/custom_components/climate_ip/samsung_2878.yaml
Mar 30 16:15:08 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] ip_address: 192.168.1.30
Mar 30 16:15:08 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] token: f1d34c1a-fdd5-4131-1831-11318142f911
Mar 30 16:15:08 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Validate properties: False (False)
Mar 30 16:15:08 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Configuration, host: 192.168.1.30:2878
Mar 30 16:15:08 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Configuration, token: f1d34c1a-fdd5-4131-1831-11318142f911
Mar 30 16:15:08 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Configuration, duid: 1441E011EA11
Mar 30 16:15:08 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Configuration, cert: /home/homeassistant/.homeassistant/custom_components/climate_ip/ac14k_m.pem
Mar 30 16:15:08 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Executing command: None
Mar 30 16:15:08 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Getting socket connection
Mar 30 16:15:08 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Connection invalid, creating!
Mar 30 16:15:08 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Creating ssl context
Mar 30 16:15:08 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Setting up ciphers
Mar 30 16:15:08 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Setting up verify mode
Mar 30 16:15:08 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Setting up verify location: /home/homeassistant/.homeassistant/custom_components/climate_ip/ac14k_m.pem
Mar 30 16:15:08 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Setting up load cert chain: /home/homeassistant/.homeassistant/custom_components/climate_ip/ac14k_m.pem
Mar 30 16:15:08 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Wrapping socket
Mar 30 16:15:08 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Socket wrapped: True
Mar 30 16:15:08 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Connecting with 192.168.1.30:2878
Mar 30 16:15:09 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Response: DPLUG-1.6
Mar 30 16:15:09 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Response: <?xml version="1.0" encoding="utf-8" ?><Update Type="InvalidateAccount"/>
Mar 30 16:15:09 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Sending auth command: <Request Type="AuthToken"><User Token="f1d34c1a-fdd5-4131-1831-11318142f911" /></Request>
Mar 30 16:15:09 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Auth command sent
Mar 30 16:15:11 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Response: <?xml version="1.0" encoding="utf-8" ?><Response Type="AuthToken" Status="Okay" StartFrom="1970-01-02/21:30:49"/>
Mar 30 16:15:11 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Connection authenticated
Mar 30 16:15:11 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Requesting status with command: <Request Type="DeviceState" DUID="1441E011EA11"></Request>
Mar 30 16:15:11 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Status request sent
Mar 30 16:16:56 hass[480]:  WARNING (MainThread) [custom_components.climate_ip.climate] Socket timed out
Mar 30 16:16:56 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Connection created!
Mar 30 16:16:56 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Command empty, skipping sending
Mar 30 16:16:56 hass[480]:  WARNING (MainThread) [homeassistant.components.climate] Setup of platform climate_ip is taking over 10 seconds.
Mar 30 16:16:58 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Executing command: None
Mar 30 16:16:58 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Getting socket connection
Mar 30 16:16:58 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Command empty, skipping sending
Mar 30 16:17:00 hass[480]:  INFO (MainThread) [homeassistant.components.climate] Setting up climate.generic_thermostat
Mar 30 16:17:00 hass[480]:  INFO (MainThread) [homeassistant.setup] Setup of domain climate took 20.1 seconds.
Mar 30 16:18:24 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Executing command: None
Mar 30 16:18:24 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Getting socket connection
Mar 30 16:18:24 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Command empty, skipping sending
Mar 30 16:18:45 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Executing command: None
Mar 30 16:18:45 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Getting socket connection
Mar 30 16:18:45 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Command empty, skipping sending
Mar 30 16:19:06 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Executing command: None
Mar 30 16:19:06 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Getting socket connection
Mar 30 16:19:06 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Command empty, skipping sending
Mar 30 16:19:27 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Executing command: None
Mar 30 16:19:27 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Getting socket connection
Mar 30 16:19:27 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Command empty, skipping sending
Mar 30 16:19:48 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Executing command: None
Mar 30 16:19:48 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Getting socket connection
Mar 30 16:19:48 hass[480]:  INFO (MainThread) [custom_components.climate_ip.climate] Command empty, skipping sending

@Jman, Hi thanks. It’s strange. I thought I don’t need to call get status with this solution. Can you please try to uncomment line 13 in samsung_2878.yaml file? Right now it looks like this:

#connection_template: ‘<Request Type=“DeviceState” DUID=“{{duid}}”></Request>’

and it should looks like below:

connection_template: ‘<Request Type=“DeviceState” DUID=“{{duid}}”></Request>’

What kind of spelling error did you found? I don’t have such device and I don’t have a possibility to test it at home.

Has the custom components folder changed on recent releases? I’ve to stay with 0.70 since the new auth don’t work under a reverse proxy basic auth.

If I place this component under custom_components/climate_ip, it seems is not loading at all:

2019-03-31 17:43:54 ERROR (MainThread) [homeassistant.loader] Unable to find component climate.climate_ip

If this component is placed in custom_components/climate/climate_ip it loads, but then I face an error related to an attribute called “setup_platform”

2019-03-31 17:39:13 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform climate_ip
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py”, line 125, in _async_setup_platform
task = async_create_setup_task()
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py”, line 90, in async_create_setup_task
None, platform.setup_platform, hass, platform_config,
AttributeError: module ‘custom_components.climate.climate_ip’ has no attribute ‘setup_platform’

I’m using reverse proxy on Synology NAS and everything is working well. You can look into this thread:

Yes, indeed. Since v0.89 components are moved to different folders. Including custom components. Compatibility was broken. To make it working with old HASS you probably have to do as follow:

  • download all files from GitHub and place them in folder custom_components/climate/
  • rename file climate.py to climate_ip.py
  • copy everything from file __init __.py to file climate_ip.py (you can paste everything at the beginning of the file)
  • restart HASS - it should work

Let me know if it is working or not

Thanks for sharing the info about reverse proxy. Actually I’m able to make 0.90 work under reverse proxy (like NGINX), but I have to disable basic auth in this condition, otherwise I get some 401 errors (specially on config tab).

I’ve tried to make the changes on the custom component you said, but then it fails in other way:

2019-04-01 11:26:52 ERROR (MainThread) [homeassistant.setup] Error during setup of component climate
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py”, line 146, in _async_setup_component
component.setup, hass, processed_config) # type: ignore
AttributeError: module ‘custom_components.climate’ has no attribute ‘setup’

Anyway, thanks for your support. I will try to find a solution to move to 0.90 and test (keeping basic auth) your component.

After upgrading to 0.90, this custom component works as expected. Pretty cool, thanks @SebuZet

Just for your record, I’m using the Samsung AC Wind free - more details here

Hi @SebuZet. I enabled the line as you requested. I can see full device state data in the response now. Still no attributes seem to be populated. See log below

The spelling error is on line 228 of samsung_2878.py. @propertry which should be @property

INFO (Thread-13) [custom_components.climate_ip.climate] Setting up verify location: /home/homeassistant/.homeassistant/custom_components/climate_ip/ac14k_m.pem
2019-04-01 12:58:18 INFO (Thread-13) [custom_components.climate_ip.climate] Setting up load cert chain: /home/homeassistant/.homeassistant/custom_components/climate_ip/ac14k_m.pem
2019-04-01 12:58:18 INFO (Thread-13) [custom_components.climate_ip.climate] Wrapping socket
2019-04-01 12:58:18 INFO (Thread-13) [custom_components.climate_ip.climate] Socket wrapped: True
2019-04-01 12:58:18 INFO (Thread-13) [custom_components.climate_ip.climate] Connecting with 192.168.1.38:2878
2019-04-01 12:58:19 INFO (Thread-13) [custom_components.climate_ip.climate] Response: DPLUG-1.6
2019-04-01 12:58:19 INFO (Thread-13) [custom_components.climate_ip.climate] Response: <?xml version="1.0" encoding="utf-8" ?><Update Type="InvalidateAccount"/>
2019-04-01 12:58:19 INFO (Thread-13) [custom_components.climate_ip.climate] Sending auth command: <Request Type="AuthToken"><User Token="f11d34c9a-fdd5-1112-8811-1c341111f9dc" /></Request>
2019-04-01 12:58:19 INFO (Thread-13) [custom_components.climate_ip.climate] Auth command sent
2019-04-01 12:58:21 INFO (Thread-13) [custom_components.climate_ip.climate] Response: <?xml version="1.0" encoding="utf-8" ?><Response Type="AuthToken" Status="Okay" StartFrom="1970-01-04/18:12:21"/>
2019-04-01 12:58:21 INFO (Thread-13) [custom_components.climate_ip.climate] Connection authenticated
2019-04-01 12:58:21 INFO (Thread-13) [custom_components.climate_ip.climate] Requesting status with command: <Request Type="DeviceState" DUID="1411E055EA11"></Request>
2019-04-01 12:58:21 INFO (Thread-13) [custom_components.climate_ip.climate] Status request sent
2019-04-01 12:58:33 WARNING (Thread-13) [custom_components.climate_ip.climate] Socket timed out
2019-04-01 12:58:33 INFO (Thread-13) [custom_components.climate_ip.climate] Connection created!
2019-04-01 12:58:33 INFO (Thread-13) [custom_components.climate_ip.climate] Sending command
2019-04-01 12:58:33 INFO (Thread-13) [custom_components.climate_ip.climate] Handling response
2019-04-01 12:58:35 INFO (Thread-13) [custom_components.climate_ip.climate] Response: <?xml version="1.0" encoding="utf-8" ?><Response Type="DeviceState" Status="Okay"><DeviceState><Device DUID="1411E055EA11" GroupID="AC" ModelID="AC" ><Attr ID="AC_FUN_ENABLE" Type="RW" Value="Enable"/><Attr ID="AC_FUN_POWER" Type="RW" Value="On"/><Attr ID="AC_FUN_OPMODE" Type="RW" Value="Heat"/><Attr ID="AC_FUN_TEMPSET" Type="RW" Value="22"/><Attr ID="AC_FUN_COMODE" Type="RW" Value="Off"/><Attr ID="AC_FUN_ERROR" Type="RW" Value="NULL"/><Attr ID="AC_FUN_TEMPNOW" Type="R" Value="22"/><Attr ID="AC_FUN_SLEEP" Type="RW" Value="0"/><Attr ID="AC_FUN_WINDLEVEL" Type="RW" Value="Low"/><Attr ID="AC_FUN_DIRECTION" Type="RW" Value="Fixed"/><Attr ID="AC_ADD_AUTOCLEAN" Type="RW" Value="Off"/><Attr ID="AC_ADD_SETKWH" Type="RW" Value="255"/><Attr ID="AC_ADD_CLEAR_FILTER_ALARM" Type="RW" Value="0"/><Attr ID="AC_ADD_APMODE_END" Type="W" Value="0"/><Attr ID="AC_ADD_STARTWPS" Type="RW" Value="Default"/><Attr ID="AC_ADD_SPI" Type="RW" Value="Off"/><Attr ID="AC_OUTDOOR_TEMP" Type="R" Value="69"/><Attr ID="AC_COOL_CAPABILITY" Type="R" Value="70"/><Attr ID="AC_WARM_CAPABILITY" Type="R" Value="80"/><Attr ID="AC_SG_WIFI" Type="W" Value="Connected"/><Attr ID="AC_SG_INTERNET" Type="W" Value="Disconnected"/><Attr ID="AC_ADD2_USEDWATT" Type="R" Value="65024"/><Attr ID="AC_ADD2_VERSION" Type="RW" Value="65024"/><Attr ID="AC_SG_MACHIGH" Type="W" Value="85"/><Attr ID="AC_SG_MACMID" Type="W" Value="234"/><Attr ID="AC_SG_MACLOW" Type="W" Value="100"/><Attr ID="AC_SG_VENDER01" Type="W" Value="20"/><Attr ID="AC_SG_VENDER02" Type="W" Value="73"/><Attr ID="AC_SG_VENDER03" Type="W" Value="224"/><Attr ID="AC_ADD2_PANEL_VERSION" Type="R" Value="130814"/><Attr ID="AC_ADD2_OUT_VERSION" Type="R" Value="1246985"/><Attr ID="AC_FUN_MODEL" Type="R" Value="6"/><Attr ID="AC_ADD2_OPTIONCODE" Type="R" Value="63162"/><Attr ID="AC_ADD2_USEDPOWER" Type="R" Value="28181"/><Attr ID="AC_ADD2_USEDTIME" Type="R" Value="24380"/><Attr ID="AC_ADD2_CLEAR_POWERTIME" Type="RW" Value="254"/
2019-04-01 12:58:35 ERROR (Thread-13) [custom_components.climate_ip.climate] Sending command failed
File "/home/homeassistant/.homeassistant/custom_components/climate_ip/samsung_2878.py", line 182, in send_socket_command
File "/home/homeassistant/.homeassistant/custom_components/climate_ip/samsung_2878.py", line 167, in handle_socket_response
File "/home/homeassistant/.homeassistant/custom_components/climate_ip/samsung_2878.py", line 154, in handle_response_device_state
2019-04-01 12:58:36 INFO (MainThread) [custom_components.climate_ip.climate] Executing command: None
2019-04-01 12:58:36 INFO (MainThread) [custom_components.climate_ip.climate] Getting socket connection
2019-04-01 12:58:36 INFO (MainThread) [custom_components.climate_ip.climate] Connection invalid, creating!
2019-04-01 12:58:36 INFO (MainThread) [custom_components.climate_ip.climate] Creating ssl context
2019-04-01 12:58:36 INFO (MainThread) [custom_components.climate_ip.climate] Setting up ciphers
2019-04-01 12:58:36 INFO (MainThread) [custom_components.climate_ip.climate] Setting up verify mode
2019-04-01 12:58:36 INFO (MainThread) [custom_components.climate_ip.climate] Setting up verify location: /home/homeassistant/.homeassistant/custom_components/climate_ip/ac14k_m.pem
2019-04-01 12:58:36 INFO (MainThread) [custom_components.climate_ip.climate] Setting up load cert chain: /home/homeassistant/.homeassistant/custom_components/climate_ip/ac14k_m.pem
2019-04-01 12:58:36 INFO (MainThread) [custom_components.climate_ip.climate] Wrapping socket
2019-04-01 12:58:36 INFO (MainThread) [custom_components.climate_ip.climate] Socket wrapped: True
2019-04-01 12:58:36 INFO (MainThread) [custom_components.climate_ip.climate] Connecting with 192.168.1.38:2878
2019-04-01 12:58:36 INFO (MainThread) [custom_components.climate_ip.climate] Response: DPLUG-1.6
2019-04-01 12:58:36 INFO (MainThread) [custom_components.climate_ip.climate] Response: <?xml version="1.0" encoding="utf-8" ?><Update Type="InvalidateAccount"/>
2019-04-01 12:58:36 INFO (MainThread) [custom_components.climate_ip.climate] Sending auth command: <Request Type="AuthToken"><User Token="f11d34c9a-fdd5-1112-8811-1c341111f9dc" /></Request>
2019-04-01 12:58:36 INFO (MainThread) [custom_components.climate_ip.climate] Auth command sent
2019-04-01 12:58:38 INFO (MainThread) [custom_components.climate_ip.climate] Response: <?xml version="1.0" encoding="utf-8" ?><Response Type="AuthToken" Status="Okay" StartFrom="1970-01-04/18:12:39"/>
2019-04-01 12:58:38 INFO (MainThread) [custom_components.climate_ip.climate] Connection authenticated
2019-04-01 12:58:38 INFO (MainThread) [custom_components.climate_ip.climate] Requesting status with command: <Request Type="DeviceState" DUID="1411E055EA11"></Request>
2019-04-01 12:58:38 INFO (MainThread) [custom_components.climate_ip.climate] Status request sent
2019-04-01 12:58:50 WARNING (MainThread) [custom_components.climate_ip.climate] Socket timed out
INFO (MainThread) [custom_components.climate_ip.climate] Connection created!
INFO (MainThread) [custom_components.climate_ip.climate] Command empty, skipping sending
2019-04-01 12:58:52 INFO (MainThread) [custom_components.climate_ip.climate] Executing command: None
2019-04-01 12:58:52 INFO (MainThread) [custom_components.climate_ip.climate] Getting socket connection
2019-04-01 12:58:52 INFO (MainThread) [custom_components.climate_ip.climate] Command empty, skipping sending
2019-04-01 12:58:54 INFO (MainThread) [custom_components.climate_ip.climate] Executing command: None
2019-04-01 12:58:54 INFO (MainThread) [custom_components.climate_ip.climate] Getting socket connection
2019-04-01 12:58:54 INFO (MainThread) [custom_components.climate_ip.climate] Command empty, skipping sending
2019-04-01 12:58:57 INFO (MainThread) [custom_components.climate_ip.climate] Executing command: None
2019-04-01 12:58:57 INFO (MainThread) [custom_components.climate_ip.climate] Getting socket connection
2019-04-01 12:58:57 INFO (MainThread) [custom_components.climate_ip.climate] Command empty, skipping sending

@Jman Thanks for checking, I need to find a way to check this out at home.

Hello,

I’ve do telnet on my air conditionner and is old version, port 2878.
But what the way more easy for get token?

Thank you for help.

@ricain I’m sorry but I cannot help you. I don’t own such device. Maybe @jackdalma, @Modrica or @Jman can help you :wink:

1 Like

@ricain Hi, I used this acdc to get the token.

1 Like

@jackdalma Thank you very much

@SebuZet You are my hero :slight_smile: works fine my two AC, Thank you.

Additional feedback: I can turn on/off my air conditioning with google assistant (hass cloud). but it does not have voice feedback. I mean, when I say “turn on the ar conditioning” it turns on, but the voice feedback is “sorry, there was no response from ar conditioning”

I’m assuming you got ya token for port 2878. Could you please explain how you got this as I’m struggling to get my token.

edit : All good …Finally got the token.

So far works great. one slight issue …is showing currnet temp is 79 C. But on the controller is showing 22 C.

It looks like your device is reporting current temperature in Fahrenheit instead of Celsius.
Try to edit file samsung_2878.yaml in section temperature
Add new line after line #87 (should looks like this: status_template: ‘{% for a in device_state.Response.children.0.DeviceState.Device.children %}{% if a.Attr.attributes.ID == “AC_FUN_TEMPSET” %}{{a.Attr.attributes.Value}}{% endif %}{% endfor %}’)
with content:
unit_template : “F”
Just make sure that number of spaces (not tabs) at the beginning of the line is same as in lines before and after new one. Additionally make sure that letter F is between characters " - sometime editors are changing this character.
Component will convert temp from Fahrenheit to Celsius.

Is this how you meant…

still shows as fahrenheit after i restart H.A

My mistake. If current_temperature is shown in Fahrenheit thena move this line into current_temperature secion :wink:

EDIT: Four lines down :slight_smile:

Ok now I have it like this

still showing fahrenheit. I,ve also noticed that H.A not updating status of aircon. Gives correct status on restart but any state changes after ,status not change.