Publish your own packages to the world's most popular software ecosystem with npm Pro.Get started »

node-red-contrib-atbrightness

1.0.11 • Public • Published

node-red-contrib-atbrightness

A collection of Node-RED nodes to Configure Advantech IIoT brightness driver.

Notice that an Advantech IIoT Platform SDK have to be installed to make this node works correctly. Advantech IIoT Platform SDK download link is shown below: Windows: https://github.com/Advantech-IIoT/Platform-SDK/tree/master/windows/bin Linux: https://github.com/Advantech-IIoT/Platform-SDK/tree/master/linux/bin

Install

Use npm command to install this package locally in the Node-RED modules directory

npm install node-red-contrib-atbrightness

or install it globally with the command

npm install node-red-contrib-atbrightness -g

Nodes included in the package

Brightness-data-get : Get information for devices.

Brightness-data-set : Set information for devices, e.g. Brightness Value.


Example

[Brightness-data-get]

Demo Flow: Brightness_Data_Get_Demo_Flow.json

It will output all of the information after deployment for once.

Get_All_Info

Get_All_Info_Func

Output is a json format object: Get_All_Info_Output

  • Min : Minimum Value of brightness
  • Max : Maximum Value of brightness
  • Value : Current Value of brightness
  • Auto : Auto Brightness Status of brightness. [0: Manual, 1: Auto].

If the device does not support Auto Brightness, the output object:

{
    Min: 1,
    Max: 9,
    Value: 1,
    Auto: "Not Support"
}

You can write following example in the function node. It will output the same result.

msg.payload = {
    Min: 1,
    Max: 1,
    Value: 1,
    Auto: 1
};
return msg;

If you just want to get specific information, eg. Current Value of brightness: (number and boolean are valid value.)

msg.payload = {
    Value: 1
    // Or Value: true
};
return msg;

[Brightness-data-set]

Demo Flow: Brightness_Data_Set_Demo_Flow.json

This node can only receive a value for one time.

All you have to do is sending a format like msg.payload, type is number or boolean.

Set Current Brightness Value to specified value

Set_Value_Flow

Set_Value_Inject

If you send a number is not between Minimum and Maximum, you will get Not Support.

Not_Support

Set Auto Brightness

Set_Auto_Flow

Set_Auto_Inject

You can configure the payload True or False.


Tested Platform

  • Windows 10 Enterprise LTSB with node.js 6.10.1

History

  • 1.0.7 - October 2017 : Initial Release

License

Copyright 2017 ADVANTECH Corp. under the Apache 2.0 license.

Install

npm i node-red-contrib-atbrightness

DownloadsWeekly Downloads

2

Version

1.0.11

License

Apache-2.0

Unpacked Size

80.7 kB

Total Files

16

Last publish

Collaborators

  • avatar