-
Notifications
You must be signed in to change notification settings - Fork 2
/
node_red_flow.json
1 lines (1 loc) · 17.5 KB
/
node_red_flow.json
1
[{"id":"3c374032842c2d2f","type":"subflow","name":"RSS News Feeds","info":"","category":"","in":[{"x":220,"y":340,"wires":[{"id":"3d02718a23d9fd13"}]}],"out":[{"x":1080,"y":160,"wires":[{"id":"b8b9eef476bcdeac","port":0}]}],"env":[{"name":"QUEUE","type":"str","value":"True"}],"meta":{},"color":"#DDAA99"},{"id":"0913f9beb97e2130","type":"feedparse","z":"3c374032842c2d2f","name":"BBC World","url":"http://feeds.bbci.co.uk/news/world/rss.xml","interval":"1","x":220,"y":80,"wires":[["d1792b42ee5753d2"]]},{"id":"cb3d90a2fe2b0190","type":"feedparse","z":"3c374032842c2d2f","name":"BBC","url":"http://feeds.bbci.co.uk/news/rss.xml","interval":"1","x":230,"y":40,"wires":[["c381284b6070d8da"]]},{"id":"418d42fd4b6db6df","type":"feedparse","z":"3c374032842c2d2f","name":"BBC Technology","url":"http://feeds.bbci.co.uk/news/technology/rss.xml","interval":"1","x":200,"y":160,"wires":[["efe065cc8040e7e8"]]},{"id":"c6ed66404c7a6bc0","type":"feedparse","z":"3c374032842c2d2f","name":"BBC Health","url":"http://feeds.bbci.co.uk/news/health/rss.xml","interval":"1","x":210,"y":120,"wires":[["f9bd4665167a4596"]]},{"id":"a3dca0c13f039fd2","type":"feedparse","z":"3c374032842c2d2f","name":"BBC Science and Environment","url":"http://feeds.bbci.co.uk/news/science_and_environment/rss.xml","interval":"1","x":150,"y":200,"wires":[["9ca7a7aec669c43d"]]},{"id":"2a459cd9b312ea90","type":"feedparse","z":"3c374032842c2d2f","name":"ANSA.it","url":"http://www.ansa.it/sito/notizie/topnews/topnews_rss.xml","interval":"1","x":220,"y":240,"wires":[["abb64e8d41290e40"]]},{"id":"60a31410594d4365","type":"template","z":"3c374032842c2d2f","name":"NR - Format RSS Feed","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{{article.meta.title}}}: {{{article.title}}}.... {{{payload}}}","output":"str","x":710,"y":160,"wires":[["b8b9eef476bcdeac"]]},{"id":"f5a56a9963afacb2","type":"server-events","z":"3c374032842c2d2f","d":true,"name":"","server":"62fbb42a.76d54c","version":1,"event_type":"feedreader","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"outputProperties":[{"property":"topic","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"},{"property":"feed_title","propertyType":"msg","value":"$outputData(\"eventData\").event.title","valueType":"jsonata"},{"property":"feed_summary","propertyType":"msg","value":"$outputData(\"eventData\").event.summary","valueType":"jsonata"}],"x":250,"y":500,"wires":[["710283e478e6c6cd"]]},{"id":"d3db2e9db537cce7","type":"inject","z":"3c374032842c2d2f","name":"Test feed text","props":[{"p":"feed_title","v":"This is a feed test message with these two invalid characters \" and \\ ","vt":"str"},{"p":"feed_summary","v":"Same in the summary \" and \\ !","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":270,"y":560,"wires":[["710283e478e6c6cd"]]},{"id":"710283e478e6c6cd","type":"template","z":"3c374032842c2d2f","name":"HA - Format RSS Feed","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"News Feed: {{{feed_title}}}.... {{{feed_summary}}}","output":"str","x":550,"y":540,"wires":[[]]},{"id":"b8b9eef476bcdeac","type":"change","z":"3c374032842c2d2f","name":"","rules":[{"t":"set","p":"queue","pt":"msg","to":"QUEUE","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":940,"y":160,"wires":[[]]},{"id":"c381284b6070d8da","type":"interval-length","z":"3c374032842c2d2f","format":"mills","bytopic":false,"minimum":"500","maximum":"","window":"","timeout":false,"msgTimeout":"","minimumunit":"msecs","maximumunit":"msecs","windowunit":"msecs","msgTimeoutUnit":"msecs","reset":false,"startup":false,"msgField":"interval","timestampField":"timestamp","repeatTimeout":false,"name":"1 MSG per Half Second","x":430,"y":40,"wires":[["60a31410594d4365"],[]]},{"id":"d1792b42ee5753d2","type":"interval-length","z":"3c374032842c2d2f","format":"mills","bytopic":false,"minimum":"500","maximum":"","window":"","timeout":false,"msgTimeout":"","minimumunit":"msecs","maximumunit":"msecs","windowunit":"msecs","msgTimeoutUnit":"msecs","reset":false,"startup":false,"msgField":"interval","timestampField":"timestamp","repeatTimeout":false,"name":"1 MSG per Half Second","x":430,"y":80,"wires":[["60a31410594d4365"],[]]},{"id":"f9bd4665167a4596","type":"interval-length","z":"3c374032842c2d2f","format":"mills","bytopic":false,"minimum":"500","maximum":"","window":"","timeout":false,"msgTimeout":"","minimumunit":"msecs","maximumunit":"msecs","windowunit":"msecs","msgTimeoutUnit":"msecs","reset":false,"startup":false,"msgField":"interval","timestampField":"timestamp","repeatTimeout":false,"name":"1 MSG per Half Second","x":430,"y":120,"wires":[["60a31410594d4365"],[]]},{"id":"efe065cc8040e7e8","type":"interval-length","z":"3c374032842c2d2f","format":"mills","bytopic":false,"minimum":"500","maximum":"","window":"","timeout":false,"msgTimeout":"","minimumunit":"msecs","maximumunit":"msecs","windowunit":"msecs","msgTimeoutUnit":"msecs","reset":false,"startup":false,"msgField":"interval","timestampField":"timestamp","repeatTimeout":false,"name":"1 MSG per Half Second","x":430,"y":160,"wires":[["60a31410594d4365"],[]]},{"id":"9ca7a7aec669c43d","type":"interval-length","z":"3c374032842c2d2f","format":"mills","bytopic":false,"minimum":"500","maximum":"","window":"","timeout":false,"msgTimeout":"","minimumunit":"msecs","maximumunit":"msecs","windowunit":"msecs","msgTimeoutUnit":"msecs","reset":false,"startup":false,"msgField":"interval","timestampField":"timestamp","repeatTimeout":false,"name":"1 MSG per Half Second","x":430,"y":200,"wires":[["60a31410594d4365"],[]]},{"id":"abb64e8d41290e40","type":"interval-length","z":"3c374032842c2d2f","format":"mills","bytopic":false,"minimum":"500","maximum":"","window":"","timeout":false,"msgTimeout":"","minimumunit":"msecs","maximumunit":"msecs","windowunit":"msecs","msgTimeoutUnit":"msecs","reset":false,"startup":false,"msgField":"interval","timestampField":"timestamp","repeatTimeout":false,"name":"1 MSG per Half Second","x":430,"y":240,"wires":[["60a31410594d4365"],[]]},{"id":"3d02718a23d9fd13","type":"interval-length","z":"3c374032842c2d2f","format":"mills","bytopic":false,"minimum":"500","maximum":"","window":"","timeout":false,"msgTimeout":"","minimumunit":"msecs","maximumunit":"msecs","windowunit":"msecs","msgTimeoutUnit":"msecs","reset":false,"startup":false,"msgField":"interval","timestampField":"timestamp","repeatTimeout":false,"name":"1 MSG per Half Second","x":430,"y":320,"wires":[["b8b9eef476bcdeac"],[]]},{"id":"62fbb42a.76d54c","type":"server","name":"Home Assistant","version":4,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m"},{"id":"ef4f7fab.73edd8","type":"subflow","name":"Message to Dot Matrix HTTP Arg","info":"","category":"","in":[{"x":100,"y":100,"wires":[{"id":"372181f4.110cd6"}]}],"out":[{"x":680,"y":100,"wires":[{"id":"a9c9a85f.482fd8","port":0}]}],"env":[{"name":"IP","type":"str","value":"x.x.x.x"},{"name":"MESSAGE","type":"str","value":"Node Red Payload Undefined. Check your flow!"},{"name":"REPEAT","type":"str","value":"10"},{"name":"BUZZER","type":"str","value":"3"},{"name":"DELAY","type":"str","value":"30"},{"name":"BRIGHTNESS","type":"str","value":"7"},{"name":"USERNAME","type":"str","value":"admin"},{"name":"PASSWORD","type":"str","value":"esp8266"}],"meta":{},"color":"#D7D7A0"},{"id":"a9c9a85f.482fd8","type":"http request","z":"ef4f7fab.73edd8","name":"http to RDA_MAX7219","method":"GET","ret":"txt","paytoqs":"ignore","url":"{{{payload}}}","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"headers":[],"x":500,"y":100,"wires":[[]]},{"id":"372181f4.110cd6","type":"function","z":"ef4f7fab.73edd8","name":"Compose URL","func":"var ip = env.get(\"IP\");\nvar username = env.get(\"USERNAME\");\nvar password = env.get(\"PASSWORD\");\nvar message = env.get(\"MESSAGE\");\nvar repeat = env.get(\"REPEAT\");\nvar buzzer = env.get(\"BUZZER\");\nvar delay = env.get(\"DELAY\");\nvar brightness = env.get(\"BRIGHTNESS\");\n\n\nif (msg.payload == undefined){\n msg.payload = message;\n}\nif (msg.buzzer != undefined){\n buzzer = msg.buzzer;\n}\n\n\n//enable this for http method and NOT for restful HA one\nmsg.payload = \"http://\" + username + \":\" + password + \"@\" + ip + \"/arg?MSG=\" + msg.payload + \"&REP=\" + repeat + \"&BUZ=\" + buzzer + \"&DEL=\" + delay + \"&BRI=\" + brightness + \"&ASC=1\"\nmsg.ipaddress = ip;\nmsg.repeat = repeat;\nmsg.buzzer = buzzer;\nmsg.delay = delay;\nmsg.brightness = brightness;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":260,"y":100,"wires":[["a9c9a85f.482fd8"]]},{"id":"8edb2f9e3fdc26aa","type":"subflow","name":"MQTT to rdadotmatrix","info":"","category":"","in":[{"x":100,"y":260,"wires":[{"id":"84ec65f64f0f89f1"}]}],"out":[{"x":1080,"y":160,"wires":[{"id":"4d4b8de811471834","port":0}]}],"env":[{"name":"MESSAGE","type":"str","value":"This is the default message when unspecified."},{"name":"REPEAT","type":"str","value":"5"},{"name":"BUZZER","type":"str","value":"3"},{"name":"DELAY","type":"str","value":"35"},{"name":"BRIGHTNESS","type":"str","value":"7"},{"name":"ASCII","type":"str","value":"1"},{"name":"MQTT_TOPC","type":"str","value":"rdadotmatrix"}],"meta":{},"color":"#DDAA99"},{"id":"d50e397b5e18b625","type":"function","z":"8edb2f9e3fdc26aa","name":"Replace Invalid Chars","func":"/*This function replaces invalid characters that need \nto be escaped for processing.\nInvalid Characters: \\ \"\n\n*/\n\nvar message = env.get(\"MESSAGE\");\nvar repeat = env.get(\"REPEAT\");\nvar buzzer = env.get(\"BUZZER\");\nvar delay = env.get(\"DELAY\");\nvar brightness = env.get(\"BRIGHTNESS\")\nvar ascii = env.get(\"ASCII\");\n\nif ((msg.payload == \"\")||(msg.payload == undefined)){\n msg.payload = message;\n}\nif ((msg.repeat == \"\")||(msg.repeat == undefined)) {\n msg.repeat = repeat;\n}\nif ((msg.buzzer == \"\")||(msg.buzzer == undefined)){\n msg.buzzer = buzzer;\n}\nif ((msg.delay == \"\")||(msg.delay == undefined)){\n msg.delay = delay;\n}\nif ((msg.brightness == \"\") || (msg.brightness == undefined)) {\n msg.brightness = brightness;\n}\nif ((msg.ascii == \"\")||(msg.ascii == undefined)){\n msg.ascii = ascii;\n}\n\nvar text = msg.payload;\n\ntext = text.replaceAll('\\\\', '\\\\\\\\');\ntext = text.replaceAll('\\\"', '\\\\\"');\nmsg.message = text;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":660,"y":260,"wires":[["4d4b8de811471834"]]},{"id":"4d4b8de811471834","type":"template","z":"8edb2f9e3fdc26aa","name":"Format json","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n \"MSG\": \"{{{message}}}\",\n \"REP\": \"{{{repeat}}}\",\n \"BUZ\": \"{{{buzzer}}}\",\n \"DEL\": \"{{{delay}}}\",\n \"BRI\": \"{{{brightness}}}\",\n \"ASC\": \"{{{ascii}}}\"\n}","output":"str","x":890,"y":260,"wires":[["f282d2925f9d681c"]]},{"id":"f282d2925f9d681c","type":"mqtt out","z":"8edb2f9e3fdc26aa","name":"","topic":"${MQTT_TOPIC}","qos":"2","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"1e16ba516583ae37","x":1140,"y":260,"wires":[]},{"id":"4dbbd469b9d85516","type":"change","z":"8edb2f9e3fdc26aa","name":"Day Setting","rules":[{"t":"set","p":"buzzer","pt":"msg","to":"5","tot":"str"},{"t":"set","p":"brightness","pt":"msg","to":"7","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":220,"wires":[["d50e397b5e18b625"]]},{"id":"84ec65f64f0f89f1","type":"time-range-switch","z":"8edb2f9e3fdc26aa","name":"08:00 - 22:00","lat":"","lon":"","startTime":"08:00","endTime":"22:00","startOffset":0,"endOffset":0,"x":230,"y":260,"wires":[["4dbbd469b9d85516"],["eac0a160a1e7f36d"]]},{"id":"eac0a160a1e7f36d","type":"change","z":"8edb2f9e3fdc26aa","name":"Night Setting","rules":[{"t":"set","p":"buzzer","pt":"msg","to":"0","tot":"str"},{"t":"set","p":"brightness","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":300,"wires":[["d50e397b5e18b625"]]},{"id":"1e16ba516583ae37","type":"mqtt-broker","name":"core-mosquitto","broker":"core-mosquitto","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"5","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""},{"id":"0e3e9099bda9a28e","type":"subflow","name":"Message Queue","info":"","category":"","in":[{"x":40,"y":200,"wires":[{"id":"a9071dc1eecc494b"}]}],"out":[{"x":560,"y":240,"wires":[{"id":"ba7292593428a5f9","port":0},{"id":"a9071dc1eecc494b","port":1}]}],"env":[],"meta":{},"color":"#DDAA99"},{"id":"e7c55e43bc0bc40d","type":"debug","z":"0e3e9099bda9a28e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":350,"y":280,"wires":[]},{"id":"10ba0b438f702479","type":"change","z":"0e3e9099bda9a28e","name":"","rules":[{"t":"set","p":"trigger","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":200,"y":140,"wires":[["ba7292593428a5f9"]]},{"id":"dfeb92ae87dfc76b","type":"inject","z":"0e3e9099bda9a28e","name":"1 minute trigger","props":[{"p":"payload"}],"repeat":"60","crontab":"","once":true,"onceDelay":"0","topic":"","payload":"","payloadType":"date","x":190,"y":80,"wires":[["10ba0b438f702479"]]},{"id":"ba7292593428a5f9","type":"simple-queue","z":"0e3e9099bda9a28e","name":"queue","firstMessageBypass":false,"bypassInterval":"0","x":390,"y":180,"wires":[[]]},{"id":"a9071dc1eecc494b","type":"switch","z":"0e3e9099bda9a28e","name":"To Queue?","property":"queue","propertyType":"msg","rules":[{"t":"eq","v":"True","vt":"str"},{"t":"eq","v":"False","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":190,"y":200,"wires":[["ba7292593428a5f9","e7c55e43bc0bc40d"],[]]},{"id":"a113a26e8741ac79","type":"tab","label":"RDADOTMATRIX","disabled":false,"info":"","env":[]},{"id":"cddf7c9a59066cbd","type":"inject","z":"a113a26e8741ac79","name":"Test ASCII Externded JSON HTTP ARG Message (NOT WORKING)","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"#%&+;!\\$'()*,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~¡¢£€¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ","payloadType":"str","x":300,"y":160,"wires":[["4749b87838c66697"]]},{"id":"bccc4821e626db35","type":"inject","z":"a113a26e8741ac79","name":"Test ASCII Externded JSON MQTT Message","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{MSG:\"#%&+;!\\\"$'()*,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~¡¢£€¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ\",REP:10,BUZ:20,DEL:40,ASC:1}","payloadType":"str","x":230,"y":240,"wires":[["7bdd357d890e0ea1"]]},{"id":"4e0951f5a17e0503","type":"inject","z":"a113a26e8741ac79","name":"Test Simple Message to HTTP ARG Message","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"This is a simple test message!","payloadType":"str","x":230,"y":100,"wires":[["4749b87838c66697"]]},{"id":"b6dbe28add370391","type":"inject","z":"a113a26e8741ac79","name":"Start Message Queue.","props":[{"p":"payload"},{"p":"repeat","v":"5","vt":"str"},{"p":"buzzer","v":"3","vt":"str"},{"p":"delay","v":"35","vt":"str"},{"p":"ascii","v":"1","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"1","topic":"","payload":"Test","payloadType":"str","x":160,"y":340,"wires":[["088b71e5f2082353"]]},{"id":"889499dc0c67d088","type":"subflow:0e3e9099bda9a28e","z":"a113a26e8741ac79","name":"","x":440,"y":360,"wires":[["427a8f474c429b33","7bdd357d890e0ea1"]]},{"id":"63c9a42a74846909","type":"file","z":"a113a26e8741ac79","name":"Message History to File","filename":"/config/message_history.txt","filenameType":"str","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"none","x":950,"y":480,"wires":[[]]},{"id":"12c6911a96a23cce","type":"template","z":"a113a26e8741ac79","name":"Add URL if Any","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{{time}}} {{{payload}}} {{{article.link}}}","output":"str","x":720,"y":480,"wires":[["63c9a42a74846909"]]},{"id":"427a8f474c429b33","type":"function","z":"a113a26e8741ac79","name":"","func":"msg.time = (new Date()).toISOString()\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":480,"wires":[["12c6911a96a23cce"]]},{"id":"7bdd357d890e0ea1","type":"subflow:8edb2f9e3fdc26aa","z":"a113a26e8741ac79","name":"MQTT to rdadotmatrix/generic/json","env":[{"name":"MQTT_TOPC","value":"rdadotmatrix/generic/json","type":"str"}],"x":720,"y":240,"wires":[[]]},{"id":"4749b87838c66697","type":"subflow:ef4f7fab.73edd8","z":"a113a26e8741ac79","name":"","x":760,"y":100,"wires":[[]]},{"id":"088b71e5f2082353","type":"subflow:3c374032842c2d2f","z":"a113a26e8741ac79","name":"","x":230,"y":440,"wires":[["889499dc0c67d088"]]}]