smithtek-node-red-eagleio
v2.6.0
Published
Smithtek Node Red EagleIO
Downloads
32
Readme
Installation
Install using the NodeRED palette manager
Usage
The eagleio nodes
connect to the Eagleio IoT platform through its provided Mqtt broker.
The node allows you to send sensor data in the JTS format at a time interval compliant to your eagleio account plan.
To use this node you must have an active EagleIO account at: https://eagle.io/
Setup eagleio
In your eagleio account you need to set a new workspace/location/JTS
file source.
Click the dropdown on the JTS file source, scroll down and click properties.
In the general settings select:
File type
= Json time seriesWrite mode
= Merge and overwrite
In the connection settings select:
Transport type
= Publish to eagleioTopic
= eagleio will automatically create the topic endpoint. You need the last part of the topic for your node configuration username.Authentication
= CONNECT messagePassword
= your secret password, this will be required in the node configuration later!
Save your changes and remember your topic url.
It will be something like:
“io/eagle/source/blablablogs”
Setup NodeRED
Open the eagleio node and enter new credentials:
Username
= your username used for the JTS connection. This is also the end of your Mqtt topic.
Password
= your eagleio password used for the JTS connection.
Payload input
The payload must be a Json object
with the payload value and topic of the sensor.
A function node can pass a payload wired to its input like so:
msg.payload = {"sensor":25.6}
Or multiple key/values { “sensor1”:25.6, "sensor2":34.6, "sensor3":55.2 }
You can inject as many payloads from various sensors to the eagleio node. It will constantly update the JTS file. The timestamp format node will add the timestamp to any json object passed through it. The EagleIO node will take the timestamp from this and use it in the sensor records. This is useful for Store&Forward, saving the data locally should the Mqtt connection fail, the sensor data will have the correct timestamp when it forwards.
Payload Publish
You can publish the data to eagleio at a time interval of your choice within the T&C of your plan.
To publish you must send a bool “true”
with the topic “Publish”
Remember to use upper case "P" "Publish"
The simplest way is to use an inject node
or function node and set it to inject at your chosen times.
Copy this exact code into a function node
msg.payload = true; msg.topic = "Publish"; return msg;
SmithTek EagleIO Time Node for Node-RED
The smithtek-eagleio-time
node is a custom Node-RED node designed to handle time selection for your Node-RED flows. It allows you to select between using the current time from Node-RED or an externally injected time.
Functionality
- Internal Time: If this option is selected, the node will always use the current time from the Node-RED server. This is the default selection.
- External Time: If this option is selected and the input message contains a property named
timestamp
, the node will use the external time as the timestamp. If the input message does not contain atimestamp
property, the node will use the current time from Node-RED and give a warning "External time not available. Using current time."
The selected time is appended to the payload of the message as a timestamp
property in ISO string format. This is required as per the EagleIO JTS format rules
How to Use
- Drag and drop the
smithtek-eagleio-time
node into your flow. - Double click the node to open its configuration options.
- Select the desired time selection checking the check box:
Internal Time
orExternal Time
. - If you selected
External Time
, ensure that the input message to this node contains a "timestamp" property in a format that can be parsed by JavaScript'sDate()
function. The "time" property should represent the desired timestamp. and example of the time stamp is"timestamp": "2020-06-29T13:45:25.700Z"
A typical json message to the input using external time would look like{ "direction": 213, "speed": 3.2, "pressure": 1010.7, "relative humidity": 56, "temperature": 17.51, "dewpoint": 8.8, "total precipitation": 0, "precipitation intensity": 0, "dc supply": 13.3, "status": 0, "timestamp": "2020-06-29T13:45:25.700Z" }
- Connect the node's output to the next node in your flow. The output message will contain a
timestamp
property in its payload.
Note: The node will ask for a redeploy whenever the time selection is changed. This is necessary for the changes to take effect.
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