mjg59 / python-broadlink

Python module for controlling Broadlink RM2/3 (Pro) remote controls, A1 sensor platforms and SP2/3 smartplugs
MIT License
1.39k stars 479 forks source link

Add support for FastCon meshed devices #645

Open madmat777 opened 2 years ago

madmat777 commented 2 years ago

Broadlink devices use FastCon connections to create a mesh WiFi where they connect to each other instead of to the router/AP.

When the following code is executed

import broadlink for dev in broadlink.xdiscover(): print(dev)

the result is only the devices that are connected to the router. The devices that are meshed do not show.

It must be possible to "look through" as both the Broasdlink phone App and Alexa can control all devices.

I've reviewed the FastCon SDK but it is beyond me on how this is possible - does not look easy. https://docs.ibroadlink.com/public/appsdk_en/appsdk_08/

The interim solution is to put all devices into a network segment that does not have access to the internet. That forces them all to connect to the router (don't ask me why). The con with this is that Alex can not access the devices but the phone App can.

madmat777 commented 2 years ago

Not sure why the code is all on one line. Should be:

import broadlink for dev in broadlink.xdiscover(): print(dev)

felipediel commented 2 years ago

Hi @madmat777. I opened a PR to add FastCon support, but I don't have the device to test. Could you help me?

madmat777 commented 2 years ago

Yes, for sure. I have them blocked from the internet at the moment but I can release the block and see how it goes.

madmat777 commented 2 years ago

@felipediel (in case you did not see my reply)

felipediel commented 2 years ago

No need to allow internet access.