https://github.com/alexandrehiroyuki/thingsboarddeviceemulator
Server to emulate a device telemetry connected to ThingsBoard. Easy to create and modify new generator functions and classes.
https://github.com/alexandrehiroyuki/thingsboarddeviceemulator
nodejs thingsboard typescript
Last synced: 6 months ago
JSON representation
Server to emulate a device telemetry connected to ThingsBoard. Easy to create and modify new generator functions and classes.
- Host: GitHub
- URL: https://github.com/alexandrehiroyuki/thingsboarddeviceemulator
- Owner: AlexandreHiroyuki
- Created: 2022-05-14T16:36:12.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-05T00:06:04.000Z (over 2 years ago)
- Last Synced: 2025-02-02T04:44:44.266Z (8 months ago)
- Topics: nodejs, thingsboard, typescript
- Language: TypeScript
- Homepage:
- Size: 22.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# ThingsBoard Device Emulator
Server to emulate a device telemetry connected to ThingsBoard. Easy to create and modify new generator functions and classes.
## Geting Started
Download the project dependencies.
```
npm install--- or ---
yarn install
```Create a `.env.dev` file in the root directory of the project.
```
ACCESS_TOKEN_FIRST_DEVICE=""
TB_HOST_ADDRESS=""
```Run the emulator.
```
npm run dev--- or ---
yarn dev
```## Generator Functions/Classes
### Random Generator
Outputs a random number between the minimum and maximum values.
```
randomGenerator(min: number, max: number)
```### Random Activation Generator
Outputs randomly if the device is activated or not.
It's possible to set a minimum and a maximum inactive time.
```
randomActivationGenerator(min: number = 0, max: number = 3)
generate()
```### Random Summatory Generator
Outputs a summatory of random numbers between the positive or negative variation.
It's possible to set a minimum and maximum value for the summatory to prevent the summatory to be too big or too small.
```
randomSummatoryGenerator(initValue: number, min: number = 0, max: number = 100)
generate(variation: number)
```