DPIclimate / broker

3 stars 3 forks source link

Store URLs to get to service-specific device pages in physical and logical devices #12

Open dajtxx opened 1 year ago

dajtxx commented 1 year ago

Receivers and deliverers could add URL properties that allow a UI to easily link to the service-specific page for a device without having to know too much about external systems.

For physical devices this should be easy in some cases because receivers are quite specialised, eg TTN devices have an easily created URL. Many devices won't have an associated URL - YDOCs, other devices coming in via MQTT etc. Because physical devices represent a single 'thing' there won't be multiple URLs.

For logical devices, each destination may or may not have a URL, and the delivery services will need to be sure not to over-write each other's URLs. In this case it may be necessary for the delivery service to put the URL into the destination's properties, such as under the Ubidots key, and this will need to be put back in each time the Ubidots object is updated.

Another option is to have a new top-level object to hold these URLs, and have them keyed by the destination, eg:

{
  "ubidots": {
    Ubidots device properties here.
  },
  "thingsboard": {
    ThingsBoard device properties here.
  },
  "deviceUrls": {
    "ubidots": "https://..../devices/<deviceid>",
    "thingsboard": "https://..."
  }
}