Node Red Set POST Parameters for HTTP Request

It is easy to set POST parameters for HTTP request.

The Flow Diagram

node red set post parameters for http request flow diagram
node red set post parameters for http request flow diagram

Steps To Set Get Parameters

1) Inject Node

– Payload – can set to anything. In my case I use timestamp

node red inject node
node red inject node

2) Function Node

– Set POST parameters value here
– msg.headers must set the content type.
– All the POST parameters are set inside msg.payload and the parameter names must correspond to RESTFUL API that you query.

node red - function node setting post parameters for http request
node red – function node setting post parameters for http request

3) HTTP Request Node

– Choose method: POST
– Set the correspondent RESTFUL endpoint.

node red - http request node properties
node red – http request node properties

4) Debug Node

– Use to display the output

node red http request post output
node red http request post output

Notes:

Node Red version used – v0.20.7

Node Red Pass GET Parameters for HTTP Request

It is easy to set GET parameters for HTTP request. You need to use the mustache brackets inside the URL itself.

The Flow Diagram

node red http request flow diagram
node red http request flow diagram

Steps To Set Get Parameters

1) Inject Node

– Payload – can set to anything. In my case I use timestamp

node red inject node
node red inject node

2) Function Node

– Set parameter GET value here
– In my case I use parameter name “path” and “limit”, set as msg.path and msg.limit
– You can use any name for your parameter name but it be the same as in HTTP Request Node

node red function node set get http request parameters
node red function node set get http request parameters

3) HTTP Request Node

– Choose method: GET
– In the URL, use mustache brackets to declare your variable {{{path}}}
– The parameter name must be same as in the Function Node

node red http request node
node red http request node

4) Debug Node

– Use to display the output

node red debug output with GET parameter value
node red debug output with GET parameter value

Notes:

Node Red version used – v0.20.7

Node Red Set Parameters HTTP Request GET – Flow File Example

House Wiring Guidelines

I do a lot of new wiring for my properties. Usually I just hire electrician or civil contractors to do wiring without much thought whether the wires they used are suitable or not in term of ampacity (the maximum current the conductor can carry continously).

Until one day, one electrician told me the wires that I used for my fan and lamps are too thin to carry the current. It could pose fire risks. This is eyes opener.

Few days after I got the advise, one of new wiring was overloaded. The wires inside were burnt.

wires burnt due to overload - it is used for fridge and air fryer using 0.75mm wires
wires burnt due to overload – it is used for fridge and air fryer using 0.75mm wires

So I did my own studies as a guidelines to me, so when I hire an electrician I would know whether the wires and the way they connect to the electric power is able to support or no the possible current usage.

Guidelines on Wires Size

This is a guidelines only better check with your trusted or certified electrician.

If the same wire use for fan, lamps, fridge etc, you must add all the amperes and from the derive the required wire cross sectional area.

Of course usually, electrician will put extra buffer for the wire size.

UsageExpected Power (Watts)Expected Current (Ampere)Expected Wire Size - Cross sectional area (mm2)Advisable Connection Type
Ceiling Fan750.31250.5Direct / Plug
Aircond (1 HP)7503.1251.5Direct
Water Heater3,600152.5Direct
Fridge (450L)460.19170.5Direct / Plug
Air Fryer1,4005.832.5Direct
Lamps750.31250.5Direct / Plug
Washing Machine5002.0831.5Direct
Ampacity based on single phase

Connection Type

This is my own definition not electrician definition.  There are two types of connection:-

  1. Use plug to existing plug point
  2. Tap direct into existing wires in plug point.

Use Plug

The maximum current is 13 ampere as the fuse can only handle up to that ampere.

use plug of 13 amp
use plug of 13 amp

Direct Loop to Existing Plug Point

This is better at maximum if not mistaken it is loop directly to existing cable of 2.5mm2 or supported maximum current of around 22 ampere.

loop direct to plug point
loop direct to plug point

What to Avoid For Wiring

Water Heater

For water heater, don’t use plug better use direct loop to existing wires. Especially water heater produces vapor that might cause short circuit and easily makes the wiring wear and tear faster.

burnt plug where water heater using plug
burnt plug where water heater using plug

What is Watt, Ampere & Volts?

Watt is power unit with formula as below:

Watt (W)= Amperage (A) x Voltage (V)

Analogy with water garden hose:-

Water come out from garden hose (watts) = Water volume (Amperage) x Water pressure (voltage)

What is Wire Cross Sectional Area?

It is actually the area size of the wire “circle”. In Math, the formula for area of a circle = pi*radius^2

For example, based on below diagram the cross sectional area calculation

cross sectional area of conductor
cross sectional area of conductor

Recommendation on Wire Size

Recommended Wiring Contractor

Below is my recommended wiring contractor for Shah Alam or Kota Damansara area.

Azworld Tech (Azrin) – 0 17-376 0530

  • Appointment on time
  • Expert and reasonable charging

References

Formula Wheel Electrics
Formula Wheel Electrics – reference sengpielaudio.com
Wire Size - Cross sectional area (mm2)Maximum Current (A)Maximum Powers (Watts)
0.53720
0.7561,440
1.0102,400
1.25133,120
1.5153,600
2.522Can't find the information
4.030Can't find the information
Ampacity based on single phase

Wire Size & Ampacity
Wire Size & Ampacity 2
Wire Size & Ampacity 3
Wire Size & Ampacity 4

Lowyat Forum Discussion on Wiring