New to Node Red - trying to decide which route?

Please (please) excuse my ignorance and brevity.

I'm trying to decide between Node Red, Home Assistant and RPi Python.

I used to machine code in the early 1980s but now in my middle 50s,coding is not so easy. But I am aware of flowcharting and logic, etc.

I am going to do a range of mini projects to be combined into a larger whole.

My first project is to take projected weather temps over the next 5 days rolling and charting the trend. That weather data could be from an external Web source (in the correct format) or by a personal weather station or by manual input.

Can Node Red take in external data, calculate and make IF conditions?

Thank you for your kind attention and time to reply - I really do appreciate your help.

Thanks
Kevin

E2a
Sorry, I forgot -

Can I take a library of python code and make a bespoke node? (I'm guessing I can)

Here's a link to a very simple weather report I used with the students on my IoT Club.

2 Likes

It is one of the many tricks Node-RED is very good at.
Node-red is very good at glueing different/similar sources together and providing the logic to manipulate the data and sending it off to another destination (or visualisation)

1 Like

And here's a link to a solar powered weather station - bit more advanced.

1 Like

Thank you enormously, Dave and bakman2

Sometimes it's hard to express gratitude for amazing help. I'll be having a great evening reading up!

I'm very happy to give encouragement for the write up. Please tell me where to contribute.

Many thanks.

Thanks.
I've only used OpenWeatherMap to get current weather conditions.
I'm sure it probably does a 5-day forecast as you mentioned in your original question.

A couple of my students have been working on an extension to the original flow where the information is placed on the Node-RED dashboard with a photo of the place you have selected using the dashboard buttons.

Here's a screen-shot of the dashboard, Node-RED flow and the graphical wiring diagram.

[{"id":"21814bff.6d714c","type":"ui_button","z":"281ef048.a5d9f","name":"","group":"77c3ceb9.1e3b9","order":5,"width":3,"height":1,"passthru":true,"label":"Yateley","tooltip":"","color":"","bgcolor":"","icon":"","payload":"yateley.jpg","payloadType":"str","topic":"","x":200,"y":180,"wires":[["1156f5f0.80d742","8d106146.ccb9"]]},{"id":"46baea97.e49a4c","type":"openweathermap","z":"281ef048.a5d9f","name":"","wtype":"current","lon":"","lat":"","city":"","country":"","language":"en","x":690,"y":180,"wires":[["d8ba386.e8c1fc8"]]},{"id":"d8ba386.e8c1fc8","type":"function","z":"281ef048.a5d9f","name":"","func":"var tempDescription = msg.payload.description;\nvar tempC = msg.payload.tempc;\nvar tempMaxC = msg.payload.temp_maxc;\nvar tempMinC = msg.payload.temp_minc;\n\nreturn [{payload:tempDescription},{payload:tempMaxC},{payload:tempC},{payload:tempMinC}]","outputs":4,"noerr":0,"x":890,"y":180,"wires":[["620bef92.8008a"],["ae9a70c5.f02408"],["35e7805a.4cbf68"],["eb10ec95.5acb58"]]},{"id":"ae9a70c5.f02408","type":"ui_gauge","z":"281ef048.a5d9f","name":"Maximum","group":"77c3ceb9.1e3b9","order":1,"width":4,"height":4,"gtype":"gage","title":"Day - MAX","label":"Degrees C","format":"{{value}}","min":0,"max":"40","colors":["#0080ff","#008040","#ca3838"],"seg1":"10","seg2":"25","x":1060,"y":160,"wires":[]},{"id":"35e7805a.4cbf68","type":"ui_gauge","z":"281ef048.a5d9f","name":"Current temp","group":"77c3ceb9.1e3b9","order":2,"width":4,"height":4,"gtype":"gage","title":"Current","label":"Degrees C","format":"{{value}}","min":0,"max":"40","colors":["#0080ff","#008040","#ca3838"],"seg1":"10","seg2":"25","x":1070,"y":200,"wires":[]},{"id":"eb10ec95.5acb58","type":"ui_gauge","z":"281ef048.a5d9f","name":"Minimum","group":"77c3ceb9.1e3b9","order":3,"width":4,"height":4,"gtype":"gage","title":"Day - MIN","label":"Degrees C","format":"{{value}}","min":0,"max":"40","colors":["#0000ff","#008040","#ca3838"],"seg1":"","seg2":"","x":1060,"y":240,"wires":[]},{"id":"620bef92.8008a","type":"ui_text_input","z":"281ef048.a5d9f","name":"","label":"","tooltip":"","group":"77c3ceb9.1e3b9","order":4,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"","x":1060,"y":120,"wires":[[]]},{"id":"6a2e697a.e0d0a","type":"ui_button","z":"281ef048.a5d9f","name":"","group":"77c3ceb9.1e3b9","order":6,"width":3,"height":1,"passthru":true,"label":"San Francisco","tooltip":"","color":"","bgcolor":"","icon":"","payload":"san_francisco.jpg","payloadType":"str","topic":"","x":220,"y":240,"wires":[["29f5fcf7.8bc8a4","8d106146.ccb9"]]},{"id":"95bc7582.93e95","type":"ui_button","z":"281ef048.a5d9f","name":"","group":"77c3ceb9.1e3b9","order":7,"width":3,"height":1,"passthru":true,"label":"Castleton","tooltip":"","color":"","bgcolor":"","icon":"","payload":"castleton_castle.jpg","payloadType":"str","topic":"","x":200,"y":300,"wires":[["652d51fd.f32aa8","8d106146.ccb9"]]},{"id":"68231f02.1dbd7","type":"ui_button","z":"281ef048.a5d9f","name":"","group":"77c3ceb9.1e3b9","order":8,"width":3,"height":1,"passthru":true,"label":"Damgan","tooltip":"","color":"","bgcolor":"","icon":"","payload":"damgan.jpg","payloadType":"str","topic":"","x":200,"y":360,"wires":[["fc3834e2.623418","8d106146.ccb9"]]},{"id":"1156f5f0.80d742","type":"change","z":"281ef048.a5d9f","name":"","rules":[{"t":"set","p":"location.city","pt":"msg","to":"Yateley","tot":"str"},{"t":"set","p":"location.country","pt":"msg","to":"GB","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":180,"wires":[["46baea97.e49a4c"]]},{"id":"29f5fcf7.8bc8a4","type":"change","z":"281ef048.a5d9f","name":"","rules":[{"t":"set","p":"location.city","pt":"msg","to":"San Francisco","tot":"str"},{"t":"set","p":"location.country","pt":"msg","to":"US","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":240,"wires":[["46baea97.e49a4c"]]},{"id":"8d106146.ccb9","type":"function","z":"281ef048.a5d9f","name":"My server in London","func":"msg.src = \"http://resources-area.co.uk/pics_of_places/\"+msg.payload;\nreturn msg;\n","outputs":1,"noerr":0,"x":480,"y":480,"wires":[["45025291.9526a4"]]},{"id":"652d51fd.f32aa8","type":"change","z":"281ef048.a5d9f","name":"","rules":[{"t":"set","p":"location.city","pt":"msg","to":"castleton","tot":"str"},{"t":"set","p":"location.country","pt":"msg","to":"GB","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":300,"wires":[["46baea97.e49a4c"]]},{"id":"fc3834e2.623418","type":"change","z":"281ef048.a5d9f","name":"","rules":[{"t":"set","p":"location.city","pt":"msg","to":"damgan","tot":"str"},{"t":"set","p":"location.country","pt":"msg","to":"france","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":360,"wires":[["46baea97.e49a4c"]]},{"id":"1fb846a0.20ed29","type":"comment","z":"281ef048.a5d9f","name":"Route to get weather condtions and put them on Dashboard","info":"","x":600,"y":140,"wires":[]},{"id":"d899b00f.1cfea","type":"comment","z":"281ef048.a5d9f","name":"Route to put a photo in the iFrame","info":"","x":520,"y":440,"wires":[]},{"id":"45025291.9526a4","type":"ui_media","z":"281ef048.a5d9f","group":"5a62dddd.f40714","name":"","width":"8","height":"6","order":1,"category":"","file":"","layout":"expand","showcontrols":false,"loop":false,"onstart":false,"scope":"local","tooltip":"","x":1050,"y":480,"wires":[[]]},{"id":"77c3ceb9.1e3b9","type":"ui_group","z":"","name":"Weather report for this location...","tab":"fc17bf3d.8c544","order":1,"disp":true,"width":"12","collapse":false},{"id":"5a62dddd.f40714","type":"ui_group","z":"","name":"Display photo","tab":"fc17bf3d.8c544","order":2,"disp":true,"width":"8","collapse":false},{"id":"fc17bf3d.8c544","type":"ui_tab","z":"","name":"Weather Report","icon":"dashboard","order":1,"disabled":false,"hidden":false}]


Please note:
You will need to get an API key from OpenWeatherMap and adjust the path (from my server where the photos are located) to suit your situation, or source the images locally on your RPi-ZH.

Have fun.

1 Like

I'm out with the dogs just now without my reading glasses but I can just make out your very kind offer - yes, please with a cherry and sugar sprinkles on top!

If I can reciprocate, please do say.

I'll read fully when I'm back indoors.

Thank you!

Hi Dave and bakman2,

I'm new here and only just seen the hearts - you deserve more.

I'm told my RPi Zero WH will be in stock early next month. I'll be getting a bunch of sensors also. Exciting times!

With massive thanks to you, I'm going to spend my while learning Node Red.

Anyway I can help you, please say.

1 Like

You might want to watch this full playlist, it will cover all aspects of node-red and its' use for practical applications.

1 Like

Thanks.

I'll get to it now :wink:

I wish it was possible to award for more than 1 solution.

In answer to your first question - which platform to use - it does not have to be an either or thing - Home Assistant has some very nice prebuilt Lovelace templates that people have put together for Weather reporting, or you can build your own from NR.

When you combine the power of NR and Home Assistant you can get some very nice results.

However for an absolute newbie then starting with NR is probably easiest and the most gratifying and later as you add more components to manage you may wish to try integrating Home Assistant.

Craig

2 Likes

Also a Raspberry Pi Zero is not going to be a very satisfactory platform for you to run NR on - unless you are planning on just using it for some sensors to be connected ?

For the extra cost and flexibility - you are far better off going to a RPi4

Craig

1 Like

Hi Craig,

(I have a lovely cousin called Craig - and I've always been jealous of the name!)

Your answer is valuable. For now I'm using basic sensors and trying to have a tiny bit of my kind of A I (forecasting).

I'm floored in realising that the Pi Zero might not be powerful enough - for the kind of computing I'm used to, it's a beast! Perhaps I need to update my skill set.

Also I chose Pi Zero on cost and size. For now, I'll blindly pursue this but I will buy RPi 4 and thank you always for the valuable heads up you've kindly given me.

All the best, Craig. A huge thank you for your kind attention and support. :wink:

No problems - keep us all updated on how you go

I think one of the other members on here @Trying_to_learn - Andrew has a few Pi Zeros and can probably comment on how he is using those and how he perceives the performance to be

Craig

1 Like

I will do.

I'm humbled by the unstinting generosity of the support here.

Thank you. Thank you enormously, all.

One of my students has reminded me that they built a flow for a 5-day weather forecast using the DarkSky portal last year. Here's a screen-shot of their dashboard.

It makes use of the 'reference' values supplied by DarkSky to show icons for the weather conditions.

PS:
Nothing wrong with the RPi-Zero-W. Great for cutting your teeth with this highly addictive technology.
Although I would agree with Craig that the RPi-4B with 4GB of memory is my preferred choice.

1 Like

I use several pi zeros with mosquitto also installed, with up to about five DS18B20's connected. For simple flows and assuming you don't want to run a GUI on the device then they are fine.

1 Like

Hi Colin,

Yes, I'll be running a screen.

Thanks for your kind reply :wink:
That helps massively.

Pi Zero is now out.

Kevin

Hi Dave,

Many thanks!

Now I don't have to wait for stock of Pi Zero, I'm going to place my order and get my sleeves rolled up!

Thanks for being amazing - all the guys here have been heroes, and you've saved my back. Thank you deeply.

Kevin

Can I just make sure you realise that you don't need a screen on a Pi to run node-red. If you have a PC then you can run the browser in the PC controlling node-red on the Pi. Occasionally you will have to connect from the PC using a terminal but that also is not difficult, even from Windows. Most of my Pis have never had a screen (or mouse or keyboard) connected even for initial setup. In case you are interested then this blog post shows you how to do that.
http://blog.clanlaw.org.uk/pi-headless-server.html

3 Likes

Hi Colin,

I was kind of aware but not really sure.

My project benefits from a screen at this time to see what the sensors are doing and also while I learn.

For sure, you've given me a seriously good idea of ultimately not using a screen. I'm genuinely giddy at the thought!

Thank you again - with a cherry on top!

Kevin