smithtek-node-red-comap
v1.4.1
Published
Smithtek Node Red Comap
Downloads
1
Readme
smithtek-node-red-comap
Installation
Install using the NodeRED palette manager
Usage
the NodeRED Comap nodes interact with the Comap Websupervisor API. Comap customers with a Websupervisor account can use these nodes to fetch values from units or send commands to units. Units are considered to be compatible Comap controllers. IG-NT-BB or IG-NT-GC are some popular models. For a full list of Comap products please follow this link. https://www.comap-control.com/products. The nodes can only interact with the API in a frequency that matches your Websupervisor plan. So if you account only allows 1 minute updates, then you should not try to send or retrieve data sooner than this time period.
To use these nodes you must have.
A valid Websupervisor account
Comap equipment compatible connected to Websupervisor
Details on the Websupervisor API are found here https://portal.websupervisor.net/
Node Configuration setup
To start you must add a new config Websupervisor server. Using valid credentials provided by Comap.
Username
: Your Websupervisor username.
Password
: Your Websupervisor Password
Comap Key
: The key issued to you by Comap.
Input Node
The Comap in node requires a bool true or false to trigger the API call. The node will return the last values from a controller "unit" connected to Websupervisor. The output message will be a json object and return 80 values. The object will contain parameters like, unit status, speed, voltage, load.
Reading values from a controller
When you have entered valid credentials the node will automatically list all the units on your account.
Select a unit you want to read then deploy the flow. From this point inject a "True" or "False"
Comap API service rules state that you can only call the units = > than the refresh rate of your Websupervisor plan. If your plan refreshes every 1 minute, then you must ensure you dont call the service at a frequency less than 1 minute. Doing so will not return any values.
Values response
The output message will be a json object with 80 elements.
{
"unitName":"Generator",
"timeStamp":"2021-05-02T10:19:55.432Z",
"Communication State":"Online",
"Unit State":"Loaded"
}
Tips on Usage Don't copy input nodes with a unit already configured/selected. It is best to drag and drop a new input node and load the existing server config, then select a new unit from the list. When you copy a new node,
- Select the configuration server.
- Deploy the flow.
- Go back to the node and select a unit.
- Hit deploy again "For good measures"
Output Node
The Comap out node requires a string command injecting to the input. This will send a post request to the Websupervidor API. It is used to do things like. turn a generator on/off. open close circuit breakers and send values to the controller ExValues parameter.
Sending commands to a controller
When you have entered valid credentials the node will automatically list all the units on your account.
Select a unit you want to read then deploy the flow. From this point inject/send a string command in a way suitable for your flow to the imput. We recommend the inject node to test the commands. The node will output a json object with a payload containing {"status":"sent"}.
Comap API service rules state that you can only post to the units => than the refresh rate of your Websupervisor plan. If your plan refreshes every 1 minute, then you must ensure you dont post to the service at a frequency less than 1 minute. Doing so will not return any values.
Commands List
The following commands can be injected into the “Out” node. The connected unit will react to this command.
All commands must be in "camelCase" text String
and sent to the input pin as a msg.payload.
You can copy and paste the below commands to an inject node and select string as the payload. You don't need to use quotes " "
start
: This will start the unit.
stop
: This will stop the unit.
manual
: This will put the unit into manual mode.
auto
: This will put the unit into auto mode.
faultReset
: This reset any faults on the unit.
changeMcb
: This will toggle the mains circuit breaker on/off
Example
{
"changeMcb":"on"
}
changeGcb
: This will toggle the generator circuit breaker on/off
Example
{
"changeGcb":"on"
}
extraValue
: Extra values will write values to the controller internal addresses.
To do this you must send a valid json payload.
There are 4 extra value slots in the controller.
To write a value of 44 to slot 1 you would use the following command in an inject node.
Example{
"command": "extValue",
"index": 1, "value": 4
}
Unit control
unit Read
Unit response
Each unit read will contain the following json Object to some degree. Some attributes are user configurable on the physical controller so can appearence can be different. ECU values can also dynamically change from unit to unit. { "unitName":"My Generator Or feeder", "timeStamp":"2021-05-03T09:02:42.69Z", "Communication State":"Online", "Unit State":"Ready", "Unit State Extended":"No Alarm", "Act power":0, "Run hours":23725, "Gen freq":0, "Gen V L2-L3":0, "Gen V L3-L1":0, "Gen V L1-L2":0, "ControllerMode":"MAN", "Gen V L1-N":0, "Gen V L2-N":0, "Gen V L3-N":0, "kWh (Import)":302054, "Gen curr L1":0, "Pwr factor":0, "Ubat":27.3, "Coolant Temp":14, "Oil Press":0, "Spare":-32768, "Gen curr L3":0, "Gen curr L2":0, "ECU 10160":0, "ECU 10161":0, "ECU 10162":0, "ECU 10174":0, "ECU 10153":0, "ECU 10154":0, "ECU 10155":0, "ECU 10156":0, "ECU 10157":0, "ECU 10158":0, "ECU 10159":0, "ECU 10163":0, "ECU 10164":0, "ECU 10165":0, "ECU 10166":0, "ECU 10167":0, "ECU 10168":0, "ECU 10173":0, "RPM":0, "Engine state":"Ready", "Emergency Stop":1, "GCB Feedback":0, "Engine E-Stop":1, "Low Oil Press":1, "Low Oil Lvl":1, "Lo Coolant Lvl":1, "Fan Low Spd":0, "Fan High Spd":1, "Fan Auto":0, "Sys start/stop":1, "Fan Fault":1, "GCB Trip":0, "Bin - Bit C":0, "Bin - Bit D":0, "Bin - Bit E":0, "Bin - Bit F":0, "Starter":0, "GCB close/open":0, "GCB UV coil":0, "Not used":0, "Com Shutdown":0, "Fuel solenoid":0, "Atl Heater Rly":0, "Com Warning":0, "Run Fan Lo":0, "Run Fan Hi":0, "Not Used":0, "Bout - Bit C":0, "Bout - Bit D":0, "Bout - Bit E":0, "Bout - Bit F":0, "Nominal freq":"50 Hz", "GenNomV":240, "GenNomVph-ph":416, "Lo Fan On":76 }
License
Copyright (c) 2020 www.smithtek.com.au Licenced under the terms of the GPLv3
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAMIEN CLARK BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Acknowledgements
We would like to thank the following people for their hard word, time and effort
- Sensorhub.tech
- Nick O'Leary and Dave Conway-Jones for creating Node-Red Contact [email protected] www.smithtek.com.au