What are your favorite nodes & cloud services?

Hi OptoFans, especially those who Node-RED,

What Nodes (besides our SNAP and groov nodes) are you using?
Here’s some especially popular ones I’ve seen in practice:

  • Various databases (which do you use?)
  • Ping
  • Email (both send and receive)
  • Modbus (read/write)

We’ve provided various notes and tools on getting info to/from various MSP (managed service provider) and cloud offerings, e.g:

Even before Node-RED we were moving data to various public and private clouds, especially with our EMU (Energy Monitoring Unit) to services like eSight Energy and Pulse Energy, but also:

Now I’m seeing more cloud-based MSPs like:

Where are you getting/sending/keeping your data?
Are you using Node-RED for that? PAC Control’s HttpPOST / GET commands? (Or maybe tcp comm handles from before that?)

Do share!

Thanks,
Mary

I use node-red-contrib-aws to push data to Amazon AWS service. In particular I use the Simple Notification Service to send alarms out. Node-Red sends a message to AWS SNS, which then makes AWS responsible for sending e-mails and/or SMS messages to the subscribers. I also have some subroutines to send messages to AWS from my PAC Control strategy, but I have not used any of it in a production project yet.

This allows me to avoid the headache of keeping up with SMTP security restrictions - it sucks when your alarms don’t make it to the end user - am I right?

2 Likes

Yes! And given how often those certs seem to change these days (darn criminals!!) I love the idea of having AWS worry about all those details for you!

Phillip,

Does the AWS sms service provide any type of delivery receipt/verification?

Thanks
Marty

Looks like it can be setup - if you want a log you need to have some s3 storage for it.

I’m trying to setup the Node-Red Weather Underground and the website says I can’t have a API key unless I have a personal weather station…

Yes, that’s correct. Since this thread is a few years old now, APIs come and go.
I think most people are using darksky now, but there are a few other weather APIs around that are worth a look. I am using OpenSky, OpenWeather and have a Tempest weather station that has a UDP stream that I grab with Node-RED.
Lots of options.

1 Like

6m

Thanks Beno,
I’m looking at OpenWeather and am wondering how to implement the data from OpenWeather into the Groov page example that Mary provided in the link above via Node-Red. Is it as simple as rerouting the URL from Wunderground to OpenWeather or will I need to re-do the whole Groov page?

I just took a high level look at the flows and yeah, looks like the payloads are very close.
It a straight plug and play? No. The OpenWeather payload has just a few subtle differences, but the structure seems like its going to be visually similar end result in groov.

You think you could give me a small example on what I would need to change to get one item to work and maybe I would be able to figure the rest out on my own? Sorry but I am very new to Node-Red and would really appreciate any help without taking too much of your time.

Try this…
Here is part of my OpenWeather flow.
It converts some of the differences.
Import the flow, put your API key in and put some debug nodes around about (set to complete message object) and see what is what.

