NodeRED for beginners: 6. Function node

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

NotEnoughTECH

NotEnoughTECH

Күн бұрын

Пікірлер: 37
@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
@alcidesmarcano
@alcidesmarcano 6 жыл бұрын
Thanks for the tutorial series! very useful videos
@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
@Y2KSailing
@Y2KSailing 4 жыл бұрын
Thanks, very useful!
@notenoughtech
@notenoughtech 4 жыл бұрын
Enjoy
@restuwahyusaputra7764
@restuwahyusaputra7764 3 жыл бұрын
Great channel i like it
@notenoughtech
@notenoughtech 3 жыл бұрын
I lemon it !
@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 !
@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.
@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.
@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
NodeRED for beginners: 7. Tips & Tricks
7:51
NotEnoughTECH
Рет қаралды 8 М.
Node-RED Tutorial: Email Alerts & Notifications
18:09
Opto Video
Рет қаралды 126 М.
I Turned My Mom into Anxiety Mode! 😆💥 #prank #familyfun #funny
00:32
Motorbike Smashes Into Porsche! 😱
00:15
Caters Clips
Рет қаралды 22 МЛН
Человек паук уже не тот
00:32
Miracle
Рет қаралды 3,6 МЛН
Intro to Node-RED: Part 1 Fundamentals
9:47
Opto Video
Рет қаралды 672 М.
NodeRED for beginners: 4. Data Processing
25:45
NotEnoughTECH
Рет қаралды 31 М.
Node-RED Lesson 9- Function nodes
15:37
Rajvir Singh
Рет қаралды 25 М.
How to Node-RED!
12:58
bitluni
Рет қаралды 376 М.
How to Get Started with MQTT
13:38
Opto Video
Рет қаралды 406 М.
Node-Red Functions
6:55
FreeWave Technologies
Рет қаралды 67 М.
#255 Node-Red, InfluxDB, and Grafana Tutorial on a Raspberry Pi
16:31
Andreas Spiess
Рет қаралды 256 М.
NodeRED for beginners: 1. Why do you need a NodeRED server?
6:12
NotEnoughTECH
Рет қаралды 44 М.
How to Store Data In Node Red Variables
12:23
Steve Cope
Рет қаралды 84 М.
I Turned My Mom into Anxiety Mode! 😆💥 #prank #familyfun #funny
00:32