home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.7k stars 30.82k forks source link

iZone integration - Fails with 4-speed fan #51767

Closed SgtBatten closed 3 years ago

SgtBatten commented 3 years ago

The problem

I am unable to discover my iZone controller. After an integration attempt the UI reports

"Aborted No devices found on the network"

The log return is shown below with an error coming from a FAN MODES related portion of the discovery.py. Unfortunately i am yet to figure out how to ssh into the container and view the file myself yet sorry.

I have also installed the integration using the configuration.yaml but it also fails to find any devices.

What is version of Home Assistant Core has the issue?

core-2021.6.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

iZone

Link to integration documentation on our website

https://www.home-assistant.io/integrations/izone/

Example YAML snippet

izone:
  exclude:
    - "000013170"

Anything in the logs that might be useful for us?

2021-06-12 12:51:40 INFO (MainThread) [pizone.discovery] Starting discovery protocol
2021-06-12 12:51:40 DEBUG (MainThread) [pizone.discovery] Sending discovery message to addr 192.168.1.255
2021-06-12 12:51:40 DEBUG (MainThread) [pizone.discovery] Sending discovery message to addr 172.30.33.255
2021-06-12 12:51:40 DEBUG (MainThread) [pizone.discovery] Sending discovery message to addr 172.17.255.255
2021-06-12 12:51:40 DEBUG (MainThread) [pizone.discovery] Datagram Recieved b'ASPort_12107,Mac_200007619,IP_192.168.1.90,iZoneV2,iLight,iDrate'
2021-06-12 12:51:40 ERROR (MainThread) [pizone.discovery] Uncaught exception
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pizone/discovery.py", line 393, in initialize_controller
await controller._initialize() # pylint: disable=protected-access # noqa: E501
File "/usr/local/lib/python3.8/site-packages/pizone/controller.py", line 94, in _initialize
self.fan_modes = Controller._VALID_FAN_MODES[
KeyError: 'unknown'
2021-06-12 12:51:54 DEBUG (MainThread) [pizone.discovery] Datagram Recieved b'iZoneChanged_System'
2021-06-12 12:51:54 DEBUG (MainThread) [pizone.discovery] Datagram Recieved b'iZoneChanged_Zones'
2021-06-12 12:51:55 DEBUG (MainThread) [pizone.discovery] Datagram Recieved b'iZoneChanged_Schedules'
2021-06-12 12:52:00 INFO (MainThread) [pizone.discovery] Close called on discovery service.
2021-06-12 12:52:00 DEBUG (MainThread) [pizone.discovery] Connection Lost
2021-06-12 12:52:00 DEBUG (MainThread) [homeassistant.components.izone.config_flow] No controllers found
2021-06-12 12:53:01 INFO (MainThread) [pizone.discovery] Starting discovery protocol
2021-06-12 12:53:01 DEBUG (MainThread) [pizone.discovery] Sending discovery message to addr 192.168.1.255
2021-06-12 12:53:01 DEBUG (MainThread) [pizone.discovery] Sending discovery message to addr 172.30.33.255
2021-06-12 12:53:01 DEBUG (MainThread) [pizone.discovery] Sending discovery message to addr 172.17.255.255
2021-06-12 12:53:01 DEBUG (MainThread) [pizone.discovery] Datagram Recieved b'ASPort_12107,Mac_200007619,IP_192.168.1.90,iZoneV2,iLight,iDrate'
2021-06-12 12:53:01 ERROR (MainThread) [pizone.discovery] Uncaught exception
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pizone/discovery.py", line 393, in initialize_controller
await controller._initialize() # pylint: disable=protected-access # noqa: E501
File "/usr/local/lib/python3.8/site-packages/pizone/controller.py", line 94, in _initialize
self.fan_modes = Controller._VALID_FAN_MODES[
KeyError: 'unknown'
2021-06-12 12:53:21 INFO (MainThread) [pizone.discovery] Close called on discovery service.
2021-06-12 12:53:21 DEBUG (MainThread) [pizone.discovery] Connection Lost
2021-06-12 12:53:21 DEBUG (MainThread) [homeassistant.components.izone.config_flow] No controllers found

Additional information

No response

probot-home-assistant[bot] commented 3 years ago

izone documentation izone source (message by IssueLinks)

SgtBatten commented 3 years ago

I was able to google the following command and i can see my AC unit is returning "unknown" for fan auto

curl http://192.168.1.90:/SystemSettings
{"AirStreamDeviceUId":"20000xxxx","DeviceType":"ASH","SysOn":"off","SysMode":"heat","SysFan":"auto","SleepTimer":0,"UnitType":"Mitsubishi Heavy Industries","Supply":"21.5","Setpoint":"22.0","Temp":"19.6","RAS":"zones","CtrlZone":0,"Tag1":"","Tag2":"","Warnings":"none","ACError":" OK","Id":0,"EcoLock":"false","EcoMax":"30.0","EcoMin":"15.0","NoOfConst":1,"NoOfZones":5,"SysType":"320","AirflowLock":"off","UnitLocked":"false","FreeAir":"disabled","FanAuto":"unknown","OemMake":1}

The only valid responses are as far as i can tell listed here in controller.py

 _VALID_FAN_MODES = { 
       'disabled': [Fan.LOW, Fan.MED, Fan.HIGH],
        '3-speed': [Fan.LOW, Fan.MED, Fan.HIGH, Fan.AUTO],
        '2-speed': [Fan.LOW, Fan.HIGH, Fan.AUTO],
        'var-speed': [Fan.LOW, Fan.MED, Fan.HIGH, Fan.AUTO],
        }  # type: Dict[str, List[Fan]]

My unit, i believe is a 4 speed unit with an extra "boost speed" The iZone interface does have a 4 speed setting in the auto fan config so i guess i would need something like. [Fan.LOW, Fan.MED, Fan.HIGH, Fan.BOOST, Fan.AUTO],

even if that is incorrect it is still reporting unknown so perhaps i will need to edit the code myself on my local system. After a full day of googling I still have not worked out how to view the files inside a container. I prefer winscp for actual file browsing over pure shell but if someone has some guidance i can copy to edit controller.py that would be swell.

Swamp-Ig commented 3 years ago

I just had a fiddle with my unit. Yes if you set the fan speeds to 4 speed on the unit it does report as ```'unknown```` fan modes.

Might I suggest that you set the fan speed on the unit to 3-speed? Do you need the extra speed?

SgtBatten commented 3 years ago

Hmm, i tried setting it to 3 speed a couple of hours ago and it is still reporting unknown. I reinitialised the controller in between. Is that all you did?

I can certainly do that to gain the initial discovery if it will work. But to be honest yes we have been needing the boost a bit as we have high ceilings. I'll see how it goes.

SgtBatten commented 3 years ago

I reset the bridge this time and it worked right away. Do you think setting it back to 4 speed in the future will be problematic if i need to

Swamp-Ig commented 3 years ago

Are you going to just leave the fan mode on Auto? What does the SysFan report when it's on boost mode?

I can probably contact the iZone people and ask them if it's consistently "unknown" when in 4-speed mode, then the library can be changed so the mapping works out. Alternately you could hack the python source to make it work for your particular case.

SgtBatten commented 3 years ago

It reports "top" when in boost mode.

understood. Thanks. I'm just fiddling with how to actually control the system now.

SgtBatten commented 3 years ago

I rang air stream this morning and he asked me to send through an email which I have done. Also confirmed a second time with MHI that my unit is indeed a 4 speed.

SgtBatten commented 3 years ago

Penny, any chance you could give me a hint as to where the controller.py file is so i can edit it. Just thinking I can replace 'var-speed' with 'unknown' for now but i cannot for the life of my work out where these files are. If it matters I am running HA OS in a VM, on a windows server.

SgtBatten commented 3 years ago

Okay i have leaned a lot today.

I made custom components and have got my unit working while set to 4-speed.

I have changes to two core integrations and pizone to submit pull requests to.