NodeRED for beginners: 6. Function node

  Рет қаралды 32,321

NotEnoughTECH

NotEnoughTECH

Күн бұрын

Пікірлер: 37
@dannydzware2023
@dannydzware2023 5 жыл бұрын
Thank you very much. I am new to node red. Maybe you can help me: is there a chance that you can do a video about blinking LED and creating a running light like an Audi (car) blinking light. I have absolutely no idea how to do it. Thanks for your help.
@notenoughtech
@notenoughtech 5 жыл бұрын
NodeRed can control the GPIO on raspberry pi. There it more than one way to resolve it. I believe Audi actually have it resolved by using hardware delay between the LEDs on the strip otherwise you would have to time each LED and that depends on how you going to connect the leds
@MrAtarifreak
@MrAtarifreak 5 жыл бұрын
Thanks for this tutorial. I like the way you explain it.
@هبةمهديصالحالموسوي
@هبةمهديصالحالموسوي 2 жыл бұрын
Hi.can you help me please how can l do machine classification for hart signals using nod red l already did the classification in R code
@restuwahyusaputra7764
@restuwahyusaputra7764 3 жыл бұрын
Great channel i like it
@notenoughtech
@notenoughtech 3 жыл бұрын
I lemon it !
@alcidesmarcano
@alcidesmarcano 6 жыл бұрын
Thanks for the tutorial series! very useful videos
@Y2KSailing
@Y2KSailing 4 жыл бұрын
Thanks, very useful!
@notenoughtech
@notenoughtech 4 жыл бұрын
Enjoy
@davidm.5968
@davidm.5968 3 жыл бұрын
Hi thank you for your videos, one question , is possible in nodered with node fuction , add the payload of 2 sensors into one, exemple 223v sensor 1 200v sensor2: equal 1 sensor with value 423V ? thanks a lot
@notenoughtech
@notenoughtech 3 жыл бұрын
Yes. You can store the value using context.set() when sensor A reports and add the value to sensor B just use separate msg.topic for each so you know which sensor is which.
@davidm.5968
@davidm.5968 3 жыл бұрын
@@notenoughtech thanks a lot , it’s possible to write all the fuction, because I,m very noob with node red , and I don’t know how can I do it Thanks
@notenoughtech
@notenoughtech 3 жыл бұрын
try this: [{"id":"4df53d45.2952d4","type":"function","z":"76cad92f.121798","name":"2 Sensors","func":"//please name your sensors \"sensorA\" & \"sensorB\" in msg.topic for each sensor, //the node will return only when both sensors submit values if(msg.topic === \"sensorA\"){ var sensorA = msg.payload; context.set(\"sensorA\", sensorA); } if(msg.topic === \"sensorB\"){ var sensorB = msg.payload; context.set(\"sensorB\", sensorB); } var A = context.get(\"sensorA\"); var B = context.get(\"sensorB\"); if(A !== null && B !== null){ msg.payload = A+B; context.set(\"sensorB\", null); context.set(\"sensorA\", null); return msg; } ","outputs":1,"noerr":0,"initialize":"// Code added here will be run once // whenever the node is started. context.set(\"sensorB\", null); context.set(\"sensorA\", null);","finalize":"","libs":[],"x":230,"y":300,"wires":[[]]}]
@davidm.5968
@davidm.5968 3 жыл бұрын
@@notenoughtech thanks a lot , this afternoon I try and comment the result
@davidm.5968
@davidm.5968 3 жыл бұрын
I try , and works perfectly, thanks a lot for help. thank you very much
@bystander7325
@bystander7325 5 жыл бұрын
Great English ! Congrats from Poland :P
@notenoughtech
@notenoughtech 5 жыл бұрын
Dziekuje :) robie co moge!
@bystander7325
@bystander7325 5 жыл бұрын
@@notenoughtech As I absolutely want you to keep this amazing channel international, let me reply in english :P Amazing work, Node-Red allows beginners to achieve breathtaking results with just some technical knowledge, and YOU make it possible. Thx again, respect !
@mmanimator12
@mmanimator12 4 жыл бұрын
I wonder if you know how to pass 3 different inputs to 3 outputs using function node? So, 1st input would pass to 1st output, 2nd input would pass to 2nd output and so forth
@notenoughtech
@notenoughtech 4 жыл бұрын
return [msg1, msg2, msg3] each msg should have an object ie var msg1 = {payload: your_payload, ID: your_id}. Then on input Create if conditions for msg.ID
@mmanimator12
@mmanimator12 4 жыл бұрын
@@notenoughtech Thank you for your response! I tried that but it didn't work, probably I didn't do it right but I ended up using join node and it worked.
@notenoughtech
@notenoughtech 4 жыл бұрын
I'm actually writing about this as it's a good topic
@mmanimator12
@mmanimator12 4 жыл бұрын
@@notenoughtech That would be really awesome 👌
@notenoughtech
@notenoughtech 4 жыл бұрын
Follow me on one of social media as this one comes without video if you want a notification
@alijahangir3143
@alijahangir3143 5 жыл бұрын
Amazing explanation. i m getting temperature value (msg.payload) from a function how do i turn something on or off connected to pi gpio based on temperature. stuck on this. help would be much appreciated.
@notenoughtech
@notenoughtech 5 жыл бұрын
Nodered comes with gpio nodes. While I have no tutorials on that it shouldn't be more complicated than selecting the pin and pulling it LOW/HIGH as required
@alijahangir3143
@alijahangir3143 5 жыл бұрын
@@notenoughtech i am new to this. i connected the function to rpi gpio node. dont know how put a condition in function. if payload value is above 40 gipo should turn high if less then 40 remain low.
@annespacedroid
@annespacedroid 6 жыл бұрын
Hi boss. I have a function node that sends a msg.payload as a notification through Google mini. I'm looking for a way to insert msg.emitVolume - 60, which plays the notification at 60% volume. Any idea how I pass that msg.emitVolume through with only some of the out putted messages I have?. I use the "Google home notify" with volume adjustment (msg.emitVolume = ?). If I type into the function:- msg.emitVolume = 60 msg.payload = (whatever you choose) return msg; I get the notification at the correct volume, just unsure how to send msg.emitVolume with multiple messages. I've watched some of your other tuts & thank you for those.
@notenoughtech
@notenoughtech 6 жыл бұрын
Currently, I'm using node-red-contrib-cast as the node google-notify stopped working for me some time ago. Anyway - if so, you can simply set msg.volume or msg.payload.volume to a number 0-100 to set the volume. so your object would look like this msg.payload = "Hey test message"; msg.volume = 50; return msg;
@annespacedroid
@annespacedroid 6 жыл бұрын
@@notenoughtech wow, what a speedy response. I'll try that when I get home. My nodered-contrib-cast stopped working as well, so I changed it for the new one, and it works again. Which has also volume adjustments via "msg.emitVolume =xx". Will let you know how it goes. Cheers
@notenoughtech
@notenoughtech 6 жыл бұрын
Just make sure the node is updated - see the palette manager
@annespacedroid
@annespacedroid 6 жыл бұрын
@@notenoughtech I'm actually using "node-red-contrib-google-home-notify-volume-adjustable", it's the latest update. This is what I have as a single msg, and works fine. msg.emitVolume = 50 msg.payload = 'Anything you type' return msg; As stated, all works as expected with volume at 50%. I'm trying to create a function node with more than 2 messages & be able to change the volume for each msg. I need to output 5 messages & be able to set the volume on them individually. What I'm trying to do is:- (example) if msg.payload = 1, return "On" at 50% Volume if msg.payload = 2, return "Off" at 50% Volume if msg.payload = 3, return "Standby" at 75% Volume if msg.payload = 4, return "Sleeping" at 75% Volume. if msg.payload = 5, return "Overheat" at 100% Volume I have all the payload outputs for msg.payload set, just trying to change the volume, dependant upon the msg. Any help is greatly appreciated.
@notenoughtech
@notenoughtech 6 жыл бұрын
There is an example of if statement in the function node tutorial you can use this and modify the outcomes.
NodeRED for beginners: 7. Tips & Tricks
7:51
NotEnoughTECH
Рет қаралды 8 М.
Storing data into variables | Node-RED Essentials | Tutorial
13:20
Let's Automate
Рет қаралды 8 М.
MAGIC TIME ​⁠@Whoispelagheya
00:28
MasomkaMagic
Рет қаралды 38 МЛН
This dad wins Halloween! 🎃💀
01:00
Justin Flom
Рет қаралды 64 МЛН
Disrespect or Respect 💔❤️
00:27
Thiago Productions
Рет қаралды 29 МЛН
The Singing Challenge #joker #Harriet Quinn
00:35
佐助与鸣人
Рет қаралды 18 МЛН
NodeRED for beginners: 4. Data Processing
25:45
NotEnoughTECH
Рет қаралды 31 М.
Intro to JSON for Node-RED
12:58
Opto Video
Рет қаралды 53 М.
NodeRED for beginners: 5. Connectivity
24:05
NotEnoughTECH
Рет қаралды 12 М.
Node-RED Lesson 9- Function nodes
15:37
Rajvir Singh
Рет қаралды 25 М.
How to use context storage in Node-RED to save data
13:07
Opto Video
Рет қаралды 28 М.
Getting Started with Node RED Dashboard
59:13
FlowFuse
Рет қаралды 9 М.
Power consumption monitoring in Node Red
41:27
Csongor Varga
Рет қаралды 27 М.
An introduction to running Node Red on the Cerbo GX
22:33
PKYS Inc
Рет қаралды 10 М.
How to create a data table in Node RED Dashboard
20:02
Opto Video
Рет қаралды 66 М.
Error handling and logging in Node-Red
30:31
Csongor Varga
Рет қаралды 1,5 М.
MAGIC TIME ​⁠@Whoispelagheya
00:28
MasomkaMagic
Рет қаралды 38 МЛН