-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode-red-announcer-flow.json
More file actions
1 lines (1 loc) · 5.19 KB
/
node-red-announcer-flow.json
File metadata and controls
1 lines (1 loc) · 5.19 KB
1
[{"id":"afdad340469dd9d3","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"08c6f5b9d241ef17","type":"ha-entity","z":"afdad340469dd9d3","name":"","server":"7874f07a.dd83f","version":2,"debugenabled":false,"outputs":2,"entityType":"switch","config":[{"property":"name","value":"Lovelace Button"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"","outputPayloadType":"str","x":110,"y":240,"wires":[["0a19a85f0ac68f61","3c7ad5013e6f8ae7","a8a4397a7ddfedf9"],[]]},{"id":"0a19a85f0ac68f61","type":"function","z":"afdad340469dd9d3","name":"DC Request","func":"var message;\n\nif (global.get(\"homeassistant.homeAssistant.states['input_text.matroparen_text'].state\") == \"\") {\n message = \"Matdax!\";\n} else {\n message = global.get(\"homeassistant.homeAssistant.states['input_text.matroparen_text'].state\");\n}\n\nif (global.get(\"homeassistant.homeAssistant.states['input_select.matroparen_vem'].state\") == \"name\" || global.get(\"homeassistant.homeAssistant.states['input_select.matroparen_vem'].state\") == \"Both\") {\n msg.method = \"POST\";\n msg.url = \"https://discordapp.com/api/webhooks//\";\n msg.payload = { \"content\": message };\n return msg;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":390,"y":200,"wires":[["a00736dcc8b8c48a"]]},{"id":"a00736dcc8b8c48a","type":"http request","z":"afdad340469dd9d3","name":"","method":"use","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"credentials":{"user":"","password":""},"x":610,"y":200,"wires":[["0d694ab3c96414a8","f99d32651f8ddfa5"]]},{"id":"3c7ad5013e6f8ae7","type":"function","z":"afdad340469dd9d3","name":"Nest Request","func":"var message;\n\nif (global.get(\"homeassistant.homeAssistant.states['input_text.matroparen_text'].state\") == \"\") {\n message = \"Matdax!\";\n} else {\n message = global.get(\"homeassistant.homeAssistant.states['input_text.matroparen_text'].state\");\n}\n\nif (global.get(\"homeassistant.homeAssistant.states['input_select.matroparen_vem'].state\") == \"Name\" || global.get(\"homeassistant.homeAssistant.states['input_select.matroparen_vem'].state\") == \"Båda\") {\n msg.method = \"POST\";\n msg.url = \"http://ip:8123/api/webhook/food\";\n msg.payload = { \"value1\": message };\n return msg;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":400,"y":240,"wires":[["dd4d7cb39c7d3ef7"]]},{"id":"dd4d7cb39c7d3ef7","type":"http request","z":"afdad340469dd9d3","name":"","method":"use","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":610,"y":240,"wires":[["0d694ab3c96414a8"]]},{"id":"a8a4397a7ddfedf9","type":"function","z":"afdad340469dd9d3","name":"DC Request 2","func":"var message;\n\nif (global.get(\"homeassistant.homeAssistant.states['input_text.matroparen_text'].state\") == \"\") {\n message = \"Matdax!\";\n} else {\n message = global.get(\"homeassistant.homeAssistant.states['input_text.matroparen_text'].state\");\n}\n\nif (global.get(\"homeassistant.homeAssistant.states['input_select.matroparen_vem'].state\") == \"name\" || global.get(\"homeassistant.homeAssistant.states['input_select.matroparen_vem'].state\") == \"Both\") {\n msg.method = \"POST\";\n msg.url = \"https://discord.com/api/webhooks//\";\n msg.payload = {\"content\": message};\n return msg;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":400,"y":320,"wires":[["6ba40ed11ef5bc26"]]},{"id":"6ba40ed11ef5bc26","type":"http request","z":"afdad340469dd9d3","name":"","method":"use","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":610,"y":320,"wires":[["0d694ab3c96414a8","f99d32651f8ddfa5"]]},{"id":"0d694ab3c96414a8","type":"debug","z":"afdad340469dd9d3","name":"debug 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":880,"y":400,"wires":[]},{"id":"f99d32651f8ddfa5","type":"api-call-service","z":"afdad340469dd9d3","name":"","server":"7874f07a.dd83f","version":5,"debugenabled":false,"domain":"browser_mod","service":"notification","areaId":[],"deviceId":[],"entityId":[],"data":"{\"message\":\"Matroparen skickad!\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"first","x":890,"y":240,"wires":[[]]},{"id":"7874f07a.dd83f","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"}]