-
-
Notifications
You must be signed in to change notification settings - Fork 32
Description
Is your feature request related to a problem? Please describe.
It is currently not possible to manage multiple ambianic edge devices via the UI PWA.
The workaround is for users to keep separately a list of Edge Device IDs and plug them in the UI each time they want to connect to a single device via the PWA.
It is a commonly requested capability to be able to manage multiple edge devices via the PWA. Users expect to use 3-5 edge devices to cover key areas of an average household.
Describe the solution you'd like
There is currently an open issue for simultaneous timeline feed and management of multiple edge devices. However we realized that it will be an involved process that spans the webrtc and UI layers.
We can take a meaningful step in that direction, by implementing a lightweight version of multi-device management. The idea is to keep the webrtc and UI layers mostly unchanged. The UI will continue to actively work with one edge device at at a time, but it will be able to switch between multiple known/managed devices.
The UI would allow the user to add another device, but under the hood, the UI will simply save the latest state of the currently managed device (if any) and continue to add a new device with the same UI flow as adding the very first managed device.
Once the user has added more than one managed devices, they can switch between them.
The logic for switching between two known devices would be essentially the same as connecting to a new Remote Peer ID (edge device).
There will be some changes required to accomodate local discovery of multiple devices on the same WiFi network. The webrtc peer management layer (pnp) would now have to be aware of previously discovered local devices. Instead of connecting to the first non-self peer found in the local peer room, the logic would now have to do a couple of steps:
- Remove from the local peer room candidates any previously saved peer IDs.
- From the remaining candidates, find the first that presents itself as a proper ambianic edge device. Ignore other peers such as other ambianic UI apps running on the same wifi at the time of discovery. This step is will also close this pending issue.
Describe alternatives you've considered
A more sophisticated implementation would allow simultaneous active connections with multiple devices, which webrtc supports. Including a single timeline view with merged events from all managed edge devices. This is essentially the goal we are moving towards: #408.
In this interim step, the timeline will only show events from one device. It will simply refresh each time a new device is added or the user switches between known devices. The behavior will be consistent with the current way a connects to an alternative edge device. Only now they will have the option to pick from a list of known devices instead of manually entering the remote id of the device they want to switch to.
