├── .gitignore ├── README.md ├── flows.json ├── flows_cred.json └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | *.backup -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | cookbook-flows 2 | ============== 3 | 4 | This is a Node-RED Project that contains all of the recipes from the 5 | [Node-RED Cookbook](https://cookbook.nodered.org). 6 | 7 | 8 | This project can be imported by enabling the Projects feature of Node-RED and then 9 | cloning this repository in the editor. -------------------------------------------------------------------------------- /flows.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "535331d8.55c1f", 4 | "type": "tab", 5 | "label": "Basics - Messages", 6 | "disabled": false, 7 | "info": "" 8 | }, 9 | { 10 | "id": "ac14500e.2c57d", 11 | "type": "tab", 12 | "label": "Basics - Flow control", 13 | "disabled": false, 14 | "info": "" 15 | }, 16 | { 17 | "id": "fc046f99.4be08", 18 | "type": "tab", 19 | "label": "Basics - Error handling", 20 | "disabled": false, 21 | "info": "" 22 | }, 23 | { 24 | "id": "64133d39.bb0394", 25 | "type": "tab", 26 | "label": "Basic - Working with data formats", 27 | "disabled": false, 28 | "info": "" 29 | }, 30 | { 31 | "id": "3045204d.cfbae", 32 | "type": "tab", 33 | "label": "HTTP endpoints", 34 | "disabled": false, 35 | "info": "" 36 | }, 37 | { 38 | "id": "55635136.aa9cb", 39 | "type": "tab", 40 | "label": "HTTP requests", 41 | "disabled": false, 42 | "info": "" 43 | }, 44 | { 45 | "id": "b571704d.6c591", 46 | "type": "tab", 47 | "label": "MQTT", 48 | "disabled": true, 49 | "info": "" 50 | }, 51 | { 52 | "id": "b439d8b0.991988", 53 | "type": "mqtt-broker", 54 | "z": "", 55 | "name": "", 56 | "broker": "localhost", 57 | "port": "1883", 58 | "clientid": "", 59 | "usetls": false, 60 | "compatmode": true, 61 | "keepalive": "60", 62 | "cleansession": true, 63 | "birthTopic": "", 64 | "birthQos": "0", 65 | "birthPayload": "", 66 | "closeTopic": "", 67 | "closePayload": "", 68 | "willTopic": "", 69 | "willQos": "0", 70 | "willPayload": "" 71 | }, 72 | { 73 | "id": "59ff2a1.fa600d4", 74 | "type": "http in", 75 | "z": "3045204d.cfbae", 76 | "name": "", 77 | "url": "/hello", 78 | "method": "get", 79 | "swaggerDoc": "", 80 | "x": 100, 81 | "y": 80, 82 | "wires": [ 83 | [ 84 | "54c1e70d.ab3e18" 85 | ] 86 | ] 87 | }, 88 | { 89 | "id": "266c286f.d993d8", 90 | "type": "http response", 91 | "z": "3045204d.cfbae", 92 | "name": "", 93 | "x": 390, 94 | "y": 80, 95 | "wires": [] 96 | }, 97 | { 98 | "id": "54c1e70d.ab3e18", 99 | "type": "template", 100 | "z": "3045204d.cfbae", 101 | "name": "page", 102 | "field": "payload", 103 | "fieldType": "msg", 104 | "format": "handlebars", 105 | "syntax": "mustache", 106 | "template": "\n \n \n

Hello World!

\n \n", 107 | "x": 250, 108 | "y": 80, 109 | "wires": [ 110 | [ 111 | "266c286f.d993d8" 112 | ] 113 | ] 114 | }, 115 | { 116 | "id": "1052941d.efad6c", 117 | "type": "http in", 118 | "z": "3045204d.cfbae", 119 | "name": "", 120 | "url": "/hello-query", 121 | "method": "get", 122 | "swaggerDoc": "", 123 | "x": 120, 124 | "y": 180, 125 | "wires": [ 126 | [ 127 | "b34dd1af.4cb23" 128 | ] 129 | ] 130 | }, 131 | { 132 | "id": "b828f6a6.47d708", 133 | "type": "http response", 134 | "z": "3045204d.cfbae", 135 | "name": "", 136 | "x": 430, 137 | "y": 180, 138 | "wires": [] 139 | }, 140 | { 141 | "id": "b34dd1af.4cb23", 142 | "type": "template", 143 | "z": "3045204d.cfbae", 144 | "name": "page", 145 | "field": "payload", 146 | "fieldType": "msg", 147 | "format": "handlebars", 148 | "syntax": "mustache", 149 | "template": "\n \n \n

Hello {{req.query.name}}!

\n \n", 150 | "x": 290, 151 | "y": 180, 152 | "wires": [ 153 | [ 154 | "b828f6a6.47d708" 155 | ] 156 | ] 157 | }, 158 | { 159 | "id": "ce53954b.31ac68", 160 | "type": "http response", 161 | "z": "3045204d.cfbae", 162 | "name": "", 163 | "x": 490, 164 | "y": 280, 165 | "wires": [] 166 | }, 167 | { 168 | "id": "288a7c0.fd77584", 169 | "type": "template", 170 | "z": "3045204d.cfbae", 171 | "name": "page", 172 | "field": "payload", 173 | "fieldType": "msg", 174 | "format": "handlebars", 175 | "syntax": "mustache", 176 | "template": "\n \n \n

Hello {{req.params.name}}!

\n \n", 177 | "x": 350, 178 | "y": 280, 179 | "wires": [ 180 | [ 181 | "ce53954b.31ac68" 182 | ] 183 | ] 184 | }, 185 | { 186 | "id": "7665c67d.899a38", 187 | "type": "http in", 188 | "z": "3045204d.cfbae", 189 | "name": "", 190 | "url": "/hello-param/:name", 191 | "method": "get", 192 | "swaggerDoc": "", 193 | "x": 150, 194 | "y": 280, 195 | "wires": [ 196 | [ 197 | "288a7c0.fd77584" 198 | ] 199 | ] 200 | }, 201 | { 202 | "id": "92eaf6c0.6d1508", 203 | "type": "inject", 204 | "z": "3045204d.cfbae", 205 | "name": "", 206 | "topic": "", 207 | "payload": "", 208 | "payloadType": "date", 209 | "repeat": "", 210 | "crontab": "", 211 | "once": false, 212 | "x": 100, 213 | "y": 480, 214 | "wires": [ 215 | [ 216 | "8055b557.7faa48" 217 | ] 218 | ] 219 | }, 220 | { 221 | "id": "8055b557.7faa48", 222 | "type": "change", 223 | "z": "3045204d.cfbae", 224 | "name": "Store time", 225 | "rules": [ 226 | { 227 | "t": "set", 228 | "p": "timestamp", 229 | "pt": "flow", 230 | "to": "payload", 231 | "tot": "msg" 232 | } 233 | ], 234 | "action": "", 235 | "property": "", 236 | "from": "", 237 | "to": "", 238 | "reg": false, 239 | "x": 270, 240 | "y": 480, 241 | "wires": [ 242 | [] 243 | ] 244 | }, 245 | { 246 | "id": "93bf2335.6c40e", 247 | "type": "http in", 248 | "z": "3045204d.cfbae", 249 | "name": "", 250 | "url": "/hello-data", 251 | "method": "get", 252 | "swaggerDoc": "", 253 | "x": 120, 254 | "y": 520, 255 | "wires": [ 256 | [ 257 | "9e3aa25e.61c56" 258 | ] 259 | ] 260 | }, 261 | { 262 | "id": "def756a1.2108a8", 263 | "type": "http response", 264 | "z": "3045204d.cfbae", 265 | "name": "", 266 | "x": 610, 267 | "y": 520, 268 | "wires": [] 269 | }, 270 | { 271 | "id": "f2c385a.f0d3c78", 272 | "type": "template", 273 | "z": "3045204d.cfbae", 274 | "name": "page", 275 | "field": "payload", 276 | "fieldType": "msg", 277 | "format": "handlebars", 278 | "syntax": "mustache", 279 | "template": "\n \n \n

Time: {{ timestamp }}

\n \n", 280 | "x": 470, 281 | "y": 520, 282 | "wires": [ 283 | [ 284 | "def756a1.2108a8" 285 | ] 286 | ] 287 | }, 288 | { 289 | "id": "9e3aa25e.61c56", 290 | "type": "change", 291 | "z": "3045204d.cfbae", 292 | "name": "Copy time", 293 | "rules": [ 294 | { 295 | "t": "set", 296 | "p": "timestamp", 297 | "pt": "msg", 298 | "to": "timestamp", 299 | "tot": "flow" 300 | } 301 | ], 302 | "action": "", 303 | "property": "", 304 | "from": "", 305 | "to": "", 306 | "reg": false, 307 | "x": 310, 308 | "y": 520, 309 | "wires": [ 310 | [ 311 | "f2c385a.f0d3c78" 312 | ] 313 | ] 314 | }, 315 | { 316 | "id": "291d5680.d6e2aa", 317 | "type": "comment", 318 | "z": "3045204d.cfbae", 319 | "name": "Create an HTTP Endpoint", 320 | "info": " curl http://localhost:1880/hello", 321 | "x": 130, 322 | "y": 40, 323 | "wires": [] 324 | }, 325 | { 326 | "id": "f26288ce.0d9d78", 327 | "type": "comment", 328 | "z": "3045204d.cfbae", 329 | "name": "Handle query parameters passed to an HTTP endpoint", 330 | "info": " curl http://localhost:1880/hello-query?name=Nick", 331 | "x": 220, 332 | "y": 140, 333 | "wires": [] 334 | }, 335 | { 336 | "id": "f7d4f2bf.082b1", 337 | "type": "comment", 338 | "z": "3045204d.cfbae", 339 | "name": "Handle url parameters in an HTTP endpoint", 340 | "info": " curl http://localhost:1880/hello-query/Nick", 341 | "x": 190, 342 | "y": 240, 343 | "wires": [] 344 | }, 345 | { 346 | "id": "97c71382.6838f", 347 | "type": "comment", 348 | "z": "3045204d.cfbae", 349 | "name": "Include data captured in another flow", 350 | "info": " curl http://localhost:1880/hello-data", 351 | "x": 170, 352 | "y": 440, 353 | "wires": [] 354 | }, 355 | { 356 | "id": "c8107088.37ef9", 357 | "type": "http in", 358 | "z": "3045204d.cfbae", 359 | "name": "", 360 | "url": "/hello-json", 361 | "method": "get", 362 | "swaggerDoc": "", 363 | "x": 120, 364 | "y": 620, 365 | "wires": [ 366 | [ 367 | "4e8237da.b17dc8" 368 | ] 369 | ] 370 | }, 371 | { 372 | "id": "f7d3e35a.082c2", 373 | "type": "http response", 374 | "z": "3045204d.cfbae", 375 | "name": "", 376 | "x": 610, 377 | "y": 620, 378 | "wires": [] 379 | }, 380 | { 381 | "id": "4e8237da.b17dc8", 382 | "type": "template", 383 | "z": "3045204d.cfbae", 384 | "name": "page", 385 | "field": "payload", 386 | "fieldType": "msg", 387 | "format": "handlebars", 388 | "syntax": "mustache", 389 | "template": "{ \"Hello\": \"World\" }", 390 | "x": 290, 391 | "y": 620, 392 | "wires": [ 393 | [ 394 | "65401623.9abfe8" 395 | ] 396 | ] 397 | }, 398 | { 399 | "id": "d737e5a0.28c818", 400 | "type": "comment", 401 | "z": "3045204d.cfbae", 402 | "name": "Serve JSON content", 403 | "info": " curl http://localhost:1880/hello-json", 404 | "x": 110, 405 | "y": 580, 406 | "wires": [] 407 | }, 408 | { 409 | "id": "65401623.9abfe8", 410 | "type": "change", 411 | "z": "3045204d.cfbae", 412 | "name": "Set Headers", 413 | "rules": [ 414 | { 415 | "t": "set", 416 | "p": "headers", 417 | "pt": "msg", 418 | "to": "{}", 419 | "tot": "json" 420 | }, 421 | { 422 | "t": "set", 423 | "p": "headers.content-type", 424 | "pt": "msg", 425 | "to": "application/json", 426 | "tot": "str" 427 | } 428 | ], 429 | "action": "", 430 | "property": "", 431 | "from": "", 432 | "to": "", 433 | "reg": false, 434 | "x": 450, 435 | "y": 620, 436 | "wires": [ 437 | [ 438 | "f7d3e35a.082c2" 439 | ] 440 | ] 441 | }, 442 | { 443 | "id": "c7e341a0.381cc", 444 | "type": "http in", 445 | "z": "3045204d.cfbae", 446 | "name": "", 447 | "url": "/hello-file", 448 | "method": "get", 449 | "swaggerDoc": "", 450 | "x": 110, 451 | "y": 720, 452 | "wires": [ 453 | [ 454 | "2fb1c354.d04e3c" 455 | ] 456 | ] 457 | }, 458 | { 459 | "id": "88974243.7768c", 460 | "type": "http response", 461 | "z": "3045204d.cfbae", 462 | "name": "", 463 | "x": 610, 464 | "y": 720, 465 | "wires": [] 466 | }, 467 | { 468 | "id": "84fb0840.7b04f8", 469 | "type": "comment", 470 | "z": "3045204d.cfbae", 471 | "name": "Serve a local file", 472 | "info": "Without content-type set, the browser will\ndownload the file rather than display it.\n\nNeed to set content-type to the correct\nmime type for the file.\n\n curl http://localhost:1880/hello-file", 473 | "x": 100, 474 | "y": 680, 475 | "wires": [] 476 | }, 477 | { 478 | "id": "c9e28681.361d78", 479 | "type": "change", 480 | "z": "3045204d.cfbae", 481 | "name": "Set Headers", 482 | "rules": [ 483 | { 484 | "t": "set", 485 | "p": "headers", 486 | "pt": "msg", 487 | "to": "{}", 488 | "tot": "json" 489 | }, 490 | { 491 | "t": "set", 492 | "p": "headers.content-type", 493 | "pt": "msg", 494 | "to": "image/png", 495 | "tot": "str" 496 | } 497 | ], 498 | "action": "", 499 | "property": "", 500 | "from": "", 501 | "to": "", 502 | "reg": false, 503 | "x": 470, 504 | "y": 720, 505 | "wires": [ 506 | [ 507 | "88974243.7768c" 508 | ] 509 | ] 510 | }, 511 | { 512 | "id": "2fb1c354.d04e3c", 513 | "type": "file in", 514 | "z": "3045204d.cfbae", 515 | "name": "", 516 | "filename": "/tmp/node-red.png", 517 | "format": "", 518 | "x": 290, 519 | "y": 720, 520 | "wires": [ 521 | [ 522 | "c9e28681.361d78" 523 | ] 524 | ] 525 | }, 526 | { 527 | "id": "5b98a8ac.a46758", 528 | "type": "http in", 529 | "z": "3045204d.cfbae", 530 | "name": "", 531 | "url": "/hello-form", 532 | "method": "post", 533 | "swaggerDoc": "", 534 | "x": 120, 535 | "y": 920, 536 | "wires": [ 537 | [ 538 | "bba61009.4459f" 539 | ] 540 | ] 541 | }, 542 | { 543 | "id": "bba61009.4459f", 544 | "type": "template", 545 | "z": "3045204d.cfbae", 546 | "name": "page", 547 | "field": "payload", 548 | "fieldType": "msg", 549 | "format": "handlebars", 550 | "syntax": "mustache", 551 | "template": "\n \n \n

Hello {{ payload.name }}!

\n \n", 552 | "x": 290, 553 | "y": 920, 554 | "wires": [ 555 | [ 556 | "6ceb930a.93146c" 557 | ] 558 | ] 559 | }, 560 | { 561 | "id": "6ceb930a.93146c", 562 | "type": "http response", 563 | "z": "3045204d.cfbae", 564 | "name": "", 565 | "x": 430, 566 | "y": 920, 567 | "wires": [] 568 | }, 569 | { 570 | "id": "f9cc40a3.0633c", 571 | "type": "comment", 572 | "z": "3045204d.cfbae", 573 | "name": "Post form/JSON data", 574 | "info": "Posting form data - `application/x-www-form-urlencoded`\n\n curl -X POST -d \"name=Nick\" http://localhost:1880/hello-form\n \n \nPosting JSON data - `application/json`\n\n curl -X POST -d '{\"name\":\"Nick\"}' -h \"Content-type: application/json\" http://localhost:1880/hello-form", 575 | "x": 120, 576 | "y": 880, 577 | "wires": [] 578 | }, 579 | { 580 | "id": "3e1c5107.c1e3ae", 581 | "type": "http in", 582 | "z": "3045204d.cfbae", 583 | "name": "", 584 | "url": "/hello-raw", 585 | "method": "post", 586 | "swaggerDoc": "", 587 | "x": 120, 588 | "y": 820, 589 | "wires": [ 590 | [ 591 | "cf679478.309868" 592 | ] 593 | ] 594 | }, 595 | { 596 | "id": "cf679478.309868", 597 | "type": "template", 598 | "z": "3045204d.cfbae", 599 | "name": "page", 600 | "field": "payload", 601 | "fieldType": "msg", 602 | "format": "handlebars", 603 | "syntax": "mustache", 604 | "template": "\n \n \n

Hello {{ payload }}!

\n \n", 605 | "x": 290, 606 | "y": 820, 607 | "wires": [ 608 | [ 609 | "f3c1a3f0.0c3e6" 610 | ] 611 | ] 612 | }, 613 | { 614 | "id": "f3c1a3f0.0c3e6", 615 | "type": "http response", 616 | "z": "3045204d.cfbae", 617 | "name": "", 618 | "x": 430, 619 | "y": 820, 620 | "wires": [] 621 | }, 622 | { 623 | "id": "932fb31d.6cd05", 624 | "type": "comment", 625 | "z": "3045204d.cfbae", 626 | "name": "Post raw data", 627 | "info": "Posting raw data - `text/plain`\n\n curl -X POST -d 'Nick' -h \"Content-type: text/plain\" http://localhost:1880/hello-raw", 628 | "x": 90, 629 | "y": 780, 630 | "wires": [] 631 | }, 632 | { 633 | "id": "b3531892.4cace8", 634 | "type": "http response", 635 | "z": "3045204d.cfbae", 636 | "name": "", 637 | "x": 450, 638 | "y": 380, 639 | "wires": [] 640 | }, 641 | { 642 | "id": "24199456.dbe66c", 643 | "type": "template", 644 | "z": "3045204d.cfbae", 645 | "name": "page", 646 | "field": "payload", 647 | "fieldType": "msg", 648 | "format": "handlebars", 649 | "syntax": "mustache", 650 | "template": "\n \n \n

User agent: {{req.headers.user-agent}}

\n \n", 651 | "x": 310, 652 | "y": 380, 653 | "wires": [ 654 | [ 655 | "b3531892.4cace8" 656 | ] 657 | ] 658 | }, 659 | { 660 | "id": "c1460268.3eba", 661 | "type": "http in", 662 | "z": "3045204d.cfbae", 663 | "name": "", 664 | "url": "/hello-headers", 665 | "method": "get", 666 | "swaggerDoc": "", 667 | "x": 130, 668 | "y": 380, 669 | "wires": [ 670 | [ 671 | "24199456.dbe66c" 672 | ] 673 | ] 674 | }, 675 | { 676 | "id": "b134c227.4ecb4", 677 | "type": "comment", 678 | "z": "3045204d.cfbae", 679 | "name": "Access HTTP request headers", 680 | "info": " curl http://localhost:1880/hello-query/Nick", 681 | "x": 140, 682 | "y": 340, 683 | "wires": [] 684 | }, 685 | { 686 | "id": "7c87b536.83784c", 687 | "type": "inject", 688 | "z": "55635136.aa9cb", 689 | "name": "", 690 | "topic": "", 691 | "payload": "", 692 | "payloadType": "date", 693 | "repeat": "", 694 | "crontab": "", 695 | "once": false, 696 | "x": 100, 697 | "y": 80, 698 | "wires": [ 699 | [ 700 | "7de918a6.8216e8" 701 | ] 702 | ] 703 | }, 704 | { 705 | "id": "7de918a6.8216e8", 706 | "type": "http request", 707 | "z": "55635136.aa9cb", 708 | "name": "", 709 | "method": "GET", 710 | "ret": "txt", 711 | "url": "http://localhost:1880/hello", 712 | "x": 270, 713 | "y": 80, 714 | "wires": [ 715 | [ 716 | "b7f7541b.4808a8" 717 | ] 718 | ] 719 | }, 720 | { 721 | "id": "b7f7541b.4808a8", 722 | "type": "debug", 723 | "z": "55635136.aa9cb", 724 | "name": "", 725 | "active": true, 726 | "console": "false", 727 | "complete": "false", 728 | "x": 450, 729 | "y": 80, 730 | "wires": [] 731 | }, 732 | { 733 | "id": "ff8148a.f007eb8", 734 | "type": "comment", 735 | "z": "55635136.aa9cb", 736 | "name": "Simple GET request", 737 | "info": " curl http://localhost:1880/hello", 738 | "x": 110, 739 | "y": 40, 740 | "wires": [] 741 | }, 742 | { 743 | "id": "b327e181.4cd82", 744 | "type": "debug", 745 | "z": "55635136.aa9cb", 746 | "name": "", 747 | "active": true, 748 | "console": "false", 749 | "complete": "false", 750 | "x": 630, 751 | "y": 180, 752 | "wires": [] 753 | }, 754 | { 755 | "id": "46c6f199.b9391", 756 | "type": "http request", 757 | "z": "55635136.aa9cb", 758 | "name": "", 759 | "method": "GET", 760 | "ret": "txt", 761 | "url": "", 762 | "x": 450, 763 | "y": 180, 764 | "wires": [ 765 | [ 766 | "b327e181.4cd82" 767 | ] 768 | ] 769 | }, 770 | { 771 | "id": "4ff96482.b0069c", 772 | "type": "inject", 773 | "z": "55635136.aa9cb", 774 | "name": "", 775 | "topic": "", 776 | "payload": "", 777 | "payloadType": "date", 778 | "repeat": "", 779 | "crontab": "", 780 | "once": false, 781 | "x": 100, 782 | "y": 180, 783 | "wires": [ 784 | [ 785 | "4ed40187.b12c" 786 | ] 787 | ] 788 | }, 789 | { 790 | "id": "f448390.f0bb7c8", 791 | "type": "comment", 792 | "z": "55635136.aa9cb", 793 | "name": "Set the url of a request", 794 | "info": "", 795 | "x": 120, 796 | "y": 140, 797 | "wires": [] 798 | }, 799 | { 800 | "id": "4ed40187.b12c", 801 | "type": "change", 802 | "z": "55635136.aa9cb", 803 | "name": "", 804 | "rules": [ 805 | { 806 | "t": "set", 807 | "p": "url", 808 | "pt": "msg", 809 | "to": "http://localhost:1880/hello", 810 | "tot": "str" 811 | } 812 | ], 813 | "action": "", 814 | "property": "", 815 | "from": "", 816 | "to": "", 817 | "reg": false, 818 | "x": 270, 819 | "y": 180, 820 | "wires": [ 821 | [ 822 | "46c6f199.b9391" 823 | ] 824 | ] 825 | }, 826 | { 827 | "id": "5b4b474b.a4b4b8", 828 | "type": "debug", 829 | "z": "55635136.aa9cb", 830 | "name": "", 831 | "active": true, 832 | "console": "false", 833 | "complete": "false", 834 | "x": 430, 835 | "y": 280, 836 | "wires": [] 837 | }, 838 | { 839 | "id": "71e9d373.8e162c", 840 | "type": "http request", 841 | "z": "55635136.aa9cb", 842 | "name": "", 843 | "method": "GET", 844 | "ret": "txt", 845 | "url": "http://localhost:1880/{{payload}}", 846 | "x": 250, 847 | "y": 280, 848 | "wires": [ 849 | [ 850 | "5b4b474b.a4b4b8" 851 | ] 852 | ] 853 | }, 854 | { 855 | "id": "c472d104.3b8d3", 856 | "type": "inject", 857 | "z": "55635136.aa9cb", 858 | "name": "", 859 | "topic": "", 860 | "payload": "hello", 861 | "payloadType": "str", 862 | "repeat": "", 863 | "crontab": "", 864 | "once": false, 865 | "x": 90, 866 | "y": 280, 867 | "wires": [ 868 | [ 869 | "71e9d373.8e162c" 870 | ] 871 | ] 872 | }, 873 | { 874 | "id": "4ebc2616.b143d8", 875 | "type": "comment", 876 | "z": "55635136.aa9cb", 877 | "name": "Set the url of a request using a template", 878 | "info": "", 879 | "x": 170, 880 | "y": 240, 881 | "wires": [] 882 | }, 883 | { 884 | "id": "c6cf0634.3930f8", 885 | "type": "comment", 886 | "z": "55635136.aa9cb", 887 | "name": "Get a parsed JSON response", 888 | "info": "", 889 | "x": 140, 890 | "y": 440, 891 | "wires": [] 892 | }, 893 | { 894 | "id": "8affc21e.75004", 895 | "type": "http request", 896 | "z": "55635136.aa9cb", 897 | "name": "", 898 | "method": "GET", 899 | "ret": "obj", 900 | "url": "http://localhost:1880/hello-json", 901 | "x": 270, 902 | "y": 480, 903 | "wires": [ 904 | [ 905 | "43ea475.fbc15b8" 906 | ] 907 | ] 908 | }, 909 | { 910 | "id": "aa440812.55bbf8", 911 | "type": "inject", 912 | "z": "55635136.aa9cb", 913 | "name": "", 914 | "topic": "", 915 | "payload": "", 916 | "payloadType": "date", 917 | "repeat": "", 918 | "crontab": "", 919 | "once": false, 920 | "x": 100, 921 | "y": 480, 922 | "wires": [ 923 | [ 924 | "8affc21e.75004" 925 | ] 926 | ] 927 | }, 928 | { 929 | "id": "43ea475.fbc15b8", 930 | "type": "debug", 931 | "z": "55635136.aa9cb", 932 | "name": "", 933 | "active": true, 934 | "console": "false", 935 | "complete": "false", 936 | "x": 450, 937 | "y": 480, 938 | "wires": [] 939 | }, 940 | { 941 | "id": "f57bc2d1.0a844", 942 | "type": "comment", 943 | "z": "55635136.aa9cb", 944 | "name": "Get a binary response", 945 | "info": "", 946 | "x": 120, 947 | "y": 540, 948 | "wires": [] 949 | }, 950 | { 951 | "id": "32d77788.cd2888", 952 | "type": "http request", 953 | "z": "55635136.aa9cb", 954 | "name": "", 955 | "method": "GET", 956 | "ret": "bin", 957 | "url": "http://localhost:1880/hello-file", 958 | "x": 270, 959 | "y": 580, 960 | "wires": [ 961 | [ 962 | "7822845c.87dd7c" 963 | ] 964 | ] 965 | }, 966 | { 967 | "id": "22b454a3.dd4bac", 968 | "type": "inject", 969 | "z": "55635136.aa9cb", 970 | "name": "", 971 | "topic": "", 972 | "payload": "", 973 | "payloadType": "date", 974 | "repeat": "", 975 | "crontab": "", 976 | "once": false, 977 | "x": 100, 978 | "y": 580, 979 | "wires": [ 980 | [ 981 | "32d77788.cd2888" 982 | ] 983 | ] 984 | }, 985 | { 986 | "id": "7822845c.87dd7c", 987 | "type": "debug", 988 | "z": "55635136.aa9cb", 989 | "name": "", 990 | "active": true, 991 | "console": "false", 992 | "complete": "false", 993 | "x": 450, 994 | "y": 580, 995 | "wires": [] 996 | }, 997 | { 998 | "id": "ee917332.116e9", 999 | "type": "comment", 1000 | "z": "55635136.aa9cb", 1001 | "name": "Set a request header", 1002 | "info": "", 1003 | "x": 110, 1004 | "y": 640, 1005 | "wires": [] 1006 | }, 1007 | { 1008 | "id": "95b08db.f6a4f7", 1009 | "type": "http request", 1010 | "z": "55635136.aa9cb", 1011 | "name": "", 1012 | "method": "GET", 1013 | "ret": "txt", 1014 | "url": "http://localhost:1880/hello-headers", 1015 | "x": 510, 1016 | "y": 680, 1017 | "wires": [ 1018 | [ 1019 | "709ae1bd.8f652" 1020 | ] 1021 | ] 1022 | }, 1023 | { 1024 | "id": "eb1c00a6.14e4", 1025 | "type": "inject", 1026 | "z": "55635136.aa9cb", 1027 | "name": "", 1028 | "topic": "", 1029 | "payload": "", 1030 | "payloadType": "date", 1031 | "repeat": "", 1032 | "crontab": "", 1033 | "once": false, 1034 | "x": 100, 1035 | "y": 680, 1036 | "wires": [ 1037 | [ 1038 | "9edab692.612548" 1039 | ] 1040 | ] 1041 | }, 1042 | { 1043 | "id": "709ae1bd.8f652", 1044 | "type": "debug", 1045 | "z": "55635136.aa9cb", 1046 | "name": "", 1047 | "active": true, 1048 | "console": "false", 1049 | "complete": "false", 1050 | "x": 690, 1051 | "y": 680, 1052 | "wires": [] 1053 | }, 1054 | { 1055 | "id": "9edab692.612548", 1056 | "type": "change", 1057 | "z": "55635136.aa9cb", 1058 | "name": "Set user-agent header", 1059 | "rules": [ 1060 | { 1061 | "t": "set", 1062 | "p": "headers", 1063 | "pt": "msg", 1064 | "to": "{}", 1065 | "tot": "json" 1066 | }, 1067 | { 1068 | "t": "set", 1069 | "p": "headers.user-agent", 1070 | "pt": "msg", 1071 | "to": "Node-RED", 1072 | "tot": "str" 1073 | } 1074 | ], 1075 | "action": "", 1076 | "property": "", 1077 | "from": "", 1078 | "to": "", 1079 | "reg": false, 1080 | "x": 300, 1081 | "y": 680, 1082 | "wires": [ 1083 | [ 1084 | "95b08db.f6a4f7" 1085 | ] 1086 | ] 1087 | }, 1088 | { 1089 | "id": "2e423233.d1bdce", 1090 | "type": "debug", 1091 | "z": "55635136.aa9cb", 1092 | "name": "", 1093 | "active": true, 1094 | "console": "false", 1095 | "complete": "false", 1096 | "x": 710, 1097 | "y": 380, 1098 | "wires": [] 1099 | }, 1100 | { 1101 | "id": "3da6c27e.c2593e", 1102 | "type": "http request", 1103 | "z": "55635136.aa9cb", 1104 | "name": "", 1105 | "method": "GET", 1106 | "ret": "txt", 1107 | "url": "http://localhost:1880/hello-query?{{{querystring}}}", 1108 | "x": 530, 1109 | "y": 380, 1110 | "wires": [ 1111 | [ 1112 | "2e423233.d1bdce" 1113 | ] 1114 | ] 1115 | }, 1116 | { 1117 | "id": "7a12b5ce.85ed4c", 1118 | "type": "inject", 1119 | "z": "55635136.aa9cb", 1120 | "name": "", 1121 | "topic": "", 1122 | "payload": "{\"name\":\"Nick\"}", 1123 | "payloadType": "json", 1124 | "repeat": "", 1125 | "crontab": "", 1126 | "once": false, 1127 | "x": 120, 1128 | "y": 380, 1129 | "wires": [ 1130 | [ 1131 | "6b4a532f.94b5ac" 1132 | ] 1133 | ] 1134 | }, 1135 | { 1136 | "id": "73e91392.8c16ec", 1137 | "type": "comment", 1138 | "z": "55635136.aa9cb", 1139 | "name": "Set query string parameters", 1140 | "info": "The url template must use {{{triple}}}-braces\nso it doesn't get escaped", 1141 | "x": 140, 1142 | "y": 340, 1143 | "wires": [] 1144 | }, 1145 | { 1146 | "id": "6b4a532f.94b5ac", 1147 | "type": "function", 1148 | "z": "55635136.aa9cb", 1149 | "name": "Create query string", 1150 | "func": "var params = [];\nfor (var i in msg.payload) {\n params.push(encodeURIComponent(i)+\"=\"+encodeURIComponent(msg.payload[i]));\n}\nmsg.querystring = params.join(\"&\");\n\nreturn msg;", 1151 | "outputs": 1, 1152 | "noerr": 0, 1153 | "x": 330, 1154 | "y": 380, 1155 | "wires": [ 1156 | [ 1157 | "3da6c27e.c2593e" 1158 | ] 1159 | ] 1160 | }, 1161 | { 1162 | "id": "2ce1c654.d31e3a", 1163 | "type": "comment", 1164 | "z": "55635136.aa9cb", 1165 | "name": "* Respond with the result of an HTTP request", 1166 | "info": " curl http://localhost:1880/hello-proxy", 1167 | "x": 190, 1168 | "y": 740, 1169 | "wires": [] 1170 | }, 1171 | { 1172 | "id": "469ba167.b9646", 1173 | "type": "http in", 1174 | "z": "55635136.aa9cb", 1175 | "name": "", 1176 | "url": "/hello-proxy", 1177 | "method": "get", 1178 | "swaggerDoc": "", 1179 | "x": 100, 1180 | "y": 780, 1181 | "wires": [ 1182 | [ 1183 | "5b9e37fc.a461c8" 1184 | ] 1185 | ] 1186 | }, 1187 | { 1188 | "id": "682a00c2.97d6", 1189 | "type": "change", 1190 | "z": "55635136.aa9cb", 1191 | "name": "Clear headers", 1192 | "rules": [ 1193 | { 1194 | "t": "delete", 1195 | "p": "headers", 1196 | "pt": "msg" 1197 | } 1198 | ], 1199 | "action": "", 1200 | "property": "", 1201 | "from": "", 1202 | "to": "", 1203 | "reg": false, 1204 | "x": 480, 1205 | "y": 780, 1206 | "wires": [ 1207 | [ 1208 | "ffdd6315.0022a" 1209 | ] 1210 | ] 1211 | }, 1212 | { 1213 | "id": "ffdd6315.0022a", 1214 | "type": "http response", 1215 | "z": "55635136.aa9cb", 1216 | "name": "", 1217 | "x": 650, 1218 | "y": 780, 1219 | "wires": [] 1220 | }, 1221 | { 1222 | "id": "5b9e37fc.a461c8", 1223 | "type": "http request", 1224 | "z": "55635136.aa9cb", 1225 | "name": "", 1226 | "method": "GET", 1227 | "ret": "txt", 1228 | "url": "http://localhost:1880/hello", 1229 | "x": 290, 1230 | "y": 780, 1231 | "wires": [ 1232 | [ 1233 | "682a00c2.97d6" 1234 | ] 1235 | ] 1236 | }, 1237 | { 1238 | "id": "c362b989.954ae8", 1239 | "type": "http in", 1240 | "z": "3045204d.cfbae", 1241 | "name": "", 1242 | "url": "/hello-cookie", 1243 | "method": "get", 1244 | "swaggerDoc": "", 1245 | "x": 130, 1246 | "y": 1020, 1247 | "wires": [ 1248 | [ 1249 | "21ddf71f.d00518" 1250 | ] 1251 | ] 1252 | }, 1253 | { 1254 | "id": "f3aa98c1.befc18", 1255 | "type": "template", 1256 | "z": "3045204d.cfbae", 1257 | "name": "page", 1258 | "field": "payload", 1259 | "fieldType": "msg", 1260 | "format": "handlebars", 1261 | "syntax": "mustache", 1262 | "template": "\n \n \n

Cookies

\n

Add a cookieClear cookies

\n
{{ payload }}
\n \n", 1263 | "x": 530, 1264 | "y": 1020, 1265 | "wires": [ 1266 | [ 1267 | "f52e2880.180968" 1268 | ] 1269 | ] 1270 | }, 1271 | { 1272 | "id": "f52e2880.180968", 1273 | "type": "http response", 1274 | "z": "3045204d.cfbae", 1275 | "name": "", 1276 | "x": 750, 1277 | "y": 1020, 1278 | "wires": [] 1279 | }, 1280 | { 1281 | "id": "64ff5340.82cb0c", 1282 | "type": "comment", 1283 | "z": "3045204d.cfbae", 1284 | "name": "Work with cookies", 1285 | "info": "", 1286 | "x": 110, 1287 | "y": 980, 1288 | "wires": [] 1289 | }, 1290 | { 1291 | "id": "fda60c66.04975", 1292 | "type": "http in", 1293 | "z": "3045204d.cfbae", 1294 | "name": "", 1295 | "url": "/hello-cookie/add", 1296 | "method": "get", 1297 | "swaggerDoc": "", 1298 | "x": 140, 1299 | "y": 1060, 1300 | "wires": [ 1301 | [ 1302 | "afefb90.53dcf48" 1303 | ] 1304 | ] 1305 | }, 1306 | { 1307 | "id": "afefb90.53dcf48", 1308 | "type": "function", 1309 | "z": "3045204d.cfbae", 1310 | "name": "Add a cookie", 1311 | "func": "msg.cookies = { };\nmsg.cookies[\"demo-\"+(Math.floor(Math.random()*1000))] = Date.now();\nreturn msg;", 1312 | "outputs": 1, 1313 | "noerr": 0, 1314 | "x": 330, 1315 | "y": 1060, 1316 | "wires": [ 1317 | [ 1318 | "9a2a9a4.0fc0768" 1319 | ] 1320 | ] 1321 | }, 1322 | { 1323 | "id": "35285a76.1f8636", 1324 | "type": "http in", 1325 | "z": "3045204d.cfbae", 1326 | "name": "", 1327 | "url": "/hello-cookie/clear", 1328 | "method": "get", 1329 | "swaggerDoc": "", 1330 | "x": 140, 1331 | "y": 1100, 1332 | "wires": [ 1333 | [ 1334 | "d5205a2c.db9018" 1335 | ] 1336 | ] 1337 | }, 1338 | { 1339 | "id": "d5205a2c.db9018", 1340 | "type": "function", 1341 | "z": "3045204d.cfbae", 1342 | "name": "Clear cookies", 1343 | "func": "// Find demo cookies and clear them\nvar cookieNames = Object.keys(msg.req.cookies).filter(function(cookieName) { return /^demo-/.test(cookieName);});\nmsg.cookies = {};\n\ncookieNames.forEach(function(cookieName) {\n msg.cookies[cookieName] = null;\n});\n\nreturn msg;", 1344 | "outputs": 1, 1345 | "noerr": 0, 1346 | "x": 340, 1347 | "y": 1100, 1348 | "wires": [ 1349 | [ 1350 | "9a2a9a4.0fc0768" 1351 | ] 1352 | ] 1353 | }, 1354 | { 1355 | "id": "9a2a9a4.0fc0768", 1356 | "type": "change", 1357 | "z": "3045204d.cfbae", 1358 | "name": "Redirect to /hello-cookie", 1359 | "rules": [ 1360 | { 1361 | "t": "set", 1362 | "p": "statusCode", 1363 | "pt": "msg", 1364 | "to": "302", 1365 | "tot": "num" 1366 | }, 1367 | { 1368 | "t": "set", 1369 | "p": "headers", 1370 | "pt": "msg", 1371 | "to": "{}", 1372 | "tot": "json" 1373 | }, 1374 | { 1375 | "t": "set", 1376 | "p": "headers.location", 1377 | "pt": "msg", 1378 | "to": "/hello-cookie", 1379 | "tot": "str" 1380 | } 1381 | ], 1382 | "action": "", 1383 | "property": "", 1384 | "from": "", 1385 | "to": "", 1386 | "reg": false, 1387 | "x": 550, 1388 | "y": 1080, 1389 | "wires": [ 1390 | [ 1391 | "f52e2880.180968" 1392 | ] 1393 | ] 1394 | }, 1395 | { 1396 | "id": "21ddf71f.d00518", 1397 | "type": "function", 1398 | "z": "3045204d.cfbae", 1399 | "name": "Format cookies", 1400 | "func": "msg.payload = JSON.stringify(msg.req.cookies,null,4);\nreturn msg;", 1401 | "outputs": 1, 1402 | "noerr": 0, 1403 | "x": 340, 1404 | "y": 1020, 1405 | "wires": [ 1406 | [ 1407 | "f3aa98c1.befc18" 1408 | ] 1409 | ] 1410 | }, 1411 | { 1412 | "id": "d72dc4ce.89b368", 1413 | "type": "inject", 1414 | "z": "535331d8.55c1f", 1415 | "name": "", 1416 | "topic": "", 1417 | "payload": "", 1418 | "payloadType": "date", 1419 | "repeat": "", 1420 | "crontab": "", 1421 | "once": false, 1422 | "x": 140, 1423 | "y": 80, 1424 | "wires": [ 1425 | [ 1426 | "78075f19.e0174" 1427 | ] 1428 | ] 1429 | }, 1430 | { 1431 | "id": "78075f19.e0174", 1432 | "type": "change", 1433 | "z": "535331d8.55c1f", 1434 | "name": "", 1435 | "rules": [ 1436 | { 1437 | "t": "set", 1438 | "p": "payload", 1439 | "pt": "msg", 1440 | "to": "Hello World!", 1441 | "tot": "str" 1442 | } 1443 | ], 1444 | "action": "", 1445 | "property": "", 1446 | "from": "", 1447 | "to": "", 1448 | "reg": false, 1449 | "x": 340, 1450 | "y": 80, 1451 | "wires": [ 1452 | [ 1453 | "78dc7c25.b90d54" 1454 | ] 1455 | ] 1456 | }, 1457 | { 1458 | "id": "78dc7c25.b90d54", 1459 | "type": "debug", 1460 | "z": "535331d8.55c1f", 1461 | "name": "", 1462 | "active": true, 1463 | "console": "false", 1464 | "complete": "false", 1465 | "x": 550, 1466 | "y": 80, 1467 | "wires": [] 1468 | }, 1469 | { 1470 | "id": "852f98f5.6f3b48", 1471 | "type": "comment", 1472 | "z": "535331d8.55c1f", 1473 | "name": "Set a message property to a fixed value", 1474 | "info": "", 1475 | "x": 170, 1476 | "y": 40, 1477 | "wires": [] 1478 | }, 1479 | { 1480 | "id": "91cd2fa9.e0a96", 1481 | "type": "inject", 1482 | "z": "535331d8.55c1f", 1483 | "name": "", 1484 | "topic": "", 1485 | "payload": "", 1486 | "payloadType": "date", 1487 | "repeat": "", 1488 | "crontab": "", 1489 | "once": false, 1490 | "x": 140, 1491 | "y": 180, 1492 | "wires": [ 1493 | [ 1494 | "54ec03e4.5714bc" 1495 | ] 1496 | ] 1497 | }, 1498 | { 1499 | "id": "54ec03e4.5714bc", 1500 | "type": "change", 1501 | "z": "535331d8.55c1f", 1502 | "name": "", 1503 | "rules": [ 1504 | { 1505 | "t": "delete", 1506 | "p": "payload", 1507 | "pt": "msg" 1508 | } 1509 | ], 1510 | "action": "", 1511 | "property": "", 1512 | "from": "", 1513 | "to": "", 1514 | "reg": false, 1515 | "x": 350, 1516 | "y": 180, 1517 | "wires": [ 1518 | [ 1519 | "321900de.3cbea" 1520 | ] 1521 | ] 1522 | }, 1523 | { 1524 | "id": "321900de.3cbea", 1525 | "type": "debug", 1526 | "z": "535331d8.55c1f", 1527 | "name": "", 1528 | "active": true, 1529 | "console": "false", 1530 | "complete": "false", 1531 | "x": 550, 1532 | "y": 180, 1533 | "wires": [] 1534 | }, 1535 | { 1536 | "id": "f491148d.d35fc8", 1537 | "type": "comment", 1538 | "z": "535331d8.55c1f", 1539 | "name": "Delete message property", 1540 | "info": "", 1541 | "x": 130, 1542 | "y": 140, 1543 | "wires": [] 1544 | }, 1545 | { 1546 | "id": "d11f7311.77c15", 1547 | "type": "inject", 1548 | "z": "535331d8.55c1f", 1549 | "name": "", 1550 | "topic": "Hello", 1551 | "payload": "", 1552 | "payloadType": "date", 1553 | "repeat": "", 1554 | "crontab": "", 1555 | "once": false, 1556 | "x": 160, 1557 | "y": 280, 1558 | "wires": [ 1559 | [ 1560 | "13c01487.eb13cb" 1561 | ] 1562 | ] 1563 | }, 1564 | { 1565 | "id": "13c01487.eb13cb", 1566 | "type": "change", 1567 | "z": "535331d8.55c1f", 1568 | "name": "", 1569 | "rules": [ 1570 | { 1571 | "t": "move", 1572 | "p": "topic", 1573 | "pt": "msg", 1574 | "to": "payload", 1575 | "tot": "msg" 1576 | } 1577 | ], 1578 | "action": "", 1579 | "property": "", 1580 | "from": "", 1581 | "to": "", 1582 | "reg": false, 1583 | "x": 360, 1584 | "y": 280, 1585 | "wires": [ 1586 | [ 1587 | "89cc4fb1.9b208" 1588 | ] 1589 | ] 1590 | }, 1591 | { 1592 | "id": "89cc4fb1.9b208", 1593 | "type": "debug", 1594 | "z": "535331d8.55c1f", 1595 | "name": "", 1596 | "active": true, 1597 | "console": "false", 1598 | "complete": "false", 1599 | "x": 550, 1600 | "y": 280, 1601 | "wires": [] 1602 | }, 1603 | { 1604 | "id": "dca48356.d3261", 1605 | "type": "comment", 1606 | "z": "535331d8.55c1f", 1607 | "name": "Move message property", 1608 | "info": "", 1609 | "x": 130, 1610 | "y": 240, 1611 | "wires": [] 1612 | }, 1613 | { 1614 | "id": "80dae67d.b4d8f8", 1615 | "type": "inject", 1616 | "z": "535331d8.55c1f", 1617 | "name": "", 1618 | "topic": "", 1619 | "payload": "0", 1620 | "payloadType": "num", 1621 | "repeat": "", 1622 | "crontab": "", 1623 | "once": false, 1624 | "x": 130, 1625 | "y": 380, 1626 | "wires": [ 1627 | [ 1628 | "81f13534.456348" 1629 | ] 1630 | ] 1631 | }, 1632 | { 1633 | "id": "e80b61d7.4b399", 1634 | "type": "debug", 1635 | "z": "535331d8.55c1f", 1636 | "name": "", 1637 | "active": true, 1638 | "console": "false", 1639 | "complete": "false", 1640 | "x": 550, 1641 | "y": 420, 1642 | "wires": [] 1643 | }, 1644 | { 1645 | "id": "deb8d8cc.47a748", 1646 | "type": "comment", 1647 | "z": "535331d8.55c1f", 1648 | "name": "Map numeric range", 1649 | "info": "", 1650 | "x": 110, 1651 | "y": 340, 1652 | "wires": [] 1653 | }, 1654 | { 1655 | "id": "cb21de23.75a2f", 1656 | "type": "inject", 1657 | "z": "535331d8.55c1f", 1658 | "name": "", 1659 | "topic": "", 1660 | "payload": "512", 1661 | "payloadType": "num", 1662 | "repeat": "", 1663 | "crontab": "", 1664 | "once": false, 1665 | "x": 130, 1666 | "y": 420, 1667 | "wires": [ 1668 | [ 1669 | "81f13534.456348" 1670 | ] 1671 | ] 1672 | }, 1673 | { 1674 | "id": "342552de.255a1e", 1675 | "type": "inject", 1676 | "z": "535331d8.55c1f", 1677 | "name": "", 1678 | "topic": "", 1679 | "payload": "1023", 1680 | "payloadType": "num", 1681 | "repeat": "", 1682 | "crontab": "", 1683 | "once": false, 1684 | "x": 130, 1685 | "y": 460, 1686 | "wires": [ 1687 | [ 1688 | "81f13534.456348" 1689 | ] 1690 | ] 1691 | }, 1692 | { 1693 | "id": "81f13534.456348", 1694 | "type": "range", 1695 | "z": "535331d8.55c1f", 1696 | "minin": "0", 1697 | "maxin": "1023", 1698 | "minout": "0", 1699 | "maxout": "5", 1700 | "action": "clamp", 1701 | "round": false, 1702 | "name": "", 1703 | "x": 350, 1704 | "y": 420, 1705 | "wires": [ 1706 | [ 1707 | "e80b61d7.4b399" 1708 | ] 1709 | ] 1710 | }, 1711 | { 1712 | "id": "80da1f72.7a01e", 1713 | "type": "comment", 1714 | "z": "b571704d.6c591", 1715 | "name": "Connect to an MQTT Broker", 1716 | "info": "", 1717 | "x": 140, 1718 | "y": 40, 1719 | "wires": [] 1720 | }, 1721 | { 1722 | "id": "5d3fc91.775a038", 1723 | "type": "mqtt out", 1724 | "z": "b571704d.6c591", 1725 | "name": "", 1726 | "topic": "sensors/livingroom/temp", 1727 | "qos": "", 1728 | "retain": "", 1729 | "broker": "b439d8b0.991988", 1730 | "x": 290, 1731 | "y": 80, 1732 | "wires": [] 1733 | }, 1734 | { 1735 | "id": "c548c8e9.801fa8", 1736 | "type": "inject", 1737 | "z": "b571704d.6c591", 1738 | "name": "", 1739 | "topic": "", 1740 | "payload": "22", 1741 | "payloadType": "num", 1742 | "repeat": "", 1743 | "crontab": "", 1744 | "once": false, 1745 | "x": 110, 1746 | "y": 80, 1747 | "wires": [ 1748 | [ 1749 | "5d3fc91.775a038" 1750 | ] 1751 | ] 1752 | }, 1753 | { 1754 | "id": "6ae5ef55.9290b", 1755 | "type": "mqtt in", 1756 | "z": "b571704d.6c591", 1757 | "name": "", 1758 | "topic": "sensors/livingroom/temp", 1759 | "qos": "2", 1760 | "broker": "b439d8b0.991988", 1761 | "x": 150, 1762 | "y": 120, 1763 | "wires": [ 1764 | [ 1765 | "e314de99.9048f" 1766 | ] 1767 | ] 1768 | }, 1769 | { 1770 | "id": "e314de99.9048f", 1771 | "type": "debug", 1772 | "z": "b571704d.6c591", 1773 | "name": "", 1774 | "active": true, 1775 | "console": "false", 1776 | "complete": "false", 1777 | "x": 350, 1778 | "y": 120, 1779 | "wires": [] 1780 | }, 1781 | { 1782 | "id": "eb2fc778.d4a378", 1783 | "type": "comment", 1784 | "z": "b571704d.6c591", 1785 | "name": "Publish to a Topic", 1786 | "info": "", 1787 | "x": 110, 1788 | "y": 180, 1789 | "wires": [] 1790 | }, 1791 | { 1792 | "id": "3dfed8ec.e91a78", 1793 | "type": "mqtt out", 1794 | "z": "b571704d.6c591", 1795 | "name": "", 1796 | "topic": "sensors/livingroom/temp", 1797 | "qos": "", 1798 | "retain": "", 1799 | "broker": "b439d8b0.991988", 1800 | "x": 330, 1801 | "y": 220, 1802 | "wires": [] 1803 | }, 1804 | { 1805 | "id": "73a82491.feb28c", 1806 | "type": "inject", 1807 | "z": "b571704d.6c591", 1808 | "name": "temperature", 1809 | "topic": "", 1810 | "payload": "22", 1811 | "payloadType": "num", 1812 | "repeat": "", 1813 | "crontab": "", 1814 | "once": false, 1815 | "x": 110, 1816 | "y": 220, 1817 | "wires": [ 1818 | [ 1819 | "3dfed8ec.e91a78" 1820 | ] 1821 | ] 1822 | }, 1823 | { 1824 | "id": "7bea6336.0d6cdc", 1825 | "type": "comment", 1826 | "z": "b571704d.6c591", 1827 | "name": "Set the topic of a published message", 1828 | "info": "", 1829 | "x": 170, 1830 | "y": 280, 1831 | "wires": [] 1832 | }, 1833 | { 1834 | "id": "d554d542.0cf108", 1835 | "type": "mqtt out", 1836 | "z": "b571704d.6c591", 1837 | "name": "", 1838 | "topic": "", 1839 | "qos": "", 1840 | "retain": "", 1841 | "broker": "b439d8b0.991988", 1842 | "x": 310, 1843 | "y": 320, 1844 | "wires": [] 1845 | }, 1846 | { 1847 | "id": "c5efd98e.9ad2f8", 1848 | "type": "inject", 1849 | "z": "b571704d.6c591", 1850 | "name": "kitchen temperature", 1851 | "topic": "sensors/kitchen/temperature", 1852 | "payload": "22", 1853 | "payloadType": "num", 1854 | "repeat": "", 1855 | "crontab": "", 1856 | "once": false, 1857 | "x": 130, 1858 | "y": 320, 1859 | "wires": [ 1860 | [ 1861 | "d554d542.0cf108" 1862 | ] 1863 | ] 1864 | }, 1865 | { 1866 | "id": "58c99d82.dbfd54", 1867 | "type": "comment", 1868 | "z": "b571704d.6c591", 1869 | "name": "Subscribe to a Topic", 1870 | "info": "", 1871 | "x": 110, 1872 | "y": 480, 1873 | "wires": [] 1874 | }, 1875 | { 1876 | "id": "5c92c689.b67458", 1877 | "type": "mqtt in", 1878 | "z": "b571704d.6c591", 1879 | "name": "", 1880 | "topic": "sensors/#", 1881 | "qos": "2", 1882 | "datatype": "auto", 1883 | "broker": "b439d8b0.991988", 1884 | "x": 80, 1885 | "y": 520, 1886 | "wires": [ 1887 | [ 1888 | "a26e21e1.de075" 1889 | ] 1890 | ] 1891 | }, 1892 | { 1893 | "id": "a26e21e1.de075", 1894 | "type": "debug", 1895 | "z": "b571704d.6c591", 1896 | "name": "", 1897 | "active": true, 1898 | "console": "false", 1899 | "complete": "false", 1900 | "x": 230, 1901 | "y": 520, 1902 | "wires": [] 1903 | }, 1904 | { 1905 | "id": "a172eabf.7b7218", 1906 | "type": "comment", 1907 | "z": "b571704d.6c591", 1908 | "name": "Publish a retained message to a topic", 1909 | "info": "", 1910 | "x": 170, 1911 | "y": 380, 1912 | "wires": [] 1913 | }, 1914 | { 1915 | "id": "9f9556a3.c298d8", 1916 | "type": "mqtt out", 1917 | "z": "b571704d.6c591", 1918 | "name": "", 1919 | "topic": "sensors/livingroom/temp", 1920 | "qos": "", 1921 | "retain": "true", 1922 | "broker": "b439d8b0.991988", 1923 | "x": 310, 1924 | "y": 420, 1925 | "wires": [] 1926 | }, 1927 | { 1928 | "id": "a55dd0e1.a02ae", 1929 | "type": "inject", 1930 | "z": "b571704d.6c591", 1931 | "name": "temperature", 1932 | "topic": "", 1933 | "payload": "22", 1934 | "payloadType": "num", 1935 | "repeat": "", 1936 | "crontab": "", 1937 | "once": false, 1938 | "x": 110, 1939 | "y": 420, 1940 | "wires": [ 1941 | [ 1942 | "9f9556a3.c298d8" 1943 | ] 1944 | ] 1945 | }, 1946 | { 1947 | "id": "12526f79.5dc901", 1948 | "type": "comment", 1949 | "z": "b571704d.6c591", 1950 | "name": "Receive a Parsed JSON Message", 1951 | "info": "", 1952 | "x": 160, 1953 | "y": 580, 1954 | "wires": [] 1955 | }, 1956 | { 1957 | "id": "12f4b1f9.ef698e", 1958 | "type": "mqtt in", 1959 | "z": "b571704d.6c591", 1960 | "name": "", 1961 | "topic": "sensors/#", 1962 | "qos": "2", 1963 | "datatype": "auto", 1964 | "broker": "b439d8b0.991988", 1965 | "x": 240, 1966 | "y": 680, 1967 | "wires": [ 1968 | [ 1969 | "177dcc5c.4fc9e4" 1970 | ] 1971 | ] 1972 | }, 1973 | { 1974 | "id": "c755b9fb.a6e4b8", 1975 | "type": "debug", 1976 | "z": "b571704d.6c591", 1977 | "name": "", 1978 | "active": true, 1979 | "console": "false", 1980 | "complete": "false", 1981 | "x": 510, 1982 | "y": 680, 1983 | "wires": [] 1984 | }, 1985 | { 1986 | "id": "54039f03.f1f82", 1987 | "type": "mqtt out", 1988 | "z": "b571704d.6c591", 1989 | "name": "", 1990 | "topic": "sensors/livingroom/temp", 1991 | "qos": "", 1992 | "retain": "false", 1993 | "broker": "b439d8b0.991988", 1994 | "x": 290, 1995 | "y": 620, 1996 | "wires": [] 1997 | }, 1998 | { 1999 | "id": "6ecdedfb.c83784", 2000 | "type": "inject", 2001 | "z": "b571704d.6c591", 2002 | "name": "temp json", 2003 | "topic": "", 2004 | "payload": "{\"sensor_id\":1234,\"temperature\":13}", 2005 | "payloadType": "json", 2006 | "repeat": "", 2007 | "crontab": "", 2008 | "once": false, 2009 | "x": 100, 2010 | "y": 620, 2011 | "wires": [ 2012 | [ 2013 | "54039f03.f1f82" 2014 | ] 2015 | ] 2016 | }, 2017 | { 2018 | "id": "177dcc5c.4fc9e4", 2019 | "type": "json", 2020 | "z": "b571704d.6c591", 2021 | "name": "", 2022 | "pretty": false, 2023 | "x": 370, 2024 | "y": 680, 2025 | "wires": [ 2026 | [ 2027 | "c755b9fb.a6e4b8" 2028 | ] 2029 | ] 2030 | }, 2031 | { 2032 | "id": "265b1392.ee67ec", 2033 | "type": "inject", 2034 | "z": "ac14500e.2c57d", 2035 | "name": "", 2036 | "topic": "", 2037 | "payload": "Started!", 2038 | "payloadType": "str", 2039 | "repeat": "", 2040 | "crontab": "", 2041 | "once": true, 2042 | "x": 140, 2043 | "y": 80, 2044 | "wires": [ 2045 | [ 2046 | "2443ea4e.859c46" 2047 | ] 2048 | ] 2049 | }, 2050 | { 2051 | "id": "2443ea4e.859c46", 2052 | "type": "debug", 2053 | "z": "ac14500e.2c57d", 2054 | "name": "", 2055 | "active": true, 2056 | "console": "false", 2057 | "complete": "false", 2058 | "x": 410, 2059 | "y": 80, 2060 | "wires": [] 2061 | }, 2062 | { 2063 | "id": "5d96e2bf.be9ddc", 2064 | "type": "inject", 2065 | "z": "ac14500e.2c57d", 2066 | "name": "", 2067 | "topic": "", 2068 | "payload": "", 2069 | "payloadType": "date", 2070 | "repeat": "5", 2071 | "crontab": "", 2072 | "once": false, 2073 | "x": 150, 2074 | "y": 180, 2075 | "wires": [ 2076 | [ 2077 | "83bc41f5.4f2fb" 2078 | ] 2079 | ] 2080 | }, 2081 | { 2082 | "id": "83bc41f5.4f2fb", 2083 | "type": "debug", 2084 | "z": "ac14500e.2c57d", 2085 | "name": "", 2086 | "active": false, 2087 | "console": "false", 2088 | "complete": "false", 2089 | "x": 410, 2090 | "y": 180, 2091 | "wires": [] 2092 | }, 2093 | { 2094 | "id": "f990b44f.7b5fa8", 2095 | "type": "inject", 2096 | "z": "ac14500e.2c57d", 2097 | "name": "", 2098 | "topic": "", 2099 | "payload": "It is 4pm on a weekday!", 2100 | "payloadType": "str", 2101 | "repeat": "", 2102 | "crontab": "00 16 * * 1,2,3,4,5", 2103 | "once": false, 2104 | "x": 190, 2105 | "y": 280, 2106 | "wires": [ 2107 | [ 2108 | "e692b739.966c98" 2109 | ] 2110 | ] 2111 | }, 2112 | { 2113 | "id": "e692b739.966c98", 2114 | "type": "debug", 2115 | "z": "ac14500e.2c57d", 2116 | "name": "", 2117 | "active": true, 2118 | "console": "false", 2119 | "complete": "false", 2120 | "x": 410, 2121 | "y": 280, 2122 | "wires": [] 2123 | }, 2124 | { 2125 | "id": "136cee19.ca58b2", 2126 | "type": "comment", 2127 | "z": "ac14500e.2c57d", 2128 | "name": "Trigger a flow whenever Node-RED starts", 2129 | "info": "", 2130 | "x": 180, 2131 | "y": 40, 2132 | "wires": [] 2133 | }, 2134 | { 2135 | "id": "a6d5600.1c7eea", 2136 | "type": "comment", 2137 | "z": "ac14500e.2c57d", 2138 | "name": "Trigger a flow at regular intervals", 2139 | "info": "", 2140 | "x": 150, 2141 | "y": 140, 2142 | "wires": [] 2143 | }, 2144 | { 2145 | "id": "3acad048.5c037", 2146 | "type": "comment", 2147 | "z": "ac14500e.2c57d", 2148 | "name": "Trigger a flow at a specific time", 2149 | "info": "", 2150 | "x": 150, 2151 | "y": 240, 2152 | "wires": [] 2153 | }, 2154 | { 2155 | "id": "a7fce675.df3738", 2156 | "type": "comment", 2157 | "z": "ac14500e.2c57d", 2158 | "name": "Route a message based on one of its properties", 2159 | "info": "", 2160 | "x": 200, 2161 | "y": 340, 2162 | "wires": [] 2163 | }, 2164 | { 2165 | "id": "bbfb8d73.afa31", 2166 | "type": "comment", 2167 | "z": "ac14500e.2c57d", 2168 | "name": "Route a message based on a context property", 2169 | "info": "", 2170 | "x": 190, 2171 | "y": 520, 2172 | "wires": [] 2173 | }, 2174 | { 2175 | "id": "e5761a48.6ace18", 2176 | "type": "comment", 2177 | "z": "ac14500e.2c57d", 2178 | "name": "Perform an operation on each element in an array", 2179 | "info": "", 2180 | "x": 200, 2181 | "y": 880, 2182 | "wires": [] 2183 | }, 2184 | { 2185 | "id": "508c5fc0.cd11e", 2186 | "type": "comment", 2187 | "z": "ac14500e.2c57d", 2188 | "name": "Trigger a flow if a message isn’t received after a defined time", 2189 | "info": "", 2190 | "x": 240, 2191 | "y": 1100, 2192 | "wires": [] 2193 | }, 2194 | { 2195 | "id": "11644ecd.879951", 2196 | "type": "comment", 2197 | "z": "ac14500e.2c57d", 2198 | "name": "Drop messages that have not changed value", 2199 | "info": "", 2200 | "x": 190, 2201 | "y": 1460, 2202 | "wires": [] 2203 | }, 2204 | { 2205 | "id": "cd480112.39f77", 2206 | "type": "comment", 2207 | "z": "ac14500e.2c57d", 2208 | "name": "Send placeholder messages when a stream stops sending", 2209 | "info": "", 2210 | "x": 230, 2211 | "y": 1620, 2212 | "wires": [] 2213 | }, 2214 | { 2215 | "id": "db551bcf.2c92c8", 2216 | "type": "comment", 2217 | "z": "fc046f99.4be08", 2218 | "name": "Trigger a flow when a node throws an error", 2219 | "info": "", 2220 | "x": 180, 2221 | "y": 40, 2222 | "wires": [] 2223 | }, 2224 | { 2225 | "id": "847e1c97.0ea93", 2226 | "type": "comment", 2227 | "z": "64133d39.bb0394", 2228 | "name": "Convert to/from JSON", 2229 | "info": "", 2230 | "x": 120, 2231 | "y": 40, 2232 | "wires": [] 2233 | }, 2234 | { 2235 | "id": "8fa4a297.9f87d", 2236 | "type": "comment", 2237 | "z": "64133d39.bb0394", 2238 | "name": "Split text into one message per line", 2239 | "info": "", 2240 | "x": 160, 2241 | "y": 840, 2242 | "wires": [] 2243 | }, 2244 | { 2245 | "id": "3bc8e1d2.744abe", 2246 | "type": "switch", 2247 | "z": "ac14500e.2c57d", 2248 | "name": "Route ", 2249 | "property": "topic", 2250 | "propertyType": "msg", 2251 | "rules": [ 2252 | { 2253 | "t": "eq", 2254 | "v": "temperature", 2255 | "vt": "str" 2256 | }, 2257 | { 2258 | "t": "eq", 2259 | "v": "humidity", 2260 | "vt": "str" 2261 | }, 2262 | { 2263 | "t": "eq", 2264 | "v": "pressure", 2265 | "vt": "str" 2266 | } 2267 | ], 2268 | "checkall": "true", 2269 | "repair": false, 2270 | "outputs": 3, 2271 | "x": 330, 2272 | "y": 420, 2273 | "wires": [ 2274 | [ 2275 | "907bf3b8.def45" 2276 | ], 2277 | [ 2278 | "fe425938.926838" 2279 | ], 2280 | [ 2281 | "ec261304.52f73" 2282 | ] 2283 | ] 2284 | }, 2285 | { 2286 | "id": "be3da36c.1c142", 2287 | "type": "inject", 2288 | "z": "ac14500e.2c57d", 2289 | "name": "", 2290 | "topic": "temperature", 2291 | "payload": "27", 2292 | "payloadType": "num", 2293 | "repeat": "", 2294 | "crontab": "", 2295 | "once": false, 2296 | "onceDelay": 0.1, 2297 | "x": 140, 2298 | "y": 380, 2299 | "wires": [ 2300 | [ 2301 | "3bc8e1d2.744abe" 2302 | ] 2303 | ] 2304 | }, 2305 | { 2306 | "id": "f271ceef.172b3", 2307 | "type": "inject", 2308 | "z": "ac14500e.2c57d", 2309 | "name": "", 2310 | "topic": "humidity", 2311 | "payload": "45", 2312 | "payloadType": "num", 2313 | "repeat": "", 2314 | "crontab": "", 2315 | "once": false, 2316 | "onceDelay": 0.1, 2317 | "x": 130, 2318 | "y": 420, 2319 | "wires": [ 2320 | [ 2321 | "3bc8e1d2.744abe" 2322 | ] 2323 | ] 2324 | }, 2325 | { 2326 | "id": "907bf3b8.def45", 2327 | "type": "debug", 2328 | "z": "ac14500e.2c57d", 2329 | "name": "Temperature", 2330 | "active": true, 2331 | "tosidebar": true, 2332 | "console": false, 2333 | "tostatus": false, 2334 | "complete": "payload", 2335 | "targetType": "msg", 2336 | "x": 510, 2337 | "y": 380, 2338 | "wires": [] 2339 | }, 2340 | { 2341 | "id": "fe425938.926838", 2342 | "type": "debug", 2343 | "z": "ac14500e.2c57d", 2344 | "name": "Humidity", 2345 | "active": true, 2346 | "tosidebar": true, 2347 | "console": false, 2348 | "tostatus": false, 2349 | "complete": "payload", 2350 | "targetType": "msg", 2351 | "x": 500, 2352 | "y": 420, 2353 | "wires": [] 2354 | }, 2355 | { 2356 | "id": "ec261304.52f73", 2357 | "type": "debug", 2358 | "z": "ac14500e.2c57d", 2359 | "name": "Pressure", 2360 | "active": true, 2361 | "tosidebar": true, 2362 | "console": false, 2363 | "tostatus": false, 2364 | "complete": "payload", 2365 | "targetType": "msg", 2366 | "x": 500, 2367 | "y": 460, 2368 | "wires": [] 2369 | }, 2370 | { 2371 | "id": "fca957dd.9d8078", 2372 | "type": "inject", 2373 | "z": "ac14500e.2c57d", 2374 | "name": "", 2375 | "topic": "pressure", 2376 | "payload": "1001", 2377 | "payloadType": "num", 2378 | "repeat": "", 2379 | "crontab": "", 2380 | "once": false, 2381 | "onceDelay": 0.1, 2382 | "x": 130, 2383 | "y": 460, 2384 | "wires": [ 2385 | [ 2386 | "3bc8e1d2.744abe" 2387 | ] 2388 | ] 2389 | }, 2390 | { 2391 | "id": "b8bbbc41.f272", 2392 | "type": "switch", 2393 | "z": "ac14500e.2c57d", 2394 | "name": "Context based routing", 2395 | "property": "state", 2396 | "propertyType": "flow", 2397 | "rules": [ 2398 | { 2399 | "t": "eq", 2400 | "v": "1", 2401 | "vt": "num" 2402 | }, 2403 | { 2404 | "t": "eq", 2405 | "v": "2", 2406 | "vt": "num" 2407 | }, 2408 | { 2409 | "t": "eq", 2410 | "v": "3", 2411 | "vt": "num" 2412 | } 2413 | ], 2414 | "checkall": "true", 2415 | "repair": false, 2416 | "outputs": 3, 2417 | "x": 320, 2418 | "y": 600, 2419 | "wires": [ 2420 | [ 2421 | "9aa9c6b2.18a8e8" 2422 | ], 2423 | [ 2424 | "6ba4ec46.476794" 2425 | ], 2426 | [ 2427 | "a2e806c8.ffa168" 2428 | ] 2429 | ] 2430 | }, 2431 | { 2432 | "id": "9aa9c6b2.18a8e8", 2433 | "type": "debug", 2434 | "z": "ac14500e.2c57d", 2435 | "name": "Output 1", 2436 | "active": true, 2437 | "tosidebar": true, 2438 | "console": false, 2439 | "tostatus": true, 2440 | "complete": "payload", 2441 | "targetType": "msg", 2442 | "x": 560, 2443 | "y": 540, 2444 | "wires": [] 2445 | }, 2446 | { 2447 | "id": "8aabdb51.e8b538", 2448 | "type": "inject", 2449 | "z": "ac14500e.2c57d", 2450 | "name": "Set state 0", 2451 | "topic": "", 2452 | "payload": "0", 2453 | "payloadType": "num", 2454 | "repeat": "", 2455 | "crontab": "", 2456 | "once": false, 2457 | "onceDelay": 0.1, 2458 | "x": 120, 2459 | "y": 680, 2460 | "wires": [ 2461 | [ 2462 | "e46083e4.1f17b" 2463 | ] 2464 | ] 2465 | }, 2466 | { 2467 | "id": "e46083e4.1f17b", 2468 | "type": "change", 2469 | "z": "ac14500e.2c57d", 2470 | "name": "Set flow.state", 2471 | "rules": [ 2472 | { 2473 | "t": "set", 2474 | "p": "state", 2475 | "pt": "flow", 2476 | "to": "payload", 2477 | "tot": "msg" 2478 | } 2479 | ], 2480 | "action": "", 2481 | "property": "", 2482 | "from": "", 2483 | "to": "", 2484 | "reg": false, 2485 | "x": 340, 2486 | "y": 720, 2487 | "wires": [ 2488 | [] 2489 | ] 2490 | }, 2491 | { 2492 | "id": "6ba4ec46.476794", 2493 | "type": "debug", 2494 | "z": "ac14500e.2c57d", 2495 | "name": "Output 2", 2496 | "active": true, 2497 | "tosidebar": true, 2498 | "console": false, 2499 | "tostatus": true, 2500 | "complete": "payload", 2501 | "targetType": "msg", 2502 | "x": 560, 2503 | "y": 600, 2504 | "wires": [] 2505 | }, 2506 | { 2507 | "id": "a2e806c8.ffa168", 2508 | "type": "debug", 2509 | "z": "ac14500e.2c57d", 2510 | "name": "Output 3", 2511 | "active": true, 2512 | "tosidebar": true, 2513 | "console": false, 2514 | "tostatus": true, 2515 | "complete": "payload", 2516 | "targetType": "msg", 2517 | "x": 560, 2518 | "y": 660, 2519 | "wires": [] 2520 | }, 2521 | { 2522 | "id": "a62d8cdf.1bd82", 2523 | "type": "inject", 2524 | "z": "ac14500e.2c57d", 2525 | "name": "Inject", 2526 | "topic": "", 2527 | "payload": "", 2528 | "payloadType": "date", 2529 | "repeat": "", 2530 | "crontab": "", 2531 | "once": false, 2532 | "onceDelay": 0.1, 2533 | "x": 110, 2534 | "y": 600, 2535 | "wires": [ 2536 | [ 2537 | "b8bbbc41.f272" 2538 | ] 2539 | ] 2540 | }, 2541 | { 2542 | "id": "d1722dee.48db4", 2543 | "type": "inject", 2544 | "z": "ac14500e.2c57d", 2545 | "name": "Set state 1", 2546 | "topic": "", 2547 | "payload": "1", 2548 | "payloadType": "num", 2549 | "repeat": "", 2550 | "crontab": "", 2551 | "once": false, 2552 | "onceDelay": 0.1, 2553 | "x": 120, 2554 | "y": 720, 2555 | "wires": [ 2556 | [ 2557 | "e46083e4.1f17b" 2558 | ] 2559 | ] 2560 | }, 2561 | { 2562 | "id": "4bdb08de.706328", 2563 | "type": "inject", 2564 | "z": "ac14500e.2c57d", 2565 | "name": "Set state 2", 2566 | "topic": "", 2567 | "payload": "2", 2568 | "payloadType": "num", 2569 | "repeat": "", 2570 | "crontab": "", 2571 | "once": false, 2572 | "onceDelay": 0.1, 2573 | "x": 120, 2574 | "y": 760, 2575 | "wires": [ 2576 | [ 2577 | "e46083e4.1f17b" 2578 | ] 2579 | ] 2580 | }, 2581 | { 2582 | "id": "220ce0a6.cf81e", 2583 | "type": "inject", 2584 | "z": "ac14500e.2c57d", 2585 | "name": "Set state 3", 2586 | "topic": "", 2587 | "payload": "3", 2588 | "payloadType": "num", 2589 | "repeat": "", 2590 | "crontab": "", 2591 | "once": false, 2592 | "onceDelay": 0.1, 2593 | "x": 120, 2594 | "y": 800, 2595 | "wires": [ 2596 | [ 2597 | "e46083e4.1f17b" 2598 | ] 2599 | ] 2600 | }, 2601 | { 2602 | "id": "3149f240.c0e25e", 2603 | "type": "inject", 2604 | "z": "ac14500e.2c57d", 2605 | "name": "Array of decimals", 2606 | "topic": "", 2607 | "payload": "[1.67,2.98,3.12,4.99,5.50]", 2608 | "payloadType": "json", 2609 | "repeat": "", 2610 | "crontab": "", 2611 | "once": false, 2612 | "onceDelay": 0.1, 2613 | "x": 120, 2614 | "y": 920, 2615 | "wires": [ 2616 | [ 2617 | "bd57baa6.00f998" 2618 | ] 2619 | ] 2620 | }, 2621 | { 2622 | "id": "bd57baa6.00f998", 2623 | "type": "split", 2624 | "z": "ac14500e.2c57d", 2625 | "name": "Split array", 2626 | "splt": "\\n", 2627 | "spltType": "str", 2628 | "arraySplt": "1", 2629 | "arraySpltType": "len", 2630 | "stream": false, 2631 | "addname": "", 2632 | "x": 200, 2633 | "y": 980, 2634 | "wires": [ 2635 | [ 2636 | "7ab9e9ed.d514b8" 2637 | ] 2638 | ] 2639 | }, 2640 | { 2641 | "id": "7ab9e9ed.d514b8", 2642 | "type": "range", 2643 | "z": "ac14500e.2c57d", 2644 | "minin": "0", 2645 | "maxin": "10", 2646 | "minout": "0", 2647 | "maxout": "10", 2648 | "action": "scale", 2649 | "round": true, 2650 | "property": "payload", 2651 | "name": "Round value", 2652 | "x": 350, 2653 | "y": 980, 2654 | "wires": [ 2655 | [ 2656 | "f26660ab.007b3" 2657 | ] 2658 | ] 2659 | }, 2660 | { 2661 | "id": "f26660ab.007b3", 2662 | "type": "join", 2663 | "z": "ac14500e.2c57d", 2664 | "name": "", 2665 | "mode": "auto", 2666 | "build": "string", 2667 | "property": "payload", 2668 | "propertyType": "msg", 2669 | "key": "topic", 2670 | "joiner": "\\n", 2671 | "joinerType": "str", 2672 | "accumulate": "false", 2673 | "timeout": "", 2674 | "count": "", 2675 | "reduceRight": false, 2676 | "x": 490, 2677 | "y": 980, 2678 | "wires": [ 2679 | [ 2680 | "f9b5abac.f13828" 2681 | ] 2682 | ] 2683 | }, 2684 | { 2685 | "id": "f9b5abac.f13828", 2686 | "type": "debug", 2687 | "z": "ac14500e.2c57d", 2688 | "name": "", 2689 | "active": true, 2690 | "tosidebar": true, 2691 | "console": false, 2692 | "tostatus": false, 2693 | "complete": "false", 2694 | "x": 550, 2695 | "y": 1040, 2696 | "wires": [] 2697 | }, 2698 | { 2699 | "id": "38caaff4.03f6d", 2700 | "type": "trigger", 2701 | "z": "ac14500e.2c57d", 2702 | "op1": "", 2703 | "op2": "timeout", 2704 | "op1type": "nul", 2705 | "op2type": "str", 2706 | "duration": "5", 2707 | "extend": true, 2708 | "units": "s", 2709 | "reset": "", 2710 | "bytopic": "all", 2711 | "name": "Watchdog", 2712 | "x": 270, 2713 | "y": 1180, 2714 | "wires": [ 2715 | [ 2716 | "ae477709.016088" 2717 | ] 2718 | ] 2719 | }, 2720 | { 2721 | "id": "3da6946e.184a5c", 2722 | "type": "inject", 2723 | "z": "ac14500e.2c57d", 2724 | "name": "", 2725 | "topic": "", 2726 | "payload": "", 2727 | "payloadType": "date", 2728 | "repeat": "", 2729 | "crontab": "", 2730 | "once": false, 2731 | "onceDelay": 0.1, 2732 | "x": 100, 2733 | "y": 1140, 2734 | "wires": [ 2735 | [ 2736 | "38caaff4.03f6d", 2737 | "6ea53ad8.2362a4" 2738 | ] 2739 | ] 2740 | }, 2741 | { 2742 | "id": "6ea53ad8.2362a4", 2743 | "type": "debug", 2744 | "z": "ac14500e.2c57d", 2745 | "name": "", 2746 | "active": true, 2747 | "tosidebar": true, 2748 | "console": false, 2749 | "tostatus": false, 2750 | "complete": "payload", 2751 | "targetType": "msg", 2752 | "x": 450, 2753 | "y": 1140, 2754 | "wires": [] 2755 | }, 2756 | { 2757 | "id": "ae477709.016088", 2758 | "type": "debug", 2759 | "z": "ac14500e.2c57d", 2760 | "name": "", 2761 | "active": true, 2762 | "tosidebar": true, 2763 | "console": false, 2764 | "tostatus": false, 2765 | "complete": "false", 2766 | "x": 450, 2767 | "y": 1180, 2768 | "wires": [] 2769 | }, 2770 | { 2771 | "id": "b316b702.160fa8", 2772 | "type": "comment", 2773 | "z": "ac14500e.2c57d", 2774 | "name": "Limit the rate of messages passing through a flow", 2775 | "info": "", 2776 | "x": 210, 2777 | "y": 1240, 2778 | "wires": [] 2779 | }, 2780 | { 2781 | "id": "bd97c8ed.a5c8d8", 2782 | "type": "delay", 2783 | "z": "ac14500e.2c57d", 2784 | "name": "", 2785 | "pauseType": "rate", 2786 | "timeout": "5", 2787 | "timeoutUnits": "seconds", 2788 | "rate": "1", 2789 | "nbRateUnits": "1", 2790 | "rateUnits": "second", 2791 | "randomFirst": "1", 2792 | "randomLast": "5", 2793 | "randomUnits": "seconds", 2794 | "drop": false, 2795 | "x": 390, 2796 | "y": 1280, 2797 | "wires": [ 2798 | [ 2799 | "bd66f03e.bdf0c" 2800 | ] 2801 | ] 2802 | }, 2803 | { 2804 | "id": "1fccc223.7ba87e", 2805 | "type": "inject", 2806 | "z": "ac14500e.2c57d", 2807 | "name": "Inject Array", 2808 | "topic": "", 2809 | "payload": "[0,1,2,3,4,5,6,7,8,9]", 2810 | "payloadType": "json", 2811 | "repeat": "", 2812 | "crontab": "", 2813 | "once": false, 2814 | "onceDelay": 0.1, 2815 | "x": 110, 2816 | "y": 1280, 2817 | "wires": [ 2818 | [ 2819 | "b2837466.e02a38" 2820 | ] 2821 | ] 2822 | }, 2823 | { 2824 | "id": "bd66f03e.bdf0c", 2825 | "type": "debug", 2826 | "z": "ac14500e.2c57d", 2827 | "name": "", 2828 | "active": true, 2829 | "tosidebar": true, 2830 | "console": false, 2831 | "tostatus": false, 2832 | "complete": "payload", 2833 | "targetType": "msg", 2834 | "x": 550, 2835 | "y": 1280, 2836 | "wires": [] 2837 | }, 2838 | { 2839 | "id": "b2837466.e02a38", 2840 | "type": "split", 2841 | "z": "ac14500e.2c57d", 2842 | "name": "", 2843 | "splt": "\\n", 2844 | "spltType": "str", 2845 | "arraySplt": 1, 2846 | "arraySpltType": "len", 2847 | "stream": false, 2848 | "addname": "", 2849 | "x": 250, 2850 | "y": 1280, 2851 | "wires": [ 2852 | [ 2853 | "bd97c8ed.a5c8d8" 2854 | ] 2855 | ] 2856 | }, 2857 | { 2858 | "id": "8990635f.a45bb", 2859 | "type": "comment", 2860 | "z": "ac14500e.2c57d", 2861 | "name": "Handle messages at a regular rate", 2862 | "info": "", 2863 | "x": 160, 2864 | "y": 1340, 2865 | "wires": [] 2866 | }, 2867 | { 2868 | "id": "bd4bdd42.bd1b", 2869 | "type": "delay", 2870 | "z": "ac14500e.2c57d", 2871 | "name": "", 2872 | "pauseType": "rate", 2873 | "timeout": "5", 2874 | "timeoutUnits": "seconds", 2875 | "rate": "1", 2876 | "nbRateUnits": "5", 2877 | "rateUnits": "second", 2878 | "randomFirst": "1", 2879 | "randomLast": "5", 2880 | "randomUnits": "seconds", 2881 | "drop": true, 2882 | "x": 320, 2883 | "y": 1380, 2884 | "wires": [ 2885 | [ 2886 | "be20c513.237c78" 2887 | ] 2888 | ] 2889 | }, 2890 | { 2891 | "id": "8a1bcd7d.f6b67", 2892 | "type": "inject", 2893 | "z": "ac14500e.2c57d", 2894 | "name": "Inject Array", 2895 | "topic": "", 2896 | "payload": "[0,1,2,3,4,5,6,7,8,9]", 2897 | "payloadType": "json", 2898 | "repeat": "", 2899 | "crontab": "", 2900 | "once": false, 2901 | "onceDelay": 0.1, 2902 | "x": 110, 2903 | "y": 1380, 2904 | "wires": [ 2905 | [ 2906 | "bd4bdd42.bd1b" 2907 | ] 2908 | ] 2909 | }, 2910 | { 2911 | "id": "be20c513.237c78", 2912 | "type": "debug", 2913 | "z": "ac14500e.2c57d", 2914 | "name": "", 2915 | "active": true, 2916 | "tosidebar": true, 2917 | "console": false, 2918 | "tostatus": false, 2919 | "complete": "payload", 2920 | "targetType": "msg", 2921 | "x": 530, 2922 | "y": 1380, 2923 | "wires": [] 2924 | }, 2925 | { 2926 | "id": "87129503.c7b358", 2927 | "type": "rbe", 2928 | "z": "ac14500e.2c57d", 2929 | "name": "report-by-exception", 2930 | "func": "deadband", 2931 | "gap": "", 2932 | "start": "", 2933 | "inout": "out", 2934 | "property": "payload", 2935 | "x": 300, 2936 | "y": 1520, 2937 | "wires": [ 2938 | [ 2939 | "5e2ffc27.c61dd4" 2940 | ] 2941 | ] 2942 | }, 2943 | { 2944 | "id": "6079638d.df403c", 2945 | "type": "inject", 2946 | "z": "ac14500e.2c57d", 2947 | "name": "", 2948 | "topic": "", 2949 | "payload": "0", 2950 | "payloadType": "num", 2951 | "repeat": "", 2952 | "crontab": "", 2953 | "once": false, 2954 | "onceDelay": 0.1, 2955 | "x": 90, 2956 | "y": 1500, 2957 | "wires": [ 2958 | [ 2959 | "87129503.c7b358" 2960 | ] 2961 | ] 2962 | }, 2963 | { 2964 | "id": "2dc49f96.3070c", 2965 | "type": "inject", 2966 | "z": "ac14500e.2c57d", 2967 | "name": "", 2968 | "topic": "", 2969 | "payload": "1", 2970 | "payloadType": "num", 2971 | "repeat": "", 2972 | "crontab": "", 2973 | "once": false, 2974 | "onceDelay": 0.1, 2975 | "x": 90, 2976 | "y": 1540, 2977 | "wires": [ 2978 | [ 2979 | "87129503.c7b358" 2980 | ] 2981 | ] 2982 | }, 2983 | { 2984 | "id": "5e2ffc27.c61dd4", 2985 | "type": "debug", 2986 | "z": "ac14500e.2c57d", 2987 | "name": "", 2988 | "active": true, 2989 | "tosidebar": true, 2990 | "console": false, 2991 | "tostatus": false, 2992 | "complete": "payload", 2993 | "targetType": "msg", 2994 | "x": 510, 2995 | "y": 1520, 2996 | "wires": [] 2997 | }, 2998 | { 2999 | "id": "2bd6810d.e22ece", 3000 | "type": "catch", 3001 | "z": "fc046f99.4be08", 3002 | "name": "", 3003 | "scope": [ 3004 | "2c94a22c.91012e" 3005 | ], 3006 | "uncaught": false, 3007 | "x": 130, 3008 | "y": 160, 3009 | "wires": [ 3010 | [ 3011 | "d16b9fac.8212a" 3012 | ] 3013 | ] 3014 | }, 3015 | { 3016 | "id": "2c94a22c.91012e", 3017 | "type": "function", 3018 | "z": "fc046f99.4be08", 3019 | "name": "Throw Error", 3020 | "func": "node.error(\"an example error\", msg); ", 3021 | "outputs": 1, 3022 | "noerr": 0, 3023 | "x": 310, 3024 | "y": 100, 3025 | "wires": [ 3026 | [] 3027 | ] 3028 | }, 3029 | { 3030 | "id": "d16b9fac.8212a", 3031 | "type": "debug", 3032 | "z": "fc046f99.4be08", 3033 | "name": "", 3034 | "active": true, 3035 | "tosidebar": true, 3036 | "console": false, 3037 | "tostatus": false, 3038 | "complete": "error", 3039 | "targetType": "msg", 3040 | "x": 300, 3041 | "y": 160, 3042 | "wires": [] 3043 | }, 3044 | { 3045 | "id": "c5ee9670.5dbbd8", 3046 | "type": "inject", 3047 | "z": "fc046f99.4be08", 3048 | "name": "Trigger error", 3049 | "topic": "", 3050 | "payload": "", 3051 | "payloadType": "date", 3052 | "repeat": "", 3053 | "crontab": "", 3054 | "once": false, 3055 | "onceDelay": 0.1, 3056 | "x": 110, 3057 | "y": 100, 3058 | "wires": [ 3059 | [ 3060 | "2c94a22c.91012e" 3061 | ] 3062 | ] 3063 | }, 3064 | { 3065 | "id": "58f7476a.005d18", 3066 | "type": "comment", 3067 | "z": "fc046f99.4be08", 3068 | "name": "Automatically retry an action after an error", 3069 | "info": "", 3070 | "x": 180, 3071 | "y": 260, 3072 | "wires": [] 3073 | }, 3074 | { 3075 | "id": "139b836e.7950ed", 3076 | "type": "catch", 3077 | "z": "fc046f99.4be08", 3078 | "name": "", 3079 | "scope": [ 3080 | "d7d08440.31b678" 3081 | ], 3082 | "uncaught": false, 3083 | "x": 90, 3084 | "y": 380, 3085 | "wires": [ 3086 | [ 3087 | "2166290d.98d736", 3088 | "9c8ab214.0ecaa" 3089 | ] 3090 | ] 3091 | }, 3092 | { 3093 | "id": "d7d08440.31b678", 3094 | "type": "function", 3095 | "z": "fc046f99.4be08", 3096 | "name": "Random error", 3097 | "func": "// Randomly throw an error rather than\n// pass on message.\nif (Math.random() < 0.5) {\n node.error(\"a random error\", msg);\n} else {\n return msg;\n}", 3098 | "outputs": 1, 3099 | "noerr": 0, 3100 | "x": 320, 3101 | "y": 320, 3102 | "wires": [ 3103 | [ 3104 | "f22b1e9a.5d89b" 3105 | ] 3106 | ] 3107 | }, 3108 | { 3109 | "id": "27e61f12.c1a15", 3110 | "type": "inject", 3111 | "z": "fc046f99.4be08", 3112 | "name": "", 3113 | "topic": "", 3114 | "payload": "", 3115 | "payloadType": "date", 3116 | "repeat": "", 3117 | "crontab": "", 3118 | "once": false, 3119 | "onceDelay": 0.1, 3120 | "x": 100, 3121 | "y": 320, 3122 | "wires": [ 3123 | [ 3124 | "d7d08440.31b678" 3125 | ] 3126 | ] 3127 | }, 3128 | { 3129 | "id": "f22b1e9a.5d89b", 3130 | "type": "debug", 3131 | "z": "fc046f99.4be08", 3132 | "name": "", 3133 | "active": true, 3134 | "tosidebar": true, 3135 | "console": false, 3136 | "tostatus": false, 3137 | "complete": "false", 3138 | "x": 510, 3139 | "y": 320, 3140 | "wires": [] 3141 | }, 3142 | { 3143 | "id": "2166290d.98d736", 3144 | "type": "delay", 3145 | "z": "fc046f99.4be08", 3146 | "name": "", 3147 | "pauseType": "delay", 3148 | "timeout": "2", 3149 | "timeoutUnits": "seconds", 3150 | "rate": "1", 3151 | "nbRateUnits": "1", 3152 | "rateUnits": "second", 3153 | "randomFirst": "1", 3154 | "randomLast": "5", 3155 | "randomUnits": "seconds", 3156 | "drop": false, 3157 | "x": 240, 3158 | "y": 380, 3159 | "wires": [ 3160 | [ 3161 | "d7d08440.31b678" 3162 | ] 3163 | ] 3164 | }, 3165 | { 3166 | "id": "9c8ab214.0ecaa", 3167 | "type": "debug", 3168 | "z": "fc046f99.4be08", 3169 | "name": "", 3170 | "active": true, 3171 | "tosidebar": true, 3172 | "console": false, 3173 | "tostatus": false, 3174 | "complete": "error", 3175 | "targetType": "msg", 3176 | "x": 240, 3177 | "y": 440, 3178 | "wires": [] 3179 | }, 3180 | { 3181 | "id": "634256b7.2d6818", 3182 | "type": "inject", 3183 | "z": "64133d39.bb0394", 3184 | "name": "JSON String", 3185 | "topic": "", 3186 | "payload": "{\"a\":1}", 3187 | "payloadType": "str", 3188 | "repeat": "", 3189 | "crontab": "", 3190 | "once": false, 3191 | "onceDelay": 0.1, 3192 | "x": 110, 3193 | "y": 80, 3194 | "wires": [ 3195 | [ 3196 | "a2fe0fc8.095e1" 3197 | ] 3198 | ] 3199 | }, 3200 | { 3201 | "id": "a2fe0fc8.095e1", 3202 | "type": "json", 3203 | "z": "64133d39.bb0394", 3204 | "name": "", 3205 | "property": "payload", 3206 | "action": "", 3207 | "pretty": false, 3208 | "x": 270, 3209 | "y": 80, 3210 | "wires": [ 3211 | [ 3212 | "9a4ce2b8.47698" 3213 | ] 3214 | ] 3215 | }, 3216 | { 3217 | "id": "9a4ce2b8.47698", 3218 | "type": "debug", 3219 | "z": "64133d39.bb0394", 3220 | "name": "", 3221 | "active": true, 3222 | "tosidebar": true, 3223 | "console": false, 3224 | "tostatus": false, 3225 | "complete": "false", 3226 | "x": 430, 3227 | "y": 80, 3228 | "wires": [] 3229 | }, 3230 | { 3231 | "id": "80032e2.7c92cd", 3232 | "type": "inject", 3233 | "z": "64133d39.bb0394", 3234 | "name": "Object", 3235 | "topic": "", 3236 | "payload": "{\"a\":1}", 3237 | "payloadType": "json", 3238 | "repeat": "", 3239 | "crontab": "", 3240 | "once": false, 3241 | "onceDelay": 0.1, 3242 | "x": 90, 3243 | "y": 120, 3244 | "wires": [ 3245 | [ 3246 | "cd40a0f4.4f5ac" 3247 | ] 3248 | ] 3249 | }, 3250 | { 3251 | "id": "cd40a0f4.4f5ac", 3252 | "type": "json", 3253 | "z": "64133d39.bb0394", 3254 | "name": "", 3255 | "property": "payload", 3256 | "action": "", 3257 | "pretty": false, 3258 | "x": 270, 3259 | "y": 120, 3260 | "wires": [ 3261 | [ 3262 | "478b4106.4fd7c" 3263 | ] 3264 | ] 3265 | }, 3266 | { 3267 | "id": "478b4106.4fd7c", 3268 | "type": "debug", 3269 | "z": "64133d39.bb0394", 3270 | "name": "", 3271 | "active": true, 3272 | "tosidebar": true, 3273 | "console": false, 3274 | "tostatus": false, 3275 | "complete": "false", 3276 | "x": 430, 3277 | "y": 120, 3278 | "wires": [] 3279 | }, 3280 | { 3281 | "id": "aa69f344.f8d1f", 3282 | "type": "comment", 3283 | "z": "64133d39.bb0394", 3284 | "name": "Convert to/from YAML", 3285 | "info": "", 3286 | "x": 120, 3287 | "y": 360, 3288 | "wires": [] 3289 | }, 3290 | { 3291 | "id": "16750af7.81dec5", 3292 | "type": "inject", 3293 | "z": "64133d39.bb0394", 3294 | "name": "YAML String", 3295 | "topic": "", 3296 | "payload": "{\"a\":1}", 3297 | "payloadType": "str", 3298 | "repeat": "", 3299 | "crontab": "", 3300 | "once": false, 3301 | "onceDelay": 0.1, 3302 | "x": 110, 3303 | "y": 400, 3304 | "wires": [ 3305 | [ 3306 | "cf3ec6ca.341af8" 3307 | ] 3308 | ] 3309 | }, 3310 | { 3311 | "id": "ff2bdc86.6fca9", 3312 | "type": "debug", 3313 | "z": "64133d39.bb0394", 3314 | "name": "", 3315 | "active": true, 3316 | "tosidebar": true, 3317 | "console": false, 3318 | "tostatus": false, 3319 | "complete": "false", 3320 | "x": 590, 3321 | "y": 400, 3322 | "wires": [] 3323 | }, 3324 | { 3325 | "id": "3498b3bc.5789fc", 3326 | "type": "inject", 3327 | "z": "64133d39.bb0394", 3328 | "name": "Object", 3329 | "topic": "", 3330 | "payload": "{\"a\":1, \"b\":[1,2,3]}", 3331 | "payloadType": "json", 3332 | "repeat": "", 3333 | "crontab": "", 3334 | "once": false, 3335 | "onceDelay": 0.1, 3336 | "x": 90, 3337 | "y": 440, 3338 | "wires": [ 3339 | [ 3340 | "c86f7734.23bbd8" 3341 | ] 3342 | ] 3343 | }, 3344 | { 3345 | "id": "9ea78caa.8a64f", 3346 | "type": "debug", 3347 | "z": "64133d39.bb0394", 3348 | "name": "", 3349 | "active": true, 3350 | "tosidebar": true, 3351 | "console": false, 3352 | "tostatus": false, 3353 | "complete": "false", 3354 | "x": 430, 3355 | "y": 440, 3356 | "wires": [] 3357 | }, 3358 | { 3359 | "id": "cf3ec6ca.341af8", 3360 | "type": "template", 3361 | "z": "64133d39.bb0394", 3362 | "name": "", 3363 | "field": "payload", 3364 | "fieldType": "msg", 3365 | "format": "yaml", 3366 | "syntax": "plain", 3367 | "template": "a: 1\nb:\n - 1\n - 2\n - 3", 3368 | "output": "str", 3369 | "x": 280, 3370 | "y": 400, 3371 | "wires": [ 3372 | [ 3373 | "87cb7d01.add34" 3374 | ] 3375 | ] 3376 | }, 3377 | { 3378 | "id": "c86f7734.23bbd8", 3379 | "type": "yaml", 3380 | "z": "64133d39.bb0394", 3381 | "property": "payload", 3382 | "name": "", 3383 | "x": 250, 3384 | "y": 440, 3385 | "wires": [ 3386 | [ 3387 | "9ea78caa.8a64f" 3388 | ] 3389 | ] 3390 | }, 3391 | { 3392 | "id": "87cb7d01.add34", 3393 | "type": "yaml", 3394 | "z": "64133d39.bb0394", 3395 | "property": "payload", 3396 | "name": "", 3397 | "x": 430, 3398 | "y": 400, 3399 | "wires": [ 3400 | [ 3401 | "ff2bdc86.6fca9" 3402 | ] 3403 | ] 3404 | }, 3405 | { 3406 | "id": "3fc8a8e1.994198", 3407 | "type": "comment", 3408 | "z": "64133d39.bb0394", 3409 | "name": "Convert to/from XML", 3410 | "info": "", 3411 | "x": 120, 3412 | "y": 200, 3413 | "wires": [] 3414 | }, 3415 | { 3416 | "id": "1b546d47.9474e3", 3417 | "type": "inject", 3418 | "z": "64133d39.bb0394", 3419 | "name": "XML String", 3420 | "topic": "", 3421 | "payload": "{\"a\":1}", 3422 | "payloadType": "str", 3423 | "repeat": "", 3424 | "crontab": "", 3425 | "once": false, 3426 | "onceDelay": 0.1, 3427 | "x": 100, 3428 | "y": 240, 3429 | "wires": [ 3430 | [ 3431 | "d72b2bfd.77d068" 3432 | ] 3433 | ] 3434 | }, 3435 | { 3436 | "id": "1adf407d.6c4fe", 3437 | "type": "debug", 3438 | "z": "64133d39.bb0394", 3439 | "name": "", 3440 | "active": true, 3441 | "tosidebar": true, 3442 | "console": false, 3443 | "tostatus": false, 3444 | "complete": "false", 3445 | "x": 590, 3446 | "y": 240, 3447 | "wires": [] 3448 | }, 3449 | { 3450 | "id": "46638890.8ae758", 3451 | "type": "inject", 3452 | "z": "64133d39.bb0394", 3453 | "name": "Object", 3454 | "topic": "", 3455 | "payload": "{\"note\":{\"$\":{\"priority\":\"high\"},\"to\":[\"Nick\"],\"from\":[\"Dave\"],\"heading\":[\"Reminder\"],\"body\":[\"Update the website\"]}}", 3456 | "payloadType": "json", 3457 | "repeat": "", 3458 | "crontab": "", 3459 | "once": false, 3460 | "onceDelay": 0.1, 3461 | "x": 90, 3462 | "y": 280, 3463 | "wires": [ 3464 | [ 3465 | "dae1d291.de0d2" 3466 | ] 3467 | ] 3468 | }, 3469 | { 3470 | "id": "6fefca67.3669e4", 3471 | "type": "debug", 3472 | "z": "64133d39.bb0394", 3473 | "name": "", 3474 | "active": true, 3475 | "tosidebar": true, 3476 | "console": false, 3477 | "tostatus": false, 3478 | "complete": "false", 3479 | "x": 430, 3480 | "y": 280, 3481 | "wires": [] 3482 | }, 3483 | { 3484 | "id": "d72b2bfd.77d068", 3485 | "type": "template", 3486 | "z": "64133d39.bb0394", 3487 | "name": "", 3488 | "field": "payload", 3489 | "fieldType": "msg", 3490 | "format": "text", 3491 | "syntax": "plain", 3492 | "template": "\n Nick\n Dave\n Reminder\n Update the website\n", 3493 | "output": "str", 3494 | "x": 280, 3495 | "y": 240, 3496 | "wires": [ 3497 | [ 3498 | "1746464a.87aa4a" 3499 | ] 3500 | ] 3501 | }, 3502 | { 3503 | "id": "1746464a.87aa4a", 3504 | "type": "xml", 3505 | "z": "64133d39.bb0394", 3506 | "name": "", 3507 | "property": "payload", 3508 | "attr": "", 3509 | "chr": "", 3510 | "x": 430, 3511 | "y": 240, 3512 | "wires": [ 3513 | [ 3514 | "1adf407d.6c4fe" 3515 | ] 3516 | ] 3517 | }, 3518 | { 3519 | "id": "dae1d291.de0d2", 3520 | "type": "xml", 3521 | "z": "64133d39.bb0394", 3522 | "name": "", 3523 | "property": "payload", 3524 | "attr": "", 3525 | "chr": "", 3526 | "x": 250, 3527 | "y": 280, 3528 | "wires": [ 3529 | [ 3530 | "6fefca67.3669e4" 3531 | ] 3532 | ] 3533 | }, 3534 | { 3535 | "id": "a48b7895.08f4d8", 3536 | "type": "comment", 3537 | "z": "64133d39.bb0394", 3538 | "name": "Generate CSV output", 3539 | "info": "", 3540 | "x": 120, 3541 | "y": 520, 3542 | "wires": [] 3543 | }, 3544 | { 3545 | "id": "457d9ad6.b737b4", 3546 | "type": "inject", 3547 | "z": "64133d39.bb0394", 3548 | "name": "single", 3549 | "topic": "", 3550 | "payload": "", 3551 | "payloadType": "date", 3552 | "repeat": "", 3553 | "crontab": "", 3554 | "once": false, 3555 | "onceDelay": 0.1, 3556 | "x": 90, 3557 | "y": 560, 3558 | "wires": [ 3559 | [ 3560 | "1e05fafd.887b05" 3561 | ] 3562 | ] 3563 | }, 3564 | { 3565 | "id": "1e05fafd.887b05", 3566 | "type": "change", 3567 | "z": "64133d39.bb0394", 3568 | "name": "Generate single payload", 3569 | "rules": [ 3570 | { 3571 | "t": "set", 3572 | "p": "payload", 3573 | "pt": "msg", 3574 | "to": "{ \"a\":$floor(100*$random()),\"b\":$floor(100*$random()),\"c\":$floor(100*$random())}", 3575 | "tot": "jsonata" 3576 | } 3577 | ], 3578 | "action": "", 3579 | "property": "", 3580 | "from": "", 3581 | "to": "", 3582 | "reg": false, 3583 | "x": 270, 3584 | "y": 560, 3585 | "wires": [ 3586 | [ 3587 | "e9546682.b39898" 3588 | ] 3589 | ] 3590 | }, 3591 | { 3592 | "id": "e9546682.b39898", 3593 | "type": "csv", 3594 | "z": "64133d39.bb0394", 3595 | "name": "", 3596 | "sep": ",", 3597 | "hdrin": "", 3598 | "hdrout": false, 3599 | "multi": "one", 3600 | "ret": "\\n", 3601 | "temp": "a,b,c", 3602 | "skip": "0", 3603 | "x": 450, 3604 | "y": 560, 3605 | "wires": [ 3606 | [ 3607 | "f83ad3b0.78d32" 3608 | ] 3609 | ] 3610 | }, 3611 | { 3612 | "id": "f83ad3b0.78d32", 3613 | "type": "debug", 3614 | "z": "64133d39.bb0394", 3615 | "name": "", 3616 | "active": true, 3617 | "tosidebar": true, 3618 | "console": false, 3619 | "tostatus": false, 3620 | "complete": "false", 3621 | "x": 590, 3622 | "y": 560, 3623 | "wires": [] 3624 | }, 3625 | { 3626 | "id": "ae242f2c.d1c8a", 3627 | "type": "inject", 3628 | "z": "64133d39.bb0394", 3629 | "name": "array", 3630 | "topic": "", 3631 | "payload": "", 3632 | "payloadType": "date", 3633 | "repeat": "", 3634 | "crontab": "", 3635 | "once": false, 3636 | "onceDelay": 0.1, 3637 | "x": 90, 3638 | "y": 620, 3639 | "wires": [ 3640 | [ 3641 | "7535f521.4a88bc" 3642 | ] 3643 | ] 3644 | }, 3645 | { 3646 | "id": "7535f521.4a88bc", 3647 | "type": "change", 3648 | "z": "64133d39.bb0394", 3649 | "name": "Generate array payload", 3650 | "rules": [ 3651 | { 3652 | "t": "set", 3653 | "p": "payload", 3654 | "pt": "msg", 3655 | "to": "[\t { \"a\":$floor(100*$random()),\"b\":$floor(100*$random()),\"c\":$floor(100*$random())},\t { \"a\":$floor(100*$random()),\"b\":$floor(100*$random()),\"c\":$floor(100*$random())},\t { \"a\":$floor(100*$random()),\"b\":$floor(100*$random()),\"c\":$floor(100*$random())},\t { \"a\":$floor(100*$random()),\"b\":$floor(100*$random()),\"c\":$floor(100*$random())}\t]", 3656 | "tot": "jsonata" 3657 | } 3658 | ], 3659 | "action": "", 3660 | "property": "", 3661 | "from": "", 3662 | "to": "", 3663 | "reg": false, 3664 | "x": 270, 3665 | "y": 620, 3666 | "wires": [ 3667 | [ 3668 | "f4e0465f.ef0338" 3669 | ] 3670 | ] 3671 | }, 3672 | { 3673 | "id": "f4e0465f.ef0338", 3674 | "type": "csv", 3675 | "z": "64133d39.bb0394", 3676 | "name": "", 3677 | "sep": ",", 3678 | "hdrin": "", 3679 | "hdrout": true, 3680 | "multi": "one", 3681 | "ret": "\\n", 3682 | "temp": "a,b,c", 3683 | "skip": "0", 3684 | "x": 450, 3685 | "y": 620, 3686 | "wires": [ 3687 | [ 3688 | "6eb67fdf.58626" 3689 | ] 3690 | ] 3691 | }, 3692 | { 3693 | "id": "6eb67fdf.58626", 3694 | "type": "debug", 3695 | "z": "64133d39.bb0394", 3696 | "name": "", 3697 | "active": true, 3698 | "tosidebar": true, 3699 | "console": false, 3700 | "tostatus": false, 3701 | "complete": "false", 3702 | "x": 590, 3703 | "y": 620, 3704 | "wires": [] 3705 | }, 3706 | { 3707 | "id": "3a561e7c.086d22", 3708 | "type": "comment", 3709 | "z": "64133d39.bb0394", 3710 | "name": "Generate CSV output", 3711 | "info": "", 3712 | "x": 120, 3713 | "y": 700, 3714 | "wires": [] 3715 | }, 3716 | { 3717 | "id": "73e4e16.4d9742", 3718 | "type": "inject", 3719 | "z": "64133d39.bb0394", 3720 | "name": "Inject", 3721 | "topic": "", 3722 | "payload": "", 3723 | "payloadType": "date", 3724 | "repeat": "", 3725 | "crontab": "", 3726 | "once": false, 3727 | "onceDelay": 0.1, 3728 | "x": 110, 3729 | "y": 740, 3730 | "wires": [ 3731 | [ 3732 | "2bef78fd.ae70f8" 3733 | ] 3734 | ] 3735 | }, 3736 | { 3737 | "id": "90ed51dc.dcc71", 3738 | "type": "csv", 3739 | "z": "64133d39.bb0394", 3740 | "name": "", 3741 | "sep": ",", 3742 | "hdrin": true, 3743 | "hdrout": false, 3744 | "multi": "mult", 3745 | "ret": "\\n", 3746 | "temp": "", 3747 | "skip": "1", 3748 | "x": 410, 3749 | "y": 740, 3750 | "wires": [ 3751 | [ 3752 | "9aace6e7.adc538" 3753 | ] 3754 | ] 3755 | }, 3756 | { 3757 | "id": "9aace6e7.adc538", 3758 | "type": "debug", 3759 | "z": "64133d39.bb0394", 3760 | "name": "", 3761 | "active": true, 3762 | "tosidebar": true, 3763 | "console": false, 3764 | "tostatus": false, 3765 | "complete": "false", 3766 | "x": 570, 3767 | "y": 740, 3768 | "wires": [] 3769 | }, 3770 | { 3771 | "id": "2bef78fd.ae70f8", 3772 | "type": "template", 3773 | "z": "64133d39.bb0394", 3774 | "name": "CSV data", 3775 | "field": "payload", 3776 | "fieldType": "msg", 3777 | "format": "handlebars", 3778 | "syntax": "mustache", 3779 | "template": "# This is some random data\na,b,c\n80,18,2\n52,36,10\n91,18,61\n32,47,65", 3780 | "output": "str", 3781 | "x": 260, 3782 | "y": 740, 3783 | "wires": [ 3784 | [ 3785 | "90ed51dc.dcc71" 3786 | ] 3787 | ] 3788 | }, 3789 | { 3790 | "id": "df6514f0.029748", 3791 | "type": "inject", 3792 | "z": "64133d39.bb0394", 3793 | "name": "inject", 3794 | "topic": "", 3795 | "payload": "", 3796 | "payloadType": "date", 3797 | "repeat": "", 3798 | "crontab": "", 3799 | "once": false, 3800 | "onceDelay": "", 3801 | "x": 110, 3802 | "y": 880, 3803 | "wires": [ 3804 | [ 3805 | "11f53f61.2f7be1" 3806 | ] 3807 | ] 3808 | }, 3809 | { 3810 | "id": "11f53f61.2f7be1", 3811 | "type": "template", 3812 | "z": "64133d39.bb0394", 3813 | "name": "", 3814 | "field": "payload", 3815 | "fieldType": "msg", 3816 | "format": "handlebars", 3817 | "syntax": "mustache", 3818 | "template": "one\ntwo\nthree\nfour\nfive", 3819 | "x": 240, 3820 | "y": 880, 3821 | "wires": [ 3822 | [ 3823 | "760c1d71.c29744" 3824 | ] 3825 | ] 3826 | }, 3827 | { 3828 | "id": "760c1d71.c29744", 3829 | "type": "split", 3830 | "z": "64133d39.bb0394", 3831 | "name": "", 3832 | "splt": "\\n", 3833 | "x": 190, 3834 | "y": 940, 3835 | "wires": [ 3836 | [ 3837 | "3e427aac.9b9596" 3838 | ] 3839 | ] 3840 | }, 3841 | { 3842 | "id": "d44d4767.945fd8", 3843 | "type": "join", 3844 | "z": "64133d39.bb0394", 3845 | "name": "", 3846 | "mode": "auto", 3847 | "build": "string", 3848 | "property": "payload", 3849 | "propertyType": "msg", 3850 | "key": "topic", 3851 | "joiner": "\\n", 3852 | "timeout": "", 3853 | "count": "", 3854 | "x": 530, 3855 | "y": 940, 3856 | "wires": [ 3857 | [ 3858 | "bfe3e43b.85fa88" 3859 | ] 3860 | ] 3861 | }, 3862 | { 3863 | "id": "bfe3e43b.85fa88", 3864 | "type": "debug", 3865 | "z": "64133d39.bb0394", 3866 | "name": "debug", 3867 | "active": true, 3868 | "tosidebar": true, 3869 | "console": false, 3870 | "tostatus": false, 3871 | "complete": "payload", 3872 | "targetType": "msg", 3873 | "x": 650, 3874 | "y": 940, 3875 | "wires": [] 3876 | }, 3877 | { 3878 | "id": "3e427aac.9b9596", 3879 | "type": "change", 3880 | "z": "64133d39.bb0394", 3881 | "name": "Prepend line number", 3882 | "rules": [ 3883 | { 3884 | "t": "set", 3885 | "p": "payload", 3886 | "pt": "msg", 3887 | "to": "(parts.index+1) & \": \" & payload", 3888 | "tot": "jsonata" 3889 | } 3890 | ], 3891 | "action": "", 3892 | "property": "", 3893 | "from": "", 3894 | "to": "", 3895 | "reg": false, 3896 | "x": 360, 3897 | "y": 940, 3898 | "wires": [ 3899 | [ 3900 | "d44d4767.945fd8" 3901 | ] 3902 | ] 3903 | }, 3904 | { 3905 | "id": "9ccdf268.c96ff", 3906 | "type": "inject", 3907 | "z": "ac14500e.2c57d", 3908 | "name": "", 3909 | "topic": "", 3910 | "payload": "", 3911 | "payloadType": "date", 3912 | "repeat": "", 3913 | "crontab": "", 3914 | "once": false, 3915 | "onceDelay": 0.1, 3916 | "x": 100, 3917 | "y": 1660, 3918 | "wires": [ 3919 | [ 3920 | "38950a5.28d15f6", 3921 | "2c532f67.0330e" 3922 | ] 3923 | ] 3924 | }, 3925 | { 3926 | "id": "38950a5.28d15f6", 3927 | "type": "debug", 3928 | "z": "ac14500e.2c57d", 3929 | "name": "", 3930 | "active": true, 3931 | "tosidebar": true, 3932 | "console": false, 3933 | "tostatus": false, 3934 | "complete": "false", 3935 | "x": 610, 3936 | "y": 1660, 3937 | "wires": [] 3938 | }, 3939 | { 3940 | "id": "2c532f67.0330e", 3941 | "type": "trigger", 3942 | "z": "ac14500e.2c57d", 3943 | "op1": "reset", 3944 | "op2": "true", 3945 | "op1type": "str", 3946 | "op2type": "bool", 3947 | "duration": "2", 3948 | "extend": true, 3949 | "units": "s", 3950 | "reset": "", 3951 | "bytopic": "all", 3952 | "name": "", 3953 | "x": 260, 3954 | "y": 1700, 3955 | "wires": [ 3956 | [ 3957 | "e4e42b96.97a338" 3958 | ] 3959 | ] 3960 | }, 3961 | { 3962 | "id": "e4e42b96.97a338", 3963 | "type": "trigger", 3964 | "z": "ac14500e.2c57d", 3965 | "op1": "0", 3966 | "op2": "0", 3967 | "op1type": "num", 3968 | "op2type": "str", 3969 | "duration": "-2", 3970 | "extend": false, 3971 | "units": "s", 3972 | "reset": "reset", 3973 | "bytopic": "all", 3974 | "name": "", 3975 | "x": 420, 3976 | "y": 1700, 3977 | "wires": [ 3978 | [ 3979 | "38950a5.28d15f6" 3980 | ] 3981 | ] 3982 | } 3983 | ] -------------------------------------------------------------------------------- /flows_cred.json: -------------------------------------------------------------------------------- 1 | { 2 | "b439d8b0.991988": {} 3 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cookbook-flows", 3 | "description": "A Node-RED Project containing flows from cookbook.nodered.org", 4 | "version": "0.0.1", 5 | "dependencies": {}, 6 | "node-red": { 7 | "settings": { 8 | "flowFile": "flows.json", 9 | "credentialsFile": "flows_cred.json" 10 | } 11 | } 12 | } --------------------------------------------------------------------------------