Closed Jc2k closed 2 years ago
For that to work we'd need to modify this to take a list of broadcast addresses, not a list of IPInterface. I slapped together a quick prototype of this and it seems to work. We'd just need to set local_addr
to ("0.0.0.0", 0).
After updating the config flow and _async_scan_update
in homeassistant to call async_get_ipv4_broadcast_addresses
and pass it to Discovery().scan
I now have:
Hey @cmroche. Sorry for not following this up sooner, i've been busy with some other Home Assistant features. I'd like to try and get this fixed in the August release of HA. Beta is tomorrow, but this is IMO a bug fix, so we should still be able to do it. If i get a PR together for this and HA, will you be able to do reviews/releases?
@Jc2k I'll take a look.
Released 1.3.0
@cmroche I have two wifi networks (VLANs) - first is home network which AC controller is using, and second is for my IoT devices. HA host has two interfaces, to access both of them. HA has configured only second one (for multicast traffic) but I had to "enable" the first one as well to process Gree Integration initial config sucessfully. My question is - once my Gree Integration has been added to HA and it's working, am I allowed to "disable" this first interface? Does all traffic go via unicast now (even when HA is restarted)?
Possibly a dupe of https://github.com/cmroche/greeclimate/issues/39 but not enough information to be sure.
TL;DR: I think
netifaces
is returning the wrong broadcast address. If i manually set a broadcast address i can get it to work. It looks like netifaces is unmaintained so I can't report a bug there.I think there are 2 thngs we can do here:
Ideally
scan()
would take a list of broadcast addresses.And then for the homeassistant integration we'd use https://github.com/home-assistant/core/blob/dev/homeassistant/components/network/__init__.py#L97 to get the broadcast addresses. This does work for my environment, but it also means that I can choose from the web interface which interfaces to broadcast on.
Here are the notes from my deep dive into this.
From where Home Assistant is running:
A EcoAir rebadged gree unit is on 10.192.170.6. So same VLAN.
First attempt playing around in python shell:
This bit didn't seem right:
Does not match the output of:
The first says the incorrect broadcast address, the second says what i expected it to be (10.192.170.255). So lets try that: