Giter Site home page Giter Site logo

kuzzleio / kuzzle-device-manager Goto Github PK

View Code? Open in Web Editor NEW
13.0 10.0 6.0 4.65 MB

IoT Devices & Assets Management providing digital twins, payload decoding, normalized measures, provisioning. Multi-Tenant ready for white labelled and B2B2C applications.

Home Page: https://docs.kuzzle.io/official-plugins/device-manager/1

License: Apache License 2.0

TypeScript 99.30% JavaScript 0.47% Shell 0.23%
kuzzle-iot-platform kuzzle kuzzle-plugin whitelabel multitenancy device-management asset-management iot scalability hacktoberfest

kuzzle-device-manager's Introduction

Device manager

This plugin provides the necessary APIs to manage a fleet of devices linked to assets.

It allows to decode the payloads received for the different device models of the application.

It works in a multi-tenant mode where each tenant has its own devices and assets.

See the documentation

Usage

In proper way to use this library in your program as an NPM module:

npm install kuzzle-device-manager

kuzzle-device-manager's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kuzzle-device-manager's Issues

[doc] Delete device:create

It is no longer supported to manually create a device via the API endpoint (which is no longer available).

Allows to replay a range of payload

Description

We should have a mechanism that allows to replay a full range of payloads.

This mechanism should update the date of each payloads in a configurable way

Ensure tenant isolation

  • Use EmbeddedSDK.as method
  • Audit the code to ensure there is no privacy breach

Audit tips

Question every usage of an index name.

Allows to define custom mappings for devices and assets for a tenant group only

Description

Custom mappings for assets and sensors are general so they will be loaded in every tenant collections.

If I have 2 kinds of tenants: air-quality and water-management, they will have different metadata for sensors and assets since it's two different kind of use case.

With the current implementation, every tenant kind will share the mappings of the two use cases.

We need a way to register custom mappings only for a particular tenant kind. And if no kind is specified then the mappings is applied to every tenant kind.

Possible API:

// only for "water-management" tenants
deviceManager.registerAssetsMappings(pipesMappings, 'water-management');
deviceManager.registerAssetsMappings(valvesMappings, 'water-management');

// only for "air-quality" tenants
deviceManager.registerAssetsMappings(classroomsMappings, 'air-quality');

// for all tenants
deviceManager.registerAssetsMappings(reportsMappings);

Configuration catalog for downlink

Build and save a configuration catalog to send downlink to sensors

Ideally we could develop an API adapter to one of the platform (e.g. SPOT) to automatize the sent of downlinks with workflows:

  • I enter a platform area: send downlink to reduce the frequency of GPS data and use Wifi instead

Move Decoders from init of the plugin to the dedicated DecodersService

Description

Decoders are initialized at the root level of the plugin (inside the init fonction) it will be better to move all that logic of init at the place where it belong -> DecodersService

  • DecoderService / DecoderController (#114)

  • Add an accessor to the PluginContext in the Decoder base class

Add API actions to clean the payloads collection

Description

The payloads collection contains raw payloads from the sensors for debugging and analyze purposes.

We should add API action to remove old payloads (e.g. every payloads older 2 weeks)

Add bulk API actions

Description

We need bulk API actions to act on several sensors at the same time:

  • mass attach sensors to tenants
  • mass link sensors to assets

Those actions should have two different format:

  • JSON: assignment information in an array of objects in the body
  • CSV: assignment information in a CSV string passed in the body alongside decoding information (which columns held assignments info)

Improve provisioning strategy

In the engine config document, the autoProvisionning field name is misleading and incorrectly spelled.

  1. Provisioning is spelled with 1 n
  2. "autoProvisioning": true leads to thinking that the catalog documents are taken into account, whereas they are not. We should name it something like provisioningStrategy accepting auto or catalog, which would make its behavior more explicit.
  3. Provisioning catalog import should be available from a CSV file <- moved into a dedicated issue #132

Isolate metadata specific mappings for asset

Description

It's possible to define specific mappings for assets metadata.

We may have metadata with the same name but with different types and because ES mappings specificity it can lead to errors.

We should isolate each asset type metadata in a sub-property:

{
  ...
  metadata: {
    'caisse-mobile': {
      // caisse mobile metadata
    },
    'platform': {
      // platform metadata
    }
  }
}

Develop device manager views

  • CRUDL sensors for admin
  • CRUDL assets for a tenant
  • Assign sensor to tenant for admin
  • Link sensor to asset for tenant

Add cypress tests for existing features

Add cypress tests for existing features:

  • List sensors
  • List sensors
  • List assets
  • List assets
  • Create sensor
  • Create asset
  • Update sensor
  • Update asset
  • Permissions for previous tests (admin/tenantUser)

Create roles and profiles when registering decoders

Description

When registering a decoder, an API action is generated and then we can receive payloads on this action.

We should create a role allowed to push payloads only on this API action so then we can also generate an user with corresponding API keys.

We could even generate the corresponding user.

We should also generate a global role (and associated user maybe) which is allowed to send payload on every action of the device-manager/payload controller.

make more explicit error messages

Using mCreate in the batch processor in non-strict mode doesn't allow to throw explicit error messages. We should find a way to show errors coming from the errors array of this method.

Add API action to clean the payloads collection

Description

We need an API action to easily clean the payloads collection of the device-manager engine.

This action should allow to easily remove payloads since X days and allow an ES query to filter on sensorModel andvalid for example

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.