Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discovery issue with iZoneV2 #3

Closed
njoc-dev opened this issue Jan 15, 2020 · 30 comments
Closed

Discovery issue with iZoneV2 #3

njoc-dev opened this issue Jan 15, 2020 · 30 comments
Assignees

Comments

@njoc-dev
Copy link

njoc-dev commented Jan 15, 2020

Hi there.

Have just had iZone-enabled aircon installed, so haven't had any operating iZone integrations in homeassistant as yet. When i attempt to discover the iZone instance i get a response of "No iZone devices found on the network". The logs show that the iZone controller has responded, but the pizone detection hasn't picked it up.

Issue seems to be in the iZone descriptor sent back from the controller being "iZoneV2" instead of the expected "iZone". Code at line 379 in discovery.py is not expecting a V2:

if len(message) > 3 and message[3] != 'iZone':

Logs below show the sending and receiving of discovery packets:

2020-01-15 16:01:36 INFO (MainThread) [pizone.discovery] Starting discovery protocol
2020-01-15 16:01:36 DEBUG (MainThread) [pizone.discovery] Sending discovery message to addr 192.168.X.255
2020-01-15 16:01:36 DEBUG (MainThread) [pizone.discovery] Sending discovery message to addr 192.168.X.255
2020-01-15 16:01:36 DEBUG (MainThread) [pizone.discovery] Sending discovery message to addr 172.30.X.255
2020-01-15 16:01:36 DEBUG (MainThread) [pizone.discovery] Sending discovery message to addr 172.17.255.255
2020-01-15 16:01:36 DEBUG (MainThread) [pizone.discovery] Datagram Recieved b'ASPort_12107,Mac_000032876,IP_192.168.X.Y,iZoneV2,iLight,iDrate'
2020-01-15 16:01:36 DEBUG (MainThread) [pizone.discovery] Datagram Recieved b'ASPort_12107,Mac_000032876,IP_192.168.X.Y,iZoneV2,iLight,iDrate'
2020-01-15 16:01:56 INFO (MainThread) [pizone.discovery] Close called on discovery service.
2020-01-15 16:01:56 DEBUG (MainThread) [pizone.discovery] Connection Lost
2020-01-15 16:01:56 DEBUG (MainThread) [homeassistant.components.izone.config_flow] No controllers found`

Looking first of all to make sure that i've interpretted this correctly, then to see if we can provide a solution. If i can spin up a dev instance i'll create a pull request.

Thanks,
Nick

@Swamp-Ig
Copy link
Owner

Thanks for your report. I should be able to fix it this weekend.

@njoc-dev
Copy link
Author

That's awesome. Let me know how I can help :)

@Swamp-Ig
Copy link
Owner

OK, I've pushed up a new version of the file. I'm not entirely sure it will work though, if the API version number has changed then it's very possible the API itself will be different.

In any case here's the file that replaces the existing discovery.py, which you can just overwrite to test it on your system.

If you're using hass.io, login to wherever it's running then execute this:

> docker exec -it homeassistant bash -l
> cd /usr/local/lib/python3.7/site-packages/pizone
> cat > discovery.py
**paste in the new file contents**
^C
> exit
> docker restart homeassistant

Then see how you go. If you need help getting it onto you system, ping me in the #homeassistant support channel on discord, @Penny

@njoc-dev
Copy link
Author

@Swamp-Ig thanks - some progress, but seems to still have an issue in discovery.

Followed your instructions to update hassio

Screenshots and log attached
Screen Shot 2020-01-27 at 4 44 20 pm
Screen Shot 2020-01-27 at 4 44 58 pm

Let me know what else i can do to test, and what other info you need. Thanks heaps for your efforts!

Nick

@Swamp-Ig
Copy link
Owner

I suspect like I was concerned about, the API has changed. It's going to be very hard for me to fix since I don't have a V2 unit at home.

@njoc-dev
Copy link
Author

@Swamp-Ig understood. I've forked this and am working through it atm. Hope to report back soon with some feedback

@Swamp-Ig
Copy link
Owner

Awesome! Feel free to contact me on the discord.

@njoc-dev
Copy link
Author

@Swamp-Ig i have no idea what i did wrong, but its all working now. I literally just added more debug logging to understand the flow, used your method above to overwrite the release version files, and the discovery worked a charm! I can only assume i stuffed up somehow.

Awesome work on this library - appreciate your efforts :)

@Swamp-Ig
Copy link
Owner

Swamp-Ig commented Feb 11, 2020

Oh great, I will update the HA version of the library and push up the new version.

  • It might be worth emailing the iZone people to see if their V2 API actually changed much

@Swamp-Ig
Copy link
Owner

Hey,

So I've contacted the iZone people, it looks like the API has really just been extended for V2, The only exception would be for iSave if you have that option.

I will continue to discuss with them and see how we go.

@Swamp-Ig
Copy link
Owner

Swamp-Ig commented Mar 7, 2020

Just pushed up a PR to home assistant to fix this issue.

home-assistant/core#32552

@njoc-dev
Copy link
Author

njoc-dev commented Mar 8, 2020

Awesome :) cheers @Swamp-Ig

@Nick-Adams-AU

This comment has been minimized.

@aarooren
Copy link

aarooren commented Mar 23, 2020

Hey @Swamp-Ig
I was a happy user of your iZone component until HA was upgraded to 0.107.x

Currently I am on 0.107.5, but my HA refuse to discover the iZone at all.
I have pretty much tested with all 0.107.x versions and found that HA does not detect the iZone.
HA iZone

When I go back to my previous version 0.106.6, I can still see the HA detecting iZone and all my iZone automatons works fine.

Could you kindly check whether any changes on the component for 0.107.x has a negative impact on the pre-existing iZone devices please?

Thanks in advance.

@ufu-
Copy link

ufu- commented Apr 1, 2020

Hey @Swamp-Ig

same here, after 0.107.x all iZone devices are orphaned, if I remove and re-add the integration nothing is found on the network.
As aarooren already pointed out, reverting to 0.106.6 fixes the issue and everything works.

Any advice would me much appreciated.
Also I subscribe to @Nick-Adams-AU idea, airflow would be awesome to have.

Cheers,

@Swamp-Ig Swamp-Ig self-assigned this Apr 1, 2020
@Swamp-Ig
Copy link
Owner

Swamp-Ig commented Apr 1, 2020

Hey, Sorry I'm definitely not going to have time to look at this for some time given the COVID situation. Once things have settled down I might get a chance. It works for 106.5 for me.

@ufu-
Copy link

ufu- commented Apr 9, 2020

@aarooren As a temporary solution, if you map the 0.106.6 iZone component folder to your HA installation it does fix the issue and everything works. I've tested it up to HA 0.109 dev

@Nick-Adams-AU
Copy link
Contributor

@ufu- Do you use Docker? If so, check if this fixes your issue:

home-assistant/core#32992 (comment)

@aarooren
Copy link

aarooren commented Apr 17, 2020

@ufu-
Based on your suggestion I have mapped the 0.106.6 iZone folder as a custom component - it worked for me. Many thanks.

@SuraMendis
Copy link

Is there documentation on the v2 API?

@Swamp-Ig
Copy link
Owner

Yeh there is, it's just extra stuff that isn't that useful for HA purposes though and isn't a radical change.

Have picked this issue up again, I have the fixes ready to go and will be pushing out soon.

@Nick-Adams-AU

This comment has been minimized.

@Swamp-Ig

This comment has been minimized.

@Nick-Adams-AU

This comment has been minimized.

@Swamp-Ig
Copy link
Owner

That would be awesome however I'm not much of a Python programmer unfortunately. I'm ok at testing and debugging. Let me know if I can be of assistance.

OK well it's not a priority for me I'm afraid. Also please keep this on-topic. This question isn't anything to do with the issue.

@Swamp-Ig
Copy link
Owner

This is now PRed in HA for the next release.

@Karl-Johns
Copy link

Karl-Johns commented Jul 18, 2022

Hi @Swamp-Ig late to this thread, but I am running HA 2022.7.3 and have just tried to install the iZone integration. I get the following:

2022-07-18 17:05:35 INFO (MainThread) [pizone.discovery] Starting discovery protocol
2022-07-18 17:05:35 DEBUG (MainThread) [pizone.discovery] Sending discovery message to addr 192.XXX.XX.255
2022-07-18 17:05:35 DEBUG (MainThread) [pizone.discovery] Sending discovery message to addr 172.XXX.XXX.255
2022-07-18 17:05:35 DEBUG (MainThread) [pizone.discovery] Sending discovery message to addr 172.XXX.XXX.255
2022-07-18 17:05:55 INFO (MainThread) [pizone.discovery] Close called on discovery service.
2022-07-18 17:05:55 DEBUG (MainThread) [pizone.discovery] Connection Lost
2022-07-18 17:05:55 DEBUG (MainThread) [homeassistant.components.izone.config_flow] No controllers found
2022-07-18 17:41:32 INFO (MainThread) [pizone.discovery] Starting discovery protocol
2022-07-18 17:41:32 DEBUG (MainThread) [pizone.discovery] Sending discovery message to addr 192.XXX.XXX.255
2022-07-18 17:41:32 DEBUG (MainThread) [pizone.discovery] Sending discovery message to addr 172.XXX.XXX.255
2022-07-18 17:41:32 DEBUG (MainThread) [pizone.discovery] Sending discovery message to addr 172.XXX.XXX.255
2022-07-18 17:41:52 INFO (MainThread) [pizone.discovery] Close called on discovery service.
2022-07-18 17:41:52 DEBUG (MainThread) [pizone.discovery] Connection Lost
2022-07-18 17:41:52 DEBUG (MainThread) [homeassistant.components.izone.config_flow] No controllers found

From the above thread, I assumed this was working. i did note that my iZone hub was on another subnet (I have another subnet for all edge and iot devices), but not sure if that would pose a problem, as my other devices get found with other integrations.

Any help would be awesome.

@Nick-Adams-AU
Copy link
Contributor

I'm pretty sure that discovery will only work on the same subnet has they discovery packets are broadcast so won't be seen on another subnet.

@Karl-Johns
Copy link

@Nick-Adams-AU thanks nic. Interestingly however, the sonoff devices i use are on a different subnet to the HA server and it still finds them.

@Nick-Adams-AU
Copy link
Contributor

I don't think Sonoff use broadcast packets for discovery which would explain the difference in behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants