Copyright Micropelt
Node-RED Decoder Encoder
Requirements:
Node-RED
base64 node should be installed
This sample flow uses MQTT data from the Multitech MTCAP Gateway (Modify MQTT Broker and Topic as required).
- 1 Importing Flow and viewing Data
- 2 Screenshots
- 3 Downlink Encoder Example
- 4 MLR003R Downlink Encoder Possible Fields and Values
- 4.1 FPORT 1
- 4.2 FPORT 2 Version
- 4.3 FPORT 3 Motor Travel Distance
- 4.4 FPORT 4 LoRa Data Rate
- 4.5 FPORT 5 Opening Point Detection and Slow Harvesting
- 4.6 FPORT 6 Temperature Drop Detection
- 4.7 FPORT 7 PID Temperature Controller
- 4.8 FPORT 8 Flow Sensor Offset
- 4.9 FPORT 9 External Temperature Sensor Expiry
- 4.10 FPORT 10 External Temperature
- 4.11 FPORT 11 Beep
- 4.12 FPORT 15 On/Off
Importing Flow and viewing Data
Clone the following repository into your PC or download as a ZIP File
The encoders and decoders are organized into three main folders, each representing the product line (MLR003R, MLRTPS and MLRTS). Inside each folder, you will find:
Sample Node_RED flow in
.jsonformatTwo JavaScript files for the Encoder and Decoder
Import the JSON file into Node-RED
Make sure to set the MQTT settings correspondingly in the MQTT IN and OUT Node
Fill in the MQTT topic as required
Enter the DEV EUI in the "Downlink Message" Inject node, to send Downlinks
For Downlink JSON examples refer “Downlink Encoder Example” to section
Screenshots
Downlink Encoder Example
// FPORT_1
{
"userMode": "Ambient_Temperature",
"safetyMode": "Ambient_Temperature",
"setValue": 21,
"roomTemperature": 20,
"safetyValue": 19,
"radioInterval": 5,
"doReferenceRunNow": 0,
"fPort": 1
}
// FPORT 2
{
"fPort": 2
}
// FPORT 3
{
"motor_operating_range": "1.456",
"fPort": 3
}
// FPORT 4
{
"spreading_factor": "SF8",
"fPort": 4
}
// FPORT 5
{
"opening_point_reset": false,
"hot_water_availability": "ON" ,
"slow_harvesting": "DO_OPD_AND_SH",
"max_flow_sensor_raw": 27,
"fPort": 5
}
// FPORT 6
{
"tdd_action": "Close_to_0%_for_30_minutes",
"tdd_beep": false,
"tdd_period": 1,
"fPort": 6
}
// FPORT 7
{
"kP": 20,
"kI": 1.5,
"kD": 21,
"Closed_Percent": 32,
"kD_when_closed": 14,
"Offset_Percent": 42,
"fPort": 7
}
// FPORT 8
{
"Flow_Raw_Value_Offset": 2.5,
"fPort": 8
}
// FPORT 9
{
"External_temperature_sensor_expiry_minutes": 5.
"fPort": 9
}
// FPORT 10
{
"Room_Temperature":22,
"fPort": 10
}
// FPORT 11
{
"Beep":3,
"fPort": 11
}
// FPORT 15
{
"device_will_operate_if_6_week_reference_run_fails": true,
"do_recalibation_now": false,
"turn_off_device": false,
"fPort": 15
}MLR003R Downlink Encoder Possible Fields and Values
FPORT 1
Fields | Possible Values | Description |
|---|---|---|
|
|
|
|
| Set Point Value based on |
|
|
|
|
| Safety Value based on |
|
| Room Temperature from External Sensor |
|
| Radio Communication Interval in Minutes |
|
| 0 = No Reference Run 1 = Do Reference Run now |
FPORT 2 Version
Fields | Possible Values | Description |
|---|---|---|
|
| Sending an empty downlink to FPORT 2, will return the Version details |
FPORT 3 Motor Travel Distance
Fields | Possible Values | Description |
|---|---|---|
|
| Motor operating range (in mm) |
FPORT 4 LoRa Data Rate
Fields | Possible Values | Description |
|---|---|---|
|
| Change Spreading factor of device to SF7 or SF8 |
FPORT 5 Opening Point Detection and Slow Harvesting
Fields | Possible Values | Description |
|---|---|---|
|
| If set to true, Device will set Opening Point Percent to Not Found. |
|
| Use time of year to determine whether hot water is available. Request day/time from gateway. |
| Hot water is off | |
| Hot water is on | |
|
| Default Opening Point Detection and Slow Harvesting. Activation after 8 days of device continuously at 0% |
| Do Opening Point Detection and Slow Harvesting now | |
| Do Opening Point Detection now. Disable Slow Harvesting | |
| Disable Opening Point Detection Disable Slow Harvesting | |
|
| Maximum Flow Sensor Raw Temperature |
FPORT 6 Temperature Drop Detection
Fields | Possible Values | Description |
|---|---|---|
|
| Upon Detection of a Temperature Drop: Take No Action |
| close to 0% for 30 minutes and then resume normal operation | |
| close to 0% for 60 minutes and then resume normal operation | |
|
| When set to true, Beep upon Resumption of Normal Operation |
|
| Activation of Temperature Drop Action after at least 1 or 2 consecutive temperature drops |
FPORT 7 PID Temperature Controller
Fields | Possible Values | Description |
|---|---|---|
|
| P Coefficient |
|
| I Coefficient |
|
| D Coefficient |
|
| Minimum percent that device will close to |
|
| D Coefficient when closed |
|
| Percentage Offset to be added to PID Output |
FPORT 8 Flow Sensor Offset
Fields | Possible Values | Description |
|---|---|---|
|
| Flow Raw Value Offset to be added to the Flow Temperature estimation |
FPORT 9 External Temperature Sensor Expiry
Fields | Possible Values | Description |
|---|---|---|
|
| External Temperature Sensor expiry. (Enter in multiples of 5) If a Room Temperature is sent by Downlink, continue using it until minutes specified in (Until a new room temperature is sent or device loses gateway communication)
|
FPORT 10 External Temperature
Fields | Possible Values | Description |
|---|---|---|
|
| Room Temperature from External Sensor |
FPORT 11 Beep
Fields | Possible Values | Description |
|---|---|---|
|
| Instruct device to beep n times |
FPORT 15 On/Off
Fields | Possible Values | Description |
|---|---|---|
|
| Device will stay on regardless of 6-week Reference Run results |
| If a 6-week Reference Run fails, device will switch off | |
|
| Do a Recalibration Now |
| Will not do a Recalibration | |
|
| Device will move to mounting position and switch OFF |
| Device will be in normal operation |