I get the same result.
Im pretty sure this should be using port 2000 not 80.
I’m going to take a moment here to publicly commend @fredrike for his extreme patience, persistence and skill in sorting this platform integration out.
Great work @fredrike!!!
For those wanting to see the latest version of the Daikin integration which incorporates SkyFi it is currently on the dev branch and working well. Presumably you could install it as a custom component and it will show up after a FULL hassio restart.
The SkyFi module is sensitive to everything, command order, http sessions, latency, you name it. As an early IOT device, I guess it is fair to say that it (SkyFi) solved the initial problem well enough, but by todays standards it is shall we say behind the times.
The SkyFi module is a Roving Networks RN171, essentially a customisable serial to network/web converter, it is also known as WiFly. If anyone feels the need to try and dig into the firmware, it is likely reasonably easy to break into and code adjusted: http://ww1.microchip.com/downloads/en/DeviceDoc/50002230B.pdf
A sincere thank you to @fredrike and everyone else who has contributed toward getting the SkyFi (BRP15A61) integration working
I’ve been running some very spaghetti-like node-red to automate my Daikin SkyFi system for a few years, and am now working to convert this to Home Assistant.
The most useful reference for SkiFi commands that I have found is this one; https://github.com/pabloNZ/DaikinSkyFiNZ/blob/826ad0f82e6c768bfe23bf695bcaeac85754a138/SkyFi%20http.txt , which will refer to below. I have found a few issues with this integration as follows:
-
On these systems, the “auto” fan mode is in addition to the fan speed, not an alturnate to the fan speed (lines 19 to 32 of the link refers). In my node-red spaghetti when I send power on or off (/set.cgi?pass=XXXXX&p=1 or 0), the fan auto setting is retained at the previous state. When I use this integration to power off and then power on, fan auto is always set off. I notice that when my air con is running at “MED/AUTO” the reported state on the States page is “fan_mode: Medium”, which isn’t completely right. Fan auto state is idenitfyable from the “fanflags” attribute from the /ac.cgi or /set.cgi response.
-
Only the first two of my three zones have been recognised (lines 72 to 85). The output of my /zones.cgi?pass=XXXXX is “nz=3&zone1=Lounge&zone2=Guest%20Room&zone3=Spare%20Room”, but a switch has not been created for the last zone. I’m not sure if there is a way to refresh the zone detection?
-
The zone switches always show “off”, even with the zone on. When I toggle the zone switch on, it reverts to off within a few seconds. The log details are as follows:
Logger: homeassistant.core
Source: deps/lib/python3.8/site-packages/pydaikin/daikin_base.py:157
First occurred: 7:49:24 PM (1 occurrences)
Last logged: 7:49:24 PM
Error executing service: <ServiceCall climate.set_hvac_mode (c:a86ffc4b785d4a089aa7852247e4f22e): entity_id=['climate.daikin_ac'], hvac_mode=heat>
Traceback (most recent call last):
File "/home/homeassistant/.pyenv/versions/3.8.0/lib/python3.8/site-packages/homeassistant/core.py", line 1269, in catch_exceptions
await coro_or_task
File "/home/homeassistant/.pyenv/versions/3.8.0/lib/python3.8/site-packages/homeassistant/core.py", line 1288, in _execute_service
await handler.func(service_call)
File "/home/homeassistant/.pyenv/versions/3.8.0/lib/python3.8/site-packages/homeassistant/helpers/entity_component.py", line 212, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/home/homeassistant/.pyenv/versions/3.8.0/lib/python3.8/site-packages/homeassistant/helpers/service.py", line 453, in entity_service_call
future.result() # pop exception if have
File "/home/homeassistant/.pyenv/versions/3.8.0/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 597, in async_request_call
await coro
File "/home/homeassistant/.pyenv/versions/3.8.0/lib/python3.8/site-packages/homeassistant/helpers/service.py", line 484, in _handle_entity_call
await result
File "/home/homeassistant/.pyenv/versions/3.8.0/lib/python3.8/site-packages/homeassistant/components/daikin/climate.py", line 192, in async_set_hvac_mode
await self._set({ATTR_HVAC_MODE: hvac_mode})
File "/home/homeassistant/.pyenv/versions/3.8.0/lib/python3.8/site-packages/homeassistant/components/daikin/climate.py", line 138, in _set
await self._api.device.set(values)
File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.8/site-packages/pydaikin/daikin_skyfi.py", line 141, in set
await self.update_status([query_c])
File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.8/site-packages/pydaikin/daikin_base.py", line 168, in update_status
self.values.update(await self._get_resource(resource))
File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.8/site-packages/pydaikin/daikin_base.py", line 144, in _get_resource
return await self._run_get_resource(resource)
File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.8/site-packages/pydaikin/daikin_skyfi.py", line 99, in _run_get_resource
return await super()._run_get_resource(resource)
File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.8/site-packages/pydaikin/daikin_base.py", line 157, in _run_get_resource
return self.parse_response(await resp.text())
File "/home/homeassistant/.pyenv/versions/3.8.0/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 1009, in text
await self.read()
File "/home/homeassistant/.pyenv/versions/3.8.0/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 973, in read
self._body = await self.content.read()
File "/home/homeassistant/.pyenv/versions/3.8.0/lib/python3.8/site-packages/aiohttp/streams.py", line 358, in read
block = await self.readany()
File "/home/homeassistant/.pyenv/versions/3.8.0/lib/python3.8/site-packages/aiohttp/streams.py", line 380, in readany
await self._wait('readany')
File "/home/homeassistant/.pyenv/versions/3.8.0/lib/python3.8/site-packages/aiohttp/streams.py", line 296, in _wait
await waiter
File "/home/homeassistant/.pyenv/versions/3.8.0/lib/python3.8/site-packages/aiohttp/helpers.py", line 586, in __exit__
raise asyncio.TimeoutError from None
asyncio.exceptions.TimeoutError
- My logs are filled with updates failing or taking too long. I understand the connectivity of these units is flakey despite a decent signal strength, indeed a lot of my node-red spaghetti involves catching errors or re-sending if the state fails to change. In my experimentation I found the polling interval sweet-spot to be 20 seconds; more frequently and the device gets overloaded, less frequently and it seems to go to sleep. It definately cannot queue commands.
I’m very new to Home Assistant, so will not be surprised if there is something I have missed at my end. Now that I have this up and running, I would be pleased to do what I can to help test and troubleshoot to get this integration working as best we can.
Oh that seems complex… Could you send me a couple of examples?
edit, are you referring to: SkyFi http.txt#L34-L49 ? Home-Assistant only support a few modes: const.py#L25-L33. Or are you talking about more fan-modes?
edit2, I think you mean fan-rate and I’ve added a suggestion here: Bitbucket
It’s clearly a bug. The zone code have not been tested and is built from the information I found on the whirlpool forum.
edit, found the issue and updated the code @ Bitbucket
That log is just an example of timeout when setting mode to your unit. Do you always get that kind of log?
edit, found the issue and updated the code @ Bitbucket
Could you please paste some of the logs, I do retry five times with a slight delay between. But we probably should lower the logging. The updates take place every 60 seconds and that is currently not configurable.
I’m having trouble getting this integration working again after upgrade to your latest commit.
I’m running Home Assistant Core dev branch on DietPi. I tried switching to the python env and did pip3 list, but pydiakin wasn’t listed. So I just downloaded your BitBucket repository, and swapped in the latest versions of pydiakin, diakin_base.py and diakin_skyfi.py .
This resulted in the error:
Logger: homeassistant.components.daikin
Source: components/daikin/__init__.py:64
Integration: Daikin AC (documentation, issues)
First occurred: 2:46:11 PM (1 occurrences)
Last logged: 2:46:11 PM
Unexpected error creating device 192.168.1.10
I next tried entering the Python environment and upgrading to the latest version of the dev branch using pip3 install --upgrade git+git://github.com/home-assistant/home-assistant.git@dev
. This didn’t work either.
Thinking I probably messed this up myself, I then reverted to my last backup (without HA installed), and reinstalled Home Assistant Core dev branch from scratch.
Now I am getting an “unexpected error” installing the Diakin AC integration. Log output is as follows:
Logger: homeassistant.components.daikin.config_flow
Source: deps/lib/python3.8/site-packages/pydaikin/daikin_skyfi.py:92
Integration: Daikin AC (documentation, issues)
First occurred: 8:23:54 PM (1 occurrences)
Last logged: 8:23:54 PM
Unexpected error creating device
Traceback (most recent call last):
File "/home/homeassistant/.pyenv/versions/3.8.0/lib/python3.8/site-packages/homeassistant/components/daikin/config_flow.py", line 72, in _create_device
device = await Appliance.factory(
File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.8/site-packages/pydaikin/daikin_base.py", line 78, in factory
await appl.init()
File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.8/site-packages/pydaikin/daikin_skyfi.py", line 67, in init
await self.update_status(self.HTTP_RESOURCES)
File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.8/site-packages/pydaikin/daikin_base.py", line 168, in update_status
self.values.update(await self._get_resource(resource))
File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.8/site-packages/pydaikin/daikin_base.py", line 144, in _get_resource
return await self._run_get_resource(resource)
File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.8/site-packages/pydaikin/daikin_skyfi.py", line 107, in _run_get_resource
return await super()._run_get_resource(resource)
File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.8/site-packages/pydaikin/daikin_base.py", line 157, in _run_get_resource
return self.parse_response(await resp.text())
File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.8/site-packages/pydaikin/daikin_skyfi.py", line 92, in parse_response
if response['fanflags'] == '3':
KeyError: 'fanflags'
Not sure if this a new bug in the integration, or if there something else amiss at my end? Any advise as to the smartest way to upgrade the integration only would be appreciated too.
It looks like an error from my side:
I’ve updated the code so if you replace the file /mnt/dietpi_userdata/homeassistant/deps/lib/python3.8/site-packages/pydaikin/daikin_skyfi.py
with this one: https://bitbucket.org/mustang51/pydaikin/src/28302e6e5418488c600f10674e66f57a6db53d96/pydaikin/daikin_skyfi.py it should work (I made a stupid mistake in the parsing of the response).
That was simple enough to update, thanks.
Issue #1 appears solved; fanauto state is now retained when I toggle power off/on.
Issue #2; I’ve now only got the first of my three zones recognised with a switch created.
Issue #3; no change, but I agree the log previously provided was coincidental and not associated with toggling the switch.
Issue #4; error frequency seems reduced now. The most common error is:
Log Details (WARNING)
Logger: homeassistant.helpers.entity
Source: __main__.py:356
First occurred: 7:58:25 PM (5 occurrences)
Last logged: 8:09:37 PM
Update of sensor.daikin_ac_inside_temperature is taking over 10 seconds
Update of climate.daikin_ac is taking over 10 seconds
Not sure if there is much that can be done about that other than increasing the timeout?
I’ve had a database crash (after not paying attention to the size of it…) and the Daikin Integration wouldn’t work. So I figured simply deleting and re-adding would fix it, however it will not let me re-add:
Log entry:
2020-05-27 08:56:33 ERROR (MainThread) [homeassistant.components.daikin.config_flow] Unexpected error creating device
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/daikin/config_flow.py", line 77, in _create_device
password=password,
File "/usr/local/lib/python3.7/site-packages/pydaikin/daikin_base.py", line 78, in factory
await appl.init()
File "/usr/local/lib/python3.7/site-packages/pydaikin/daikin_skyfi.py", line 67, in init
await self.update_status(self.HTTP_RESOURCES)
File "/usr/local/lib/python3.7/site-packages/pydaikin/daikin_base.py", line 168, in update_status
self.values.update(await self._get_resource(resource))
File "/usr/local/lib/python3.7/site-packages/pydaikin/daikin_base.py", line 144, in _get_resource
return await self._run_get_resource(resource)
File "/usr/local/lib/python3.7/site-packages/pydaikin/daikin_skyfi.py", line 107, in _run_get_resource
return await super()._run_get_resource(resource)
File "/usr/local/lib/python3.7/site-packages/pydaikin/daikin_base.py", line 157, in _run_get_resource
return self.parse_response(await resp.text())
File "/usr/local/lib/python3.7/site-packages/pydaikin/daikin_skyfi.py", line 92, in parse_response
if response['fanflags'] == '3':
KeyError: 'fanflags'
Ah ha!
helping a mate brand new to HA setup - and he has a original SkyFi for his Daikin and we tried to setup it and got the same error it seems… He is currently on 1.110.3
File "/usr/local/lib/python3.7/site-packages/pydaikin/daikin_skyfi.py", line 92, in parse_response
if response['fanflags'] == '3':
KeyError: 'fanflags'
Initially was wondering if this old SkyFi was even support but i think it should be?
Thoughts for this error now?
This basics are/were definitely working, I’d suspect this is part of getting the zone controller integration right. As I don’t have zone controllers, I couldn’t help with testing of that part.
@Borgy, @markss: While trying to add support for more fanmodes as suggested in #169 I actually broke the integration. The fix is already in pydaikin #173 but I couldn’t get the changes into 0.110.4 (Bump pydaikin version to 2.1.0 by fredrike · Pull Request #36217 · home-assistant/core · GitHub).
There exists two options, either downgrade to 0.110.0 or replace /usr/local/lib/python3.7/site-packages/pydaikin/daikin_skyfi.py
with this one: Bitbucket.
The real fix will show up in 0.111.0…
@fredrike and @markss - Sorry I haven’t been able to help out more I have been out of the loop for a while. @fredrike has done a great job integrating skyfi into HA. Well done.
Hats Off to Great Work!
By any chance, could someone please help me with a step by step instruction on how to do this integration to HA? Thanks in advance.
Thanks Mark, I have tried to do the integration already, unfortunately I get the unexpected error message for some reason and I though I might be missing a prerequisite for this to work. Currently I control my skyfi module using command line switches, it is bit of a pain but works most of the time.
@sajesh it sucks that this is one of those “it just works for me” moments, so the best I can do is get you to confirm
- exactly which version of HomeAssistant you are on
- check the logs “Developer Tools - Logs - Load Full Log” (after trying to add integration)
Hi @markss
Thanks to all who have worked on making this plugin work with SkyFi!
I’ve just added my IP address and password to the integration, and it found my SkyFi unit, but only identified one of my four zones as a switch. No other zones have been identified as an entity (similar to @denis.french). However, I am running HA version 0.111.4, which if I’m reading the posts above, should have resolved the zone issue?
Hey @stibbzy it certainly seems like you have the same problem as denis.
When I did the testing with @fredrike I was never able to help him with the fan controller piece because mine is a dumb 3 push button unit.
Fredrike - might it be easier to ask the user if they have a smart zone controller, and how many zones they have and then use this:
https://whrl.pl/RerHze
Thanks @markss. @fredrike For what it’s worth, I’ve got a Daikin BRC24Z4A zone controller. I’ve actually had full zone control and aircon control working through a plugin for a Vera home controller plugin. With the Vera plugin, though, the unit often went unresponsive for unknown reasons.
Hi @stibbzy; I’m pretty sure v0.111 fixed a detection/logon issue for SkyFi, but the zone handling still needed work at that time.
I can see recent commits within the underlying library that look promising (https://bitbucket.org/mustang51/pydaikin/commits/); @fredrike please let us know when this gets merged into dev, and I’ll give it a go on my system.