[{"id":"ff5e6428.b11118","type":"function","z":"6364e20c.ebb584","name":"S to N","func":"msg.payload = parseFloat(msg.payload.current.temp); return msg;","outputs":1,"noerr":0,"x":770,"y":60,"wires":[["2b713da6.9f9752"]]},{"id":"e26208c6.65c98","type":"http request","z":"6364e20c.ebb584","name":"","method":"GET","ret":"obj","paytoqs":false,"url":"https://api.openweathermap.org/data/2.5/onecall?lat=33.496&lon=-117.087&units=imperial&appid=yourapikeygoeshere","tls":"","proxy":"","authType":"","x":530,"y":160,"wires":[["9dc34b77.e4ec88","5930cc8d.aa2ebc","9b330bb2.f0f658","9fca6849.be786","5fe2c04d.80df88","4c381bab.c49634","15759ec2.c9ad11","966ef3d3.8ba8d","cd15cb50.819628","ceee70ed.6924","f4ce7eaa.257ab","ff5e6428.b11118"]]},{"id":"5930cc8d.aa2ebc","type":"function","z":"6364e20c.ebb584","name":"Days","func":"(function() {\n    var days = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];\n\n    var months = ['January','February','March','April','May','June','July','August','September','October','November','December'];\n\n    Date.prototype.getMonthName = function() {\n        return months[ this.getMonth() ];\n    };\n    Date.prototype.getDayName = function() {\n        return days[ this.getDay() ];\n    };\n    \n    Date.prototype.addDays = function(days) {\n        this.setDate(this.getDate() + parseInt(days));\n        return this;\n    };\n})();\n\nmsg = {};\nvar now = new Date();\nmsg.d0 = now.getDayName();\nmsg.d1 = new Date().addDays(1).getDayName(); //+1 days\nmsg.d2 = new Date().addDays(2).getDayName(); //+2 days\nmsg.d3 = new Date().addDays(3).getDayName(); //+3 days\nmsg.d4 = new Date().addDays(4).getDayName(); //+4 days\nmsg.d5 = new Date().addDays(5).getDayName(); //+5 days\n\nmsg.payload=msg.d0;\nvar month = now.getMonthName();\n        node.status({text:msg.payload});\n        \nreturn msg;","outputs":1,"noerr":0,"x":770,"y":100,"wires":[["3eed00b0.3e3148"]]},{"id":"9dc34b77.e4ec88","type":"function","z":"6364e20c.ebb584","name":"T° Hi/Lo","func":"msg.tmin1=Math.round(msg.payload.daily[0].temp.min);\nmsg.tmin2=Math.round(msg.payload.daily[1].temp.min);\nmsg.tmin3=Math.round(msg.payload.daily[2].temp.min);\nmsg.tmin4=Math.round(msg.payload.daily[3].temp.min);\nmsg.tmin5=Math.round(msg.payload.daily[4].temp.min);\nmsg.tmin6=Math.round(msg.payload.daily[5].temp.min);\n\nmsg.tmax1=Math.round(msg.payload.daily[0].temp.max);\nmsg.tmax2=Math.round(msg.payload.daily[1].temp.max);\nmsg.tmax3=Math.round(msg.payload.daily[2].temp.max);\nmsg.tmax4=Math.round(msg.payload.daily[3].temp.max);\nmsg.tmax5=Math.round(msg.payload.daily[4].temp.max);\nmsg.tmax6=Math.round(msg.payload.daily[5].temp.max);\n\nreturn msg;","outputs":1,"noerr":0,"x":780,"y":160,"wires":[["c437c494.e961e8"]]},{"id":"4c381bab.c49634","type":"function","z":"6364e20c.ebb584","name":"string to float","func":"msg.payload = parseFloat(msg.payload.current.humidity);\nreturn msg;","outputs":1,"noerr":0,"x":790,"y":440,"wires":[["76f563b7.c8b5fc"]]},{"id":"15759ec2.c9ad11","type":"function","z":"6364e20c.ebb584","name":"Sunrise","func":"const i = msg.payload.current.sunrise*1000;\nnode.send({payload:i});\n\n//data.sys.sunrise","outputs":1,"noerr":0,"x":780,"y":480,"wires":[["e5f24db8.1aabc","82d8e339.574a7"]]},{"id":"966ef3d3.8ba8d","type":"function","z":"6364e20c.ebb584","name":"Sunset","func":"const i = msg.payload.current.sunset*1000;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":780,"y":520,"wires":[["fd79105a.d95c","447d06e2.be709"]]},{"id":"f4ce7eaa.257ab","type":"function","z":"6364e20c.ebb584","name":"Obs time","func":"const i = msg.payload.current.dt*1000;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":780,"y":560,"wires":[["16552013.804a2"]]}]

Lets know if have any questions, happy to help where we can.

Beno,
Is OpenWerather down for you too? I’m getting this error when getting data.
image

No, its working fine for me.

The error you are getting ‘EHOSTUNREACH’ means that your Node-RED cant find the host (openweathermap.org).

Check your network settings, network cables etc.

Also, try using the network tools from groov Manage. (I would be using traceroute).

1 Like

Okay it was my network connection and I’m back online! I am having an issue pulling in the Sunrise and Sunset times into Groov View. When I run your Sunset/Sunrise functions I get a Unix time stamp.
image




Any Idea how I can get it into a normal human format?

@SlimJim Try the Date toString() or toISOString() time functions.

If those don’t work for you there are lots of other date/time methods on w3schools, and even more details in this forum post: Date Formatting in JavaScript (and OptoScript)

Not to necro this thread, but for those looking to port the darksky API over to something else, OpenWeather has a guide for just that thing (If you want to use OpenWeather).

FYI to the Opto Node-Red people - the Darksky tutorial should probably be updated to Openweather or something else.

1 Like

Hi Nick, thanks for sharing that link.

And it is on my list to do an updated tutorial with OpenWeather specifically, I appreciate knowing there’s some interest in that content!

Hey, just to ressurect your comment @philip , we’re running into a similar issue with excessive SMTP security restrictions and are already running an AWS EC2 server to host our MQTT broker and a Node-Red environment. We’re fairly adept in Node-Red and have played with the SNS nodes with limited success, and your approach of sending direct to AWS from PAC Control is very interesting. Do you have any code you’d be willing to share with me, either from a Node-Red angle or direct from PAC Control? Our biggest struggle has been figuring out how to auto-subscribe users so it’s not too intensive of an infrastructure for us to concern ourselves with actively maintaining it.

I have some PAC Control subroutines for talking to the AWS API, but it is more of a science experiment; I haven’t used it in production. One of the issues is that (like SMTP), you need to keep up to date the CA cert for AWS on the controller.

I would recommend handling the notification through Node-RED as much as possible, since there are more tools there for it. You may want to look into something like Twilio to send SMS messages from Node-RED, even though there is a charge for this. AWS is charging for SMS now as well.

You could also run your own SMTP server.