node-red-contrib-firebase example

Example flow for using the node-red-contrib-firebase nodes.

[{"id":"213f5b28.dec0a4","type":"debug","name":"","active":true,"console":"false","complete":"true","x":377,"y":389,"z":"2c582bd8.d3a7d4","wires":[]},{"id":"912d2b5a.6ed2d8","type":"catch","name":"","x":231,"y":389,"z":"2c582bd8.d3a7d4","wires":[["213f5b28.dec0a4"]]},{"id":"b87b9b56.478468","type":"debug","name":"","active":true,"console":"false","complete":"payload","x":570,"y":229,"z":"2c582bd8.d3a7d4","wires":[]},{"id":"eca2eba.f135d18","type":"comment","name":"firebase.once() example flow","info":"This flow is the same as the\nfirebase.on() example flow, \nexcept that it uses \nfirebase.once(\"value\") to query Firebase\nin the middle of a flow and return a \nresponse synchronously (as opposed to \nstarting a flow whenever the firebase.on()\nevent is triggered).\n\n\nThe inject node begins the flow\nevery 5 seconds and the debug node logs \nthe weather in San Francisco, CA.","x":120.5,"y":193,"z":"2c582bd8.d3a7d4","wires":[]},{"id":"c98d21ea.3672e","type":"firebase.once","name":"","firebaseconfig":"","childpath":"sanfrancisco","eventType":"value","x":345,"y":229,"z":"2c582bd8.d3a7d4","wires":[["b87b9b56.478468"]]},{"id":"2ca7a356.d3585c","type":"inject","name":"","topic":"","payload":"","payloadType":"date","repeat":"5","crontab":"","once":false,"x":127,"y":229,"z":"2c582bd8.d3a7d4","wires":[["c98d21ea.3672e"]]},{"id":"11357167.eeca8f","type":"firebase modify","name":"","firebaseconfig":"","childpath":"myHomeTown","method":"set","x":518,"y":335,"z":"2c582bd8.d3a7d4","wires":[]},{"id":"ef0fcf62.10f03","type":"inject","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"x":125,"y":335,"z":"2c582bd8.d3a7d4","wires":[["d72d6f2a.28d29"]]},{"id":"d72d6f2a.28d29","type":"change","name":"","rules":[{"t":"set","p":"payload","to":"my weather station data..."}],"action":"","property":"","from":"","to":"","reg":false,"x":304,"y":335,"z":"2c582bd8.d3a7d4","wires":[["11357167.eeca8f"]]},{"id":"51aad36.fae552c","type":"comment","name":"firebase modify example flow","info":"This flow attempts to set data at the \nfirebase location.  \n\nUnfortunately, the open data set firebase\nwe are using has security rules in place\nand we are unauthorized!  \n\nThe set node will fail and generate a \nNode-Red error.  The catch node will \nreceive the message that caused this \nerror and log it to the debug tab.\n\nThis flow is fired once at Deploy time\nand when Node-Red is first started up.\nYou can also click the button on the \ninject node to fire it whenever you like.","x":120.5,"y":298,"z":"2c582bd8.d3a7d4","wires":[]},{"id":"885fa9db.77a058","type":"firebase.on","name":"","firebaseconfig":"","childpath":"/nashville","atStart":true,"eventType":"value","x":146,"y":118,"z":"2c582bd8.d3a7d4","wires":[["94393c88.6bc6c"]]},{"id":"94393c88.6bc6c","type":"debug","name":"","active":true,"console":"false","complete":"payload","x":344,"y":118,"z":"2c582bd8.d3a7d4","wires":[]},{"id":"6c02b399.93fd4c","type":"comment","name":"firebase.on() example flow","info":"This flow provides a simple example which\nconnects to the firebase \n[weather](https://publicdata-weather.firebaseio.com/)\n[open data set](https://www.firebase.com/docs/open-data/).\n\nFirebase.on(\"value\") events are fired\nwhenever the weather changes in \nNashville, TN and sent to the debug node.\n\nYou can view the data in the debug tab\nto the right.","x":113,"y":80,"z":"2c582bd8.d3a7d4","wires":[]},{"id":"6bc1f6a5.943e08","type":"comment","name":"-------------------CLICK ME AND READ THE INFO PANE-------------------","info":"Before clicking the Deploy button,\nYou need to configure login credentials \nfor each node with a Red Triangle (all of \nthe Firebase nodes)\n\nYou can add new credentials by double \nclicking on any firebase node and \nclicking on the pencil icon in the top \nright corner of the edit dialog box. \nOnce you have created a set of credentials\nthey will be available in the drop down\nbox.\n\nFor this example, you will want to set\nFirebase to \"publicdata-weather\" \n(without the quotes) and Auth Type to \nNone.","x":245.5,"y":20,"z":"2c582bd8.d3a7d4","wires":[]}]
deldrid1

Flow Info

created 2 years, 7 months ago

Node Types

Core
  • catch (x1)
  • change (x1)
  • comment (x4)
  • debug (x3)
  • inject (x2)
Other

Tags

  • firebase
  • contrib
  • node-red-contrib-firebase
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option