@SebuZet there are progress but there is another error:
2019-03-15 16:15:01 INFO (MainThread) [custom_components.climate_ip.climate] climate_ip: async setup platform
2019-03-15 16:15:04 ERROR (MainThread) [custom_components.climate_ip.climate] Socket error
2019-03-15 16:15:04 ERROR (MainThread) [custom_components.climate_ip.climate] climate_ip: error while creating controller!
2019-03-15 16:15:04 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform climate_ip
Traceback (most recent call last):
File "/home/homeassistant/.homeassistant/custom_components/climate_ip/samsung_2878.py", line 154, in execute
sslSocket.sendall(message.encode('utf-8'))
File "/usr/lib/python3.5/ssl.py", line 903, in sendall
return socket.sendall(self, data, flags)
OSError: [Errno 9] Bad file descriptor
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
return fut.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
result = coro.send(None)
File "/home/homeassistant/.homeassistant/custom_components/climate_ip/climate.py", line 75, in async_setup_platform
device_controller = create_controller('yaml', config, _LOGGER)
File "/home/homeassistant/.homeassistant/custom_components/climate_ip/controller.py", line 58, in create_controller
if c.initialize():
File "/home/homeassistant/.homeassistant/custom_components/climate_ip/controller_yaml.py", line 125, in initialize
self.update_state()
File "/home/homeassistant/.homeassistant/custom_components/climate_ip/controller_yaml.py", line 155, in update_state
self._state_getter.update_state(self._state_getter.value, debug)
File "/home/homeassistant/.homeassistant/custom_components/climate_ip/samsung_2878.py", line 190, in update_state
device_state = conn.execute(self._connection_template, None)
File "/home/homeassistant/.homeassistant/custom_components/climate_ip/samsung_2878.py", line 162, in execute
sslSocket.shutdown(SHUT_RDWR)
File "/usr/lib/python3.5/ssl.py", line 975, in shutdown
socket.shutdown(self, how)
OSError: [Errno 9] Bad file descriptor
@jackdalma Can you paste your xml (status response)? You can add entry debug: true in configuration.yaml and check it is dev-panel or use script.
What functionality is missing?
@jackdalma You can edit file samsung_2878.yaml and modify as you want.
Good point to start is removing line validate_properties: True
Generally, you can add any functionality supported by your unit by editing this file.
You should be able to change defined by you options using service climate.climate_ip_samsungac_set_property with proper params
edit: which file are you using samsung_2878.yaml or the old one samsung_2878_2.yaml
@SebuZet I’m using samsung_2878.yaml
removed the validate_properties: True and now showing all the function at least on the dev panel.
but on the card still missing purify - auto_clean - specialwind.
the attributes will auto-update after a while or only after sending a command?
Let’s start from the beginning: HA by default supports only:
power on/off
operation mode (cool, heat, fan_only, auto etc)
swing mode (up_down, left_right etc)
fan speed
set/get target temp
set/get target max temp
set/get target min temp
get current temp
Only those functions will be available from card.
If you want more options you need to define them in YAML file. I’ve added few extra options (using @jackdalma status xml) and you can see them in dev-panel.
You can remove or modify them freely or you can add new one.
If you want to have Purify switch you have to add proper switch template in HA and use service mentioned by me few posts above. You can find an example in readme in master branch.
Attributes will be updated after changing something. I can add pooling if it is needed.
Can you try latest version? Now, component is working on already created connection. Last version was opening socket connection every time when status was updated or command executed.
I’ve noticed that looking at you xml but I don’t think I can do something with that. Generally, I’ll add ‘temperature_unit’ into component configuration but it will have impact to all temp values.
If your device is not consistent then approach with customizing template is the best in my opinion. That’s why I’ve used templates - to make customization easy.
I just checked your last commit. If I could suggest an enhancement to your execute method, you could test the socket with an AuthToken request before sending the command. EG: send
if the socket is dead it should throw an exception and you can reconnect. If you get a response you can validate the token by checking for Status=Okay.
Latest dev version broke something on my AC: 2019-03-18 10:26:14 ERROR (MainThread) [custom_components.climate_ip.climate] Socket error
File "/usr/local/lib/python3.7/site-packages/homeassistant/components/climate/__init__.py", line 216, in state_attributes
self.precision),
File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/temperature.py", line 26, in display_temp
temperature, temperature_unit, ha_unit)
File "/usr/local/lib/python3.7/site-packages/homeassistant/util/temperature.py", line 25, in convert
from_unit, TEMPERATURE))
ValueError: None is not a recognized temperature unit.
2019-03-18 10:25:44 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 352, in _async_add_entity
await entity.async_update_ha_state()
File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 225, in async_update_ha_state
self._async_write_ha_state()
File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 255, in _async_write_ha_state
attr = self.state_attributes or {}
File "/usr/local/lib/python3.7/site-packages/homeassistant/components/climate/__init__.py", line 216, in state_attributes