Thanks. That’s strange. Which python version are you using?
I’ve modified code to meet re library syntax in python 3.5.
Let me know if this is working in your environment.
should be python 3.5
new log:
2019-04-23 10:31:48 INFO (MainThread) [custom_components.climate_ip.climate] climate_ip: async setup platform
2019-04-23 10:31:48 INFO (MainThread) [custom_components.climate_ip.climate] Loading configuration file: /home/homeassistant/.homeassistant/custom_components/climate_ip/samsung_2878.yaml
2019-04-23 10:31:48 INFO (MainThread) [custom_components.climate_ip.climate] ip_address: 192.168.18.18
2019-04-23 10:31:48 INFO (MainThread) [custom_components.climate_ip.climate] token: TOKEN
2019-04-23 10:31:48 INFO (MainThread) [custom_components.climate_ip.climate] Validate properties: False (False)
2019-04-23 10:31:48 INFO (MainThread) [custom_components.climate_ip.climate] Configuration, host: 192.168.18.18:2878
2019-04-23 10:31:48 INFO (MainThread) [custom_components.climate_ip.climate] Configuration, token: TOKEN
2019-04-23 10:31:48 INFO (MainThread) [custom_components.climate_ip.climate] Configuration, duid: DUID
2019-04-23 10:31:48 INFO (MainThread) [custom_components.climate_ip.climate] Configuration, cert: /home/homeassistant/.homeassistant/custom_components/climate_ip/ac14k_m.pem
2019-04-23 10:31:48 INFO (MainThread) [custom_components.climate_ip.climate] Executing params: {'duid': 'DUID', 'host': '192.168.18.18', 'token': 'TOKEN', 'connection_template': '<Request Type="AuthToken"><User Token="{{token}}" /></Request>', 'value': None}
2019-04-23 10:31:48 INFO (MainThread) [custom_components.climate_ip.climate] Executing command: <Request Type="DeviceState" DUID="DUID"></Request>
2019-04-23 10:31:48 INFO (MainThread) [custom_components.climate_ip.climate] Getting socket connection
2019-04-23 10:31:48 INFO (MainThread) [custom_components.climate_ip.climate] Connection invalid, creating!
2019-04-23 10:31:48 INFO (MainThread) [custom_components.climate_ip.climate] Creating ssl context
2019-04-23 10:31:48 INFO (MainThread) [custom_components.climate_ip.climate] Setting up ciphers
2019-04-23 10:31:48 INFO (MainThread) [custom_components.climate_ip.climate] Setting up verify mode
2019-04-23 10:31:48 INFO (MainThread) [custom_components.climate_ip.climate] Setting up verify location: /home/homeassistant/.homeassistant/custom_components/climate_ip/ac14k_m.pem
2019-04-23 10:31:48 INFO (MainThread) [custom_components.climate_ip.climate] Setting up load cert chain: /home/homeassistant/.homeassistant/custom_components/climate_ip/ac14k_m.pem
2019-04-23 10:31:48 INFO (MainThread) [custom_components.climate_ip.climate] Wrapping socket
2019-04-23 10:31:48 INFO (MainThread) [custom_components.climate_ip.climate] Socket wrapped: True
2019-04-23 10:31:48 INFO (MainThread) [custom_components.climate_ip.climate] Connecting with 192.168.18.18:2878
2019-04-23 10:31:49 INFO (MainThread) [custom_components.climate_ip.climate] Response: DPLUG-1.6
2019-04-23 10:31:49 INFO (MainThread) [custom_components.climate_ip.climate] Response: <?xml version="1.0" encoding="utf-8" ?><Update Type="InvalidateAccount"/>
2019-04-23 10:31:49 INFO (MainThread) [custom_components.climate_ip.climate] Sending auth command: <Request Type="AuthToken"><User Token="TOKEN" /></Request>
2019-04-23 10:31:49 INFO (MainThread) [custom_components.climate_ip.climate] Auth command sent
2019-04-23 10:31:51 WARNING (MainThread) [custom_components.climate_ip.climate] Socket timed out
2019-04-23 10:31:51 INFO (MainThread) [custom_components.climate_ip.climate] Sending command
2019-04-23 10:31:51 INFO (MainThread) [custom_components.climate_ip.climate] Handling socket response
2019-04-23 10:31:51 INFO (MainThread) [custom_components.climate_ip.climate] Response: <?xml version="1.0" encoding="utf-8" ?><Response Type="AuthToken" Status="Okay" StartFrom="2019-04-23/08:31:51"/>
2019-04-23 10:31:51 INFO (MainThread) [custom_components.climate_ip.climate] Connection authenticated
2019-04-23 10:31:51 INFO (MainThread) [custom_components.climate_ip.climate] Requesting status with command: <Request Type="DeviceState" DUID="DUID"></Request>
2019-04-23 10:31:51 INFO (MainThread) [custom_components.climate_ip.climate] Status request sent
2019-04-23 10:31:53 WARNING (MainThread) [custom_components.climate_ip.climate] Socket timed out
2019-04-23 10:31:53 INFO (MainThread) [custom_components.climate_ip.climate] Handling finished
2019-04-23 10:31:54 INFO (MainThread) [custom_components.climate_ip.climate] Executing params: {'host': '192.168.18.18', 'token': 'TOKEN', 'connection_template': '<Request Type="AuthToken"><User Token="{{token}}" /></Request>', 'duid': 'DUID', 'value': None}
2019-04-23 10:31:54 INFO (MainThread) [custom_components.climate_ip.climate] Executing command: <Request Type="DeviceState" DUID="DUID"></Request>
2019-04-23 10:31:54 INFO (MainThread) [custom_components.climate_ip.climate] Getting socket connection
2019-04-23 10:31:54 INFO (MainThread) [custom_components.climate_ip.climate] Sending command
2019-04-23 10:31:54 INFO (MainThread) [custom_components.climate_ip.climate] Handling socket response
2019-04-23 10:31:54 INFO (MainThread) [custom_components.climate_ip.climate] Response: <?xml version="1.0" encoding="utf-8" ?><Response Type="DeviceState" Status="Okay"><DeviceState><Device DUID="DUID" GroupID="AC" ModelID="AC" ><Attr ID="AC_FUN_ENABLE" Type="RW" Value="Enable"/><Attr ID="AC_FUN_POWER" Type="RW" Value="Off"/><Attr ID="AC_FUN_OPMODE" Type="RW" Value="Auto"/><Attr ID="AC_FUN_TEMPSET" Type="RW" Value="26"/><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="21"/><Attr ID="AC_FUN_SLEEP" Type="RW" Value="0"/><Attr ID="AC_FUN_WINDLEVEL" Type="RW" Value="Auto"/><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="72"/><Attr ID="AC_COOL_CAPABILITY" Type="R" Value="35"/><Attr ID="AC_WARM_CAPABILITY" Type="R" Value="40"/><Attr ID="AC_SG_WIFI" Type="W" Value="Connected"/><Attr ID="AC_SG_INTERNET" Type="W" Value="Connected"/><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="183"/><Attr ID="AC_SG_MACMID" Type="W" Value="161"/><Attr ID="AC_SG_MACLOW" Type="W" Value="253"/><Attr ID="AC_SG_VENDER01" Type="W" Value="188"/><Attr ID="AC_SG_VENDER02" Type="W" Value="140"/><Attr ID="AC_SG_VENDER03" Type="W" Value="205"/><Attr ID="AC_ADD2_PANEL_VERSION" Type="R" Value="140315"/><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="54458"/><Attr ID="AC_ADD2_USEDPOWER" Type="R" Value="2060"/><Attr ID="AC_ADD2_USEDTIME" Type="R" Value="2440"/><Attr ID="AC_ADD2_CLEAR_POWERTIME" Type="RW" Value="254"/><Attr ID="AC_ADD2_FILTERTIME" Type="RW" Value="500"/><Attr ID="AC_ADD2_FILTER_USE_TIME" Type="R" Value="2440"/></Device></DeviceState></Response>
2019-04-23 10:31:56 WARNING (MainThread) [custom_components.climate_ip.climate] Socket timed out
Looks good, is it working?
yeah, no error. just some “socket time out”
poll is set to true but wont update.
@jackdalma try this version. https://github.com/SebuZet/samsungrac/tree/e5131f482df2c39ab435cf62ec29122fad498bfa
I’m using this one at the moment and the polling / update works. I just can’t change from farenhiet to celsius.
The latest on master branch does not work for me.
@joelFORCE Did you try the latest version from today?
It works fine for @jackdalma
If it is not working please provide some logs.
@joelFORCE @SebuZet
yeah, with last version everything works fine here.
good job and thank you SebuZet.
@jackdalma @SebuZet
Righto that seems to be working good so far and I now have temp in celsuis.
I’ll keep testing it and give feedback. Once again @SebuZet excelent work.
Wow just noticed that my temp seems to be spot on with controller instead of being 3 degrees higher.
You’re a champion
You welcome
@SebuZet All seems to be working great so far. I still have a slight probloem with temps. It seems AC_FUN_TEMPNOW returns the value for the sensor in the indoor unit. Is there a way to get the temp value from the controller instead. The android app for the aircon seems to return the value from the controller not the indoor unit. The indoor unit temps are higher than the controller unit especially when temps are lower ( cool). So for example my controller unit is showing 22 C , the android app is showing 22 C and Home Assistant is showing 25 C. Aircon temp is set to 22 C.
Any help would be appreciated.
Cheers again !
@joelFORCE Can you please turn debugs on and send me attribute called device_state from dev-panel? I need to see what attributes are returned by your device.
@joelFORCE According to your device status your device doesn’t support special_mode nor swing_mode. You can remove those entries from YAML file. Device status will be more clear.
Other devices have more attributes, one of them is called “AC_OUTDOOR_TEMP” - this is an outdoor temperature. I have no idea where the android app is getting readings from.
You can grab logs from the component to see what is returned by your device (raw xml data).
turn debugs on and look for logs like the one below:
[custom_components.climate_ip.climate] Response: <?xml version=“1.0” encoding=“utf-8” ?><Response Type=“DeviceState” Status=“Okay”><DeviceState><Device DUID=“DUID” GroupID=“AC” ModelID=“AC” ><Attr ID=“AC_FUN_ENABLE” Type=“RW” Value=“Enable”/><Attr ID=“AC_FUN_POWER” Type=“RW” Value=“Off”/><Attr ID=“AC_FUN_OPMODE” Type=“RW” Value=“Auto”/><Attr ID=“AC_FUN_TEMPSET” Type=“RW” Value=“26”/><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=“21”/><Attr ID=“AC_FUN_SLEEP” Type=“RW” Value=“0”/><Attr ID=“AC_FUN_WINDLEVEL” Type=“RW” Value=“Auto”/><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=“72”/><Attr ID=“AC_COOL_CAPABILITY” Type=“R” Value=“35”/><Attr ID=“AC_WARM_CAPABILITY” Type=“R” Value=“40”/><Attr ID=“AC_SG_WIFI” Type=“W” Value=“Connected”/><Attr ID=“AC_SG_INTERNET” Type=“W” Value=“Connected”/><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=“183”/><Attr ID=“AC_SG_MACMID” Type=“W” Value=“161”/><Attr ID=“AC_SG_MACLOW” Type=“W” Value=“253”/><Attr ID=“AC_SG_VENDER01” Type=“W” Value=“188”/><Attr ID=“AC_SG_VENDER02” Type=“W” Value=“140”/><Attr ID=“AC_SG_VENDER03” Type=“W” Value=“205”/><Attr ID=“AC_ADD2_PANEL_VERSION” Type=“R” Value=“140315”/><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=“54458”/><Attr ID=“AC_ADD2_USEDPOWER” Type=“R” Value=“2060”/><Attr ID=“AC_ADD2_USEDTIME” Type=“R” Value=“2440”/><Attr ID=“AC_ADD2_CLEAR_POWERTIME” Type=“RW” Value=“254”/><Attr ID=“AC_ADD2_FILTERTIME” Type=“RW” Value=“500”/><Attr ID=“AC_ADD2_FILTER_USE_TIME” Type=“R” Value=“2440”/></Device></DeviceState></Response>
Generally the log message will starts with:
[custom_components.climate_ip.climate] Response: <?xml version=“1.0” encoding=“utf-8” ?><Response Type=“DeviceState” Status=“Okay”><DeviceState>…
The one I show above is from jackdalama’s device. There is a lot of attributes.
@SebuZet can’t seem to find any logs like above. Debug is on. Unless I’m looking in wrong spot( Looking through home assistant log).
Also is there a way to replace the current temp data from the AC with data from a different temp sensor in Home Assistant?
Cheers
@SebuZet do you know if any recent modification could affect “current temperature” read? I’ve cloned the recent version from repo one week ago, and now I’m observing that “current temperature” is behaving a little bit different, only updating when the AC is turned on.
I don’t use HASS.IO so I have no idea where regular logs are kept.
I supposed You have to use generic thermostat template.
If you are using new gen devices this is the way how, at least my device, they are working. My device is returning last state before turning this off. There were no changes that could break this functionality.
The only difference is that from last few versions, polling is turned off for new gen device. You can enable this in config section.
You do know, that you can easily pull all changes from the original repo into your fork with just one PullRequest? Sorry, if this was clear, just wanted to mention.
EDIT:
Just in case anyone is interested, this is how you would pull changes into your fork:
Go to your repository with the fork (in my case I forked HA)
You see, my fork is 759 commits behind the original (last line in the pic). In this last line click on “Pull Request”. You should see this:
Click on switching the base
, you should see something like this:
If you click on Create pull request
all changes since your fork are pulled from the original repository and are merged into your fork. So you are up to date with the original, but can keep your changes. If something should interfere (your changes against other changes in the original), you will be presented with a comparison and can decide, which version you want to keep.
Hope that helps!