-
-
Notifications
You must be signed in to change notification settings - Fork 126
Connection Methods
The plugin connects to the eWeLink HTTPS API on Homebridge startup to authenticate user credentials, obtain a web socket host and request a list of devices and their current state. The plugin also uses the HTTPS API to request the full details of a new device that is added to your eWeLink account whilst Homebridge is running.
LAN mode is available for devices that support this mode and is generally faster than the web socket (see below). Currently the plugin will:
- Discover eWeLink devices on your local network,
- Send device updates for supported devices, and
- Receive real-time updates when devices are controlled outside of Homebridge (e.g. physically or through the eWeLink app).
- If a device on your network changes IP address then the plugin will be updated upon receiving a status update from the device. If you try to control the device before this, then the request will fail and default to web socket. It is recommended to give your eWeLink devices a static IP from your router. You can also use the configuration to "override" device IPs, please refer to the bottom of this article.
- Devices are unable to "alert" Homebridge via LAN mode if they go offline - because they are offline! The only way that Homebridge gets notified of offline devices is through the web socket (see above).
For more information about LAN mode, please visit the eWeLink announcement.
A web socket connection is used for (1) devices that don't support LAN mode and (2) as a "fallback" if there is an issue with LAN mode. In these cases the web socket is used to:
- Send device updates from Homebridge to eWeLink, and
- Receive real-time updates from eWeLink when devices are controlled outside of Homebridge (e.g. physically or through the eWeLink app)
The LAN mode monitoring and the web socket are persistent connections that "listen" for device updates whilst Homebridge is running. This means there is no need to "poll" for device updates. If a device goes offline then Homebridge will be notified once eWeLink updates the device status. There can be a small delay. If a devices comes back online then Homebridge will be notified once eWeLink updates the device status. Again, there can be a small delay. Homebridge will refresh a device's current status upon being notified it is online.