It is easy to set POST parameters for HTTP request.
The 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
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.
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
Steps To Set Get Parameters
1) Inject Node
– Payload – can set to anything. In my case I use timestamp
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
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
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
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.
Usage
Expected Power (Watts)
Expected Current (Ampere)
Expected Wire Size - Cross sectional area (mm2)
Advisable Connection Type
Ceiling Fan
75
0.3125
0.5
Direct / Plug
Aircond (1 HP)
750
3.125
1.5
Direct
Water Heater
3,600
15
2.5
Direct
Fridge (450L)
46
0.1917
0.5
Direct / Plug
Air Fryer
1,400
5.83
2.5
Direct
Lamps
75
0.3125
0.5
Direct / Plug
Washing Machine
500
2.083
1.5
Direct
Ampacity based on single phase
Connection Type
This is my own definition not electrician definition. There are two types of connection:-
Use plug to existing plug point
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
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
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
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
1
2
3
4
cross sectional area=pi*(101.9/2)^2
=3.142*50.95^2
=3.142*2,595.9
=8,156.3
cross sectional area of conductor
Recommendation on Wire Size
1
2
3
Ligthing&Ceiling Fan:1.5mm2
Aircond1.5HPandbelow:2.5mm2
Adding newplug/power point:2.5mm2
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 – reference sengpielaudio.com