0.1.9 • Published 2 years ago

tbclient v0.1.9

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

thingsboard client sdk

This is a warpper for thingsboard client, base on acte-technology thingsboard js sdk

npm install tbclient 

Now you can using in your code!

Using example

const tbClient = require('tbClient')

//tb server config
const config = {
  host: "hostname",
  username: "username",
  password: "password"
}

//init client
const client = new tbClient(config);

const now = Date.now();

//device
const device = {
  keys: ['t'],
  limit: 10,
  agg: 'AVG',
  interval: 3600,
  startTs: now-360000,
  endTs: now,
  entityId: "xxx-xxx-xxx-xxx-xxxx"
};


async function getDevices(){

  const {token, user} = await client.connect();
  console.log('TOKEN', token)
  console.log('USER', user)

  const params = {} //use defaults

  devices = await client.getTenantDevices(params);
  console.log('DEVICES', devices.length);


  temperatures = await client.getTimeseries(device);
  console.log('TEMPS', temperatures);


}


getDevices()
0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago