Getting data from weather API

Getting a api string through the http request node convert to json node with json node and the trough change node to extract a specific value see flow for futher explanation thanks to steve from http://www.steves-internet-guide.com/ he has some really informative videos check out his page .

[{"id":"e28683cf.db011","type":"tab","label":"Flow 3","disabled":false,"info":""},{"id":"b09c67c.08cab98","type":"http request","z":"e28683cf.db011","name":"Api request","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://weerlive.nl/api/json-data-10min.php?key=demo&locatie=52.0910879,5.1124231","tls":"","persist":false,"proxy":"","authType":"","x":250,"y":180,"wires":[["99e9c87c.453f18"]]},{"id":"ce83bc4e.4a96b","type":"inject","z":"e28683cf.db011","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":180,"wires":[["b09c67c.08cab98"]]},{"id":"a925b8d9.b61a78","type":"debug","z":"e28683cf.db011","name":"single value from string","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":770,"y":180,"wires":[]},{"id":"d23b6d5.fddfb9","type":"change","z":"e28683cf.db011","name":"Array/object","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.liveweer.temp","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":180,"wires":[["a925b8d9.b61a78"]]},{"id":"99e9c87c.453f18","type":"json","z":"e28683cf.db011","name":"","property":"payload","action":"","pretty":false,"x":390,"y":180,"wires":[["d23b6d5.fddfb9","35512344.00de2c"]]},{"id":"35512344.00de2c","type":"debug","z":"e28683cf.db011","name":"data from string","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":740,"y":140,"wires":[]},{"id":"fcb280a0.17c91","type":"comment","z":"e28683cf.db011","name":"convert to json","info":"gets a string from previous node and\nconvert to json","x":400,"y":100,"wires":[]},{"id":"db02b625.e7df58","type":"comment","z":"e28683cf.db011","name":"Array(open for text)","info":"to acces a certain op object from string\nuse debug to see content:\nfor example if you want to read temp\npayload.liveweer.temp\npayload comes from previous node liveweer is the array and temp an object of th array","x":550,"y":240,"wires":[]}]

Flow Info

Created 4 years, 9 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • change (x1)
  • comment (x2)
  • debug (x2)
  • http request (x1)
  • inject (x1)
  • json (x1)
Other
  • tab (x1)

Tags

  • weather
  • api
  • change
  • htpp
  • request
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option