Custom component for iZone air conditioner

I’ve created a custom component for the iZone air conditioning system. I believe this is mostly available in West Australia.

I would value anyone helping me testing it / suggesting any improvements.

Also posted this on reddit which might be a better place to post replies.

3 Likes

Howdy! I’m getting iZone 325 (I think) installed in early February in ACT, would be glad to give this a whirl and help out :slight_smile:

Awesome!

Here’s the repo for the library.

And here’s the repo for the custom component.

Hi
I would like to use this component but it is bombing out with

Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py”, line 1147, in _safe_execute
await self._execute_service(handler, service_call)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py”, line 1160, in _execute_service
await handler.func(service_call)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/init.py”, line 129, in async_handle_core_service
errors = await conf_util.async_check_ha_config_file(hass)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/config.py”, line 785, in async_check_ha_config_file
check_ha_config_file, hass)
File “/usr/lib/python3.5/asyncio/futures.py”, line 380, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.5/asyncio/tasks.py”, line 304, in _wakeup
future.result()
File “/usr/lib/python3.5/asyncio/futures.py”, line 293, in result
raise self._exception
File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/scripts/check_config.py”, line 332, in check_ha_config_file
component = loader.get_component(hass, domain)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/loader.py”, line 131, in get_component
comp = _load_file(hass, comp_or_platform, LOOKUP_PATHS)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/loader.py”, line 166, in _load_file
module = importlib.import_module(path)
File “/usr/lib/python3.5/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 986, in _gcd_import
File “”, line 969, in _find_and_load
File “”, line 958, in _find_and_load_unlocked
File “”, line 673, in _load_unlocked
File “”, line 673, in exec_module
File “”, line 222, in _call_with_frames_removed
File “/home/homeassistant/.homeassistant/custom_components/izone/init.py”, line 20, in
from .discovery import (
File “/home/homeassistant/.homeassistant/custom_components/izone/discovery.py”, line 25
self.controllers: Dict[str, pizone.Controller] = {}
^
SyntaxError: invalid syntax

Can anyone give me a direction on that one. Ta.

That’s an issue with python 3.5. You can upgrade to a newer python on whatever you run homeassistant on.

The default install for HA is moving to 3.6 very soon.

im stuck, any ideas D:

Fri Aug 09 2019 23:27:26 GMT+0800 (Australian Western Standard Time)
Error loading custom_components.izone. Make sure all dependencies are installed
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 355, in _load_file
    module = importlib.import_module(path)
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/config/custom_components/izone/__init__.py", line 20, in <module>
    from .discovery import (
  File "/config/custom_components/izone/discovery.py", line 11, in <module>
    from .climate import ControllerDevice
  File "/config/custom_components/izone/climate.py", line 11, in <module>
    from homeassistant.components.climate.const import (
ImportError: cannot import name 'STATE_AUTO' from 'homeassistant.components.climate.const' (/usr/src/homeassistant/homeassistant/components/climate/const.py)

Hi,

I’m in the process of getting iZone in as part of the core HA. The PR is here, you can get the code out of the PR and put in in a custom components directory if you want to, or install the custom component in an older version (I think about 0.94).

1 Like

Thanks for the response, tried without to no avail.
Will wait for the release :slight_smile:

Hi There,

Anyone able to help me out with this?

I’ve added izone: to my configuration yaml - restarted and I don’t see anything

Have enabled the debug logs and get:

2019-12-13 00:02:17 DEBUG (MainThread) [pizone.discovery] Datagram Recieved b'ASPort_12107,Mac_000025998,IP_192.168.10.99,iZoneV2,iLight,iDrate'
2019-12-13 00:02:24 DEBUG (MainThread) [pizone.discovery] Datagram Recieved b'iZoneChanged_System'
2019-12-13 00:02:24 DEBUG (MainThread) [pizone.discovery] Datagram Recieved b'iZoneChanged_Zones'
2019-12-13 00:02:25 DEBUG (MainThread) [pizone.discovery] Datagram Recieved b'iZoneChanged_Schedules'
2019-12-13 00:03:26 DEBUG (MainThread) [pizone.discovery] Datagram Recieved b'iZoneChanged_System'
2019-12-13 00:03:27 DEBUG (MainThread) [pizone.discovery] Datagram Recieved b'iZoneChanged_Zones'
2019-12-13 00:03:27 DEBUG (MainThread) [pizone.discovery] Datagram Recieved b'iZoneChanged_Schedules'

So it seems to be finding it, I just don’t see it in HA anywhere.

Any pointers would be appreciated.

System Details below:

arch x86_64
dev false
docker false
hassio false
os_name Linux
python_version 3.7.4
timezone Pacific/Auckland
version 0.102.3
virtualenv true

Thanks

Wayne

Go to configuration-> integrations

Click the + button, find izone.

@Swamp-Ig Thanks for the reply.

I’ve added izone: to the configuration file and no devices have appeared.

Tried removing it and adding through integrations - responds with

Aborted
No iZone devices found on the network

Tailing the log file at the same time I get:

2019-12-16 21:22:21 INFO (MainThread) [pizone.discovery] Close called on discovery service.
2019-12-16 21:22:21 DEBUG (MainThread) [pizone.discovery] Connection Lost
2019-12-16 21:22:21 DEBUG (MainThread) [homeassistant.components.izone.config_flow] No controllers found
2019-12-16 21:22:53 INFO (MainThread) [pizone.discovery] Starting discovery protocol
2019-12-16 21:22:53 DEBUG (MainThread) [pizone.discovery] Sending discovery message to addr 10.120.10.255
2019-12-16 21:22:53 DEBUG (MainThread) [pizone.discovery] Datagram Recieved b'ASPort_12107,Mac_000025998,IP_192.168.10.99,iZoneV2,iLight,iDrate'
2019-12-16 21:22:55 DEBUG (MainThread) [pizone.discovery] Datagram Recieved b'iZoneChanged_System'
2019-12-16 21:22:56 DEBUG (MainThread) [pizone.discovery] Datagram Recieved b'iZoneChanged_Zones'
2019-12-16 21:22:56 DEBUG (MainThread) [pizone.discovery] Datagram Recieved b'iZoneChanged_Schedules'
2019-12-16 21:23:13 INFO (MainThread) [pizone.discovery] Close called on discovery service.
2019-12-16 21:23:13 DEBUG (MainThread) [pizone.discovery] Connection Lost
2019-12-16 21:23:13 DEBUG (MainThread) [homeassistant.components.izone.config_flow] No controllers found

I’ve tried adding it through intergrations with izone: added and removed from the configuration file.

Thanks for you help - Wayne

Not sure if this is of any help:

{"AirStreamDeviceUId":"000029793","DeviceType":"ASH","SysOn":"on","SysMode":"cool","SysFan":"high","SleepTimer":0,"UnitType":"Fujitsu","Supply":"7.3","Setpoint":"22.0","Temp":"0.0","RAS":"RAS","CtrlZone":15,"Tag1":"Hamilton, New Zealand","Tag2":"Bramley Estate","Warnings":"none","ACError":" OK","Id":0,"EcoLock":"false","EcoMax":"30.0","EcoMin":"18.0","NoOfConst":1,"NoOfZones":6,"SysType":"320","AirflowLock":"off","UnitLocked":"false","FreeAir":"disabled","FanAuto":"3-speed","OemMake":0}

Is this a new system? I noticed the datagram says ‘iZoneV2’ instead of iZone like mine says.

Probably will need to rejig the library to handle it if the API has changed. Not sure if I’ll have a lot of time to do it that’s the only thing.

Thanks

Thanks for that, that must be the problem. Do you know if there are updated docs on the revised api.

Be great if you get a chance to take a look at it sometime

Thanks anyway

Wayne

Hi @Swamp-Ig I did some digging, I think I found where it breaks, is it as simple as changing

        message = data.decode().split(',')
        if len(message) < 3 or message[0] != 'ASPort_12107':
            _LOG.warning("Invalid Message Received: %s", data.decode())
            return
        if len(message) > 3 and message[3] != 'iZone': <-- this to either "iZone" and/or "iZoneV2"???
            return

in the discovery.py file

Im not sure how to do that and test it.

Thanks

Wayne

Hi,
I’m new to home assistant / hassio, so I am fairly lost right now.
Right now my goal is to connect my izone system to home assistant, which I am currently running on an old laptop (ubuntu) using docker.

I’ve setup the basic hassio, but when I try to setup the izone integration, it doesn’t find it.

My guess is that the problem is associated with the following:

The iZone system uses UDP broadcasts over the local network to find and communicate with iZone devices. For this to work properly, UDP port 12107 must be able to be broadcasted on, 7005 needs to be listened to for broadcasted messages, and TCP port 80 for HTTP data to the bridge. The integration currently listens on 0.0.0.0 and broadcasts to all broadcast IPv4 local addresses, which is not configurable.

How do I check if my setup has those ports open?

Thanks,

Hi, I just had a iZone controller installed. Much like the previous poster it is a V2. That said, I was able to modify the site-package for izone and adjust the reference to iZone to iZoneV2 and it started working.

I can submit a pull request that checks for either iZone or iZoneV2 or if you would like to do this Penny feel free.

Hi,

I pushed up a patch for this, it should be in a current release or one that’s comming very soon.

1 Like

Hope this is still OK to post here, but I finally got an iZone controller, and I’ve noticed that whilst it shows the current set temperature, it does not show the current house temperature.

Is there a way of it using the invent sensor, or alternatively using my current temp sensor (its a HA sensor)?

Edit: Apparently its my aircon thats the issue. According to iZone, my Panasonic unit isnt sharing the house temp with the iZone controller so I can’t see the current temp.

Ended up putting a Zigbee temp sensor near the vent, and then using a custom climate card in lovelace to loosely ‘replace’ the temperature shown as part of the iZone component. Not ideal, but probably as good as it will get, as the iZone solution was complicated and not a lot better than my fix.

Hi,

I got iZone and I’ve been using your integration for some time now - thanks for all the good work.

Recently I started monitoring my HA logs more closely, and I am noticing this stack trace:

2021-07-16 11:53:19 ERROR (MainThread) [homeassistant.util.logging] Exception in controller_update when dispatching 'izone_controller_update': (<pizone.controller.Controller object at 0x7fb7191f7d90>,)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/izone/climate.py", line 211, in controller_update
    zone.async_schedule_update_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 576, in async_schedule_update_ha_state
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 419, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 450, in _async_write_ha_state
    attr = self.capability_attributes
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 217, in capability_attributes
    supported_features = self.supported_features
  File "/usr/src/homeassistant/homeassistant/components/izone/climate.py", line 123, in wrapped_f
    return func(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/izone/climate.py", line 548, in supported_features
    if self._zone.mode == Zone.Mode.AUTO:
  File "/usr/local/lib/python3.9/site-packages/pizone/zone.py", line 69, in mode
    return self.Mode(self._get_zone_state('Mode'))
  File "/usr/local/lib/python3.9/enum.py", line 360, in __call__
    return cls.__new__(cls, value)
  File "/usr/local/lib/python3.9/enum.py", line 678, in __new__
    raise ve_exc
ValueError: 'error' is not a valid Zone.Mode

The component still seems to work fine.

Cheers,
Miroslav

Hey, can you please report this as a bug to github, and tag the izone component.

Will let you know what else I need from there.