🎮 Device management
To ease connecting web-app to Entrance Observer, Beehive IoT sensors, Robotic Beehive and other third-party ([Beep.nl weight telemetry integration](https://www.notion.so/Beep-nl-weight-telemetry-integration-a72ed2ce25004a3c853bb41fa08abc48?pvs=21)) we need a separate view for managing devices.
Currently devices are not registered, they just use an API token and its later not clear if token is used or not and by what device.
Another problem is that its not clear when was the last time device was online / interacted with us.
A third potential problem is that if we do manage to sell devices, we need to have some kind of analytics, debugging and versioning per-device so we need a database.
Suggested solution
In the web-app
repo:
- Add new menu
Devices
in the top - Add devices list view
- it should make graphql query to list devices
- Add new device button + new view for this (similar to new hive creation)
- type (Beehive IoT sensors, Entrance Observer, Robotic Beehive)
- model number (string) - should help us to understand what software is running there and what set of features it has if we do bulk production
- select to hive (send
hiveId
to backend)- select section (optional, send
boxId
to backend)
- select section (optional, send
- generate new API token in user-cycle for this device
- need to change user-cycle to have
deviceId
column, pass it to user-cycle to be stored too
- need to change user-cycle to have
- lastUsed - datetime
- should be updated on every API call if its > 1 min
- status
- if lastUsed < 1 min, mark device as green, online
- if lastUsed > 5 min, mark device as yellow, pending
- if lastUsed > 1h, mark device as red, offline
- Edit device view
- revoke API token for this device
Connect to device
button for Entrance Observer and Robotic Beehive- for Entrance Observer, should trigger Remote desktop via VNC
- for Robotic Beehive we should have dedicated views to control the device remotely
Device logs
table view- Ideally this should show something that our client apps will send
- Read-only
- Remove device button should soft-delete a device
- should revoke API token before deletion
- In account view → token list, show if api token is used by a device. Instead of deletion button, direct user to device view