milesight-powermeter-api

2024.9.13-1 • Public • Published

Milesight Powermeter Api

Description

The Milesight Powermeter API is an internal tool exclusively accessible to our backend team. It serves as a command hub for the Milesight CT10x powermeter using lorawan downlink commands.

Requirements

  • RabbitMQ 3.9.11
  • Node 20.15.0

Installation

$ npm install

Configuration

  • AWS_ACCESS_KEY_ID

    • AWS Access Key ID
  • AWS_SECRET_ACCESS_KEY

    • AWS Secret Key
  • NODE_ENV

    • Node environment
  • LOG_LEVEL

    • value can be debug, info, error and verbose.
  • MILESIGHT_POWERMETER_API_PORT

    • configurable host port and has a default of 9059
  • AMQP_HOST

    • rabbitmq host
  • AMQP_USERNAME

    • rabbitmq user
  • AMQP_PASSWORD

    • rabbitmq password
  • AMQP_PORT

    • rabbitmq port

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

REST API

Get lorawan powermeter list

GET powermeter/milesight

maxResult(optional) range from 1-255 (default is 25) nextToken(optional) token for the succeeding page/request

Reboot the powermeter

POST powermeter/milesight/reboot

Body: {
        deviceEui: string;
        serialNumber?: string;
      }

deviceEui(required) device eui of the milesight powermeter
serialNumber(optional) serial number of the milesight powermeter

Set device interval for the powermeter

POST powermeter/milesight/interval

Body: {
        deviceEui: string;
        serialNumber?: string;
        interval: number;
      }

deviceEui(required) device eui of the milesight powermeter
serialNumber(optional) serial number of the milesight powermeter
interval(required) interval value in minutes (1-1440)

Readme

Keywords

none

Package Sidebar

Install

npm i milesight-powermeter-api

Weekly Downloads

1

Version

2024.9.13-1

License

UNLICENSED

Unpacked Size

1.34 MB

Total Files

31

Last publish

Collaborators

  • mewe-devops