├── README.md ├── dashboard.json ├── netatmo_influx.py └── screenshot.png /README.md: -------------------------------------------------------------------------------- 1 | # grafana-netatmo 2 | Netatmo Weather Station dashboard for Grafana 3 | 4 | https://grafana.com/grafana/dashboards/12378 5 | 6 | ![Screenshot](https://raw.githubusercontent.com/florianbeer/grafana-netatmo/master/screenshot.png) 7 | 8 | ## Installation 9 | 10 | * Create a [Netatmo developer account](https://dev.netatmo.com/apidocumentation) 11 | * Create the file `~/.netatmo.credentials` and make it writable 12 | ``` 13 | { 14 | "CLIENT_ID" : "xxx", 15 | "CLIENT_SECRET" : "xxx", 16 | "REFRESH_TOKEN" : "xxx" 17 | } 18 | ``` 19 | * This script assumes you have InfluxDB running on the same machine as this script and it uses no authentication. 20 | * Create a cron job to run the script periodically e.g. 21 | 22 | ``` 23 | # cat /etc/cron.d/netatmo 24 | */5 * * * * root /usr/local/bin/netatmo_influx.py > /dev/null 2>&1 25 | ``` 26 | -------------------------------------------------------------------------------- /dashboard.json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_NETATMO", 5 | "label": "Netatmo", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "influxdb", 9 | "pluginName": "InfluxDB" 10 | } 11 | ], 12 | "__elements": {}, 13 | "__requires": [ 14 | { 15 | "type": "panel", 16 | "id": "gauge", 17 | "name": "Gauge", 18 | "version": "" 19 | }, 20 | { 21 | "type": "grafana", 22 | "id": "grafana", 23 | "name": "Grafana", 24 | "version": "9.3.0" 25 | }, 26 | { 27 | "type": "datasource", 28 | "id": "influxdb", 29 | "name": "InfluxDB", 30 | "version": "1.0.0" 31 | }, 32 | { 33 | "type": "panel", 34 | "id": "stat", 35 | "name": "Stat", 36 | "version": "" 37 | }, 38 | { 39 | "type": "panel", 40 | "id": "text", 41 | "name": "Text", 42 | "version": "" 43 | }, 44 | { 45 | "type": "panel", 46 | "id": "timeseries", 47 | "name": "Time series", 48 | "version": "" 49 | } 50 | ], 51 | "annotations": { 52 | "list": [ 53 | { 54 | "$$hashKey": "object:73", 55 | "builtIn": 1, 56 | "datasource": { 57 | "type": "datasource", 58 | "uid": "grafana" 59 | }, 60 | "enable": true, 61 | "hide": true, 62 | "iconColor": "rgba(0, 211, 255, 1)", 63 | "name": "Annotations & Alerts", 64 | "target": { 65 | "limit": 100, 66 | "matchAny": false, 67 | "tags": [], 68 | "type": "dashboard" 69 | }, 70 | "type": "dashboard" 71 | } 72 | ] 73 | }, 74 | "description": "", 75 | "editable": true, 76 | "fiscalYearStartMonth": 0, 77 | "graphTooltip": 0, 78 | "id": null, 79 | "links": [], 80 | "liveNow": false, 81 | "panels": [ 82 | { 83 | "datasource": { 84 | "type": "datasource", 85 | "uid": "grafana" 86 | }, 87 | "gridPos": { 88 | "h": 6, 89 | "w": 7, 90 | "x": 0, 91 | "y": 0 92 | }, 93 | "id": 39, 94 | "links": [], 95 | "options": { 96 | "code": { 97 | "language": "plaintext", 98 | "showLineNumbers": false, 99 | "showMiniMap": false 100 | }, 101 | "content": "
\n

$Station

\n
", 102 | "mode": "html" 103 | }, 104 | "pluginVersion": "9.3.0", 105 | "targets": [ 106 | { 107 | "datasource": { 108 | "type": "datasource", 109 | "uid": "grafana" 110 | }, 111 | "refId": "A" 112 | } 113 | ], 114 | "title": "Station", 115 | "transparent": true, 116 | "type": "text" 117 | }, 118 | { 119 | "datasource": { 120 | "type": "influxdb", 121 | "uid": "${DS_NETATMO}" 122 | }, 123 | "fieldConfig": { 124 | "defaults": { 125 | "color": { 126 | "mode": "thresholds" 127 | }, 128 | "mappings": [ 129 | { 130 | "options": { 131 | "match": "null", 132 | "result": { 133 | "text": "N/A" 134 | } 135 | }, 136 | "type": "special" 137 | } 138 | ], 139 | "thresholds": { 140 | "mode": "absolute", 141 | "steps": [ 142 | { 143 | "color": "green", 144 | "value": null 145 | }, 146 | { 147 | "color": "red", 148 | "value": 80 149 | } 150 | ] 151 | }, 152 | "unit": "lengthm" 153 | }, 154 | "overrides": [] 155 | }, 156 | "gridPos": { 157 | "h": 3, 158 | "w": 4, 159 | "x": 7, 160 | "y": 0 161 | }, 162 | "id": 49, 163 | "links": [], 164 | "maxDataPoints": 100, 165 | "options": { 166 | "colorMode": "none", 167 | "graphMode": "none", 168 | "justifyMode": "auto", 169 | "orientation": "horizontal", 170 | "reduceOptions": { 171 | "calcs": [ 172 | "lastNotNull" 173 | ], 174 | "fields": "/^timezone\\.last$/", 175 | "values": false 176 | }, 177 | "textMode": "auto" 178 | }, 179 | "pluginVersion": "9.3.0", 180 | "targets": [ 181 | { 182 | "datasource": { 183 | "type": "influxdb", 184 | "uid": "${DS_NETATMO}" 185 | }, 186 | "groupBy": [ 187 | { 188 | "params": [ 189 | "$__interval" 190 | ], 191 | "type": "time" 192 | }, 193 | { 194 | "params": [ 195 | "null" 196 | ], 197 | "type": "fill" 198 | } 199 | ], 200 | "measurement": "timezone", 201 | "orderByTime": "ASC", 202 | "policy": "default", 203 | "refId": "A", 204 | "resultFormat": "time_series", 205 | "select": [ 206 | [ 207 | { 208 | "params": [ 209 | "value" 210 | ], 211 | "type": "field" 212 | }, 213 | { 214 | "params": [], 215 | "type": "last" 216 | } 217 | ] 218 | ], 219 | "tags": [ 220 | { 221 | "key": "station", 222 | "operator": "=~", 223 | "value": "/^$Station$/" 224 | } 225 | ] 226 | } 227 | ], 228 | "title": "Timezone", 229 | "transparent": true, 230 | "type": "stat" 231 | }, 232 | { 233 | "datasource": { 234 | "type": "influxdb", 235 | "uid": "${DS_NETATMO}" 236 | }, 237 | "fieldConfig": { 238 | "defaults": { 239 | "color": { 240 | "mode": "palette-classic" 241 | }, 242 | "custom": { 243 | "axisCenteredZero": false, 244 | "axisColorMode": "text", 245 | "axisLabel": "dB", 246 | "axisPlacement": "auto", 247 | "barAlignment": 0, 248 | "drawStyle": "line", 249 | "fillOpacity": 10, 250 | "gradientMode": "none", 251 | "hideFrom": { 252 | "legend": false, 253 | "tooltip": false, 254 | "viz": false 255 | }, 256 | "lineInterpolation": "linear", 257 | "lineWidth": 1, 258 | "pointSize": 5, 259 | "scaleDistribution": { 260 | "type": "linear" 261 | }, 262 | "showPoints": "never", 263 | "spanNulls": true, 264 | "stacking": { 265 | "group": "A", 266 | "mode": "none" 267 | }, 268 | "thresholdsStyle": { 269 | "mode": "off" 270 | } 271 | }, 272 | "decimals": 0, 273 | "links": [], 274 | "mappings": [], 275 | "thresholds": { 276 | "mode": "absolute", 277 | "steps": [ 278 | { 279 | "color": "green", 280 | "value": null 281 | }, 282 | { 283 | "color": "red", 284 | "value": 80 285 | } 286 | ] 287 | }, 288 | "unit": "short" 289 | }, 290 | "overrides": [ 291 | { 292 | "matcher": { 293 | "id": "byName", 294 | "options": "Brainfusion Bedroom" 295 | }, 296 | "properties": [ 297 | { 298 | "id": "color", 299 | "value": { 300 | "fixedColor": "rgb(0, 220, 250)", 301 | "mode": "fixed" 302 | } 303 | } 304 | ] 305 | }, 306 | { 307 | "matcher": { 308 | "id": "byName", 309 | "options": "Brainfusion Indoor" 310 | }, 311 | "properties": [ 312 | { 313 | "id": "color", 314 | "value": { 315 | "fixedColor": "semi-dark-orange", 316 | "mode": "fixed" 317 | } 318 | } 319 | ] 320 | } 321 | ] 322 | }, 323 | "gridPos": { 324 | "h": 6, 325 | "w": 9, 326 | "x": 12, 327 | "y": 0 328 | }, 329 | "id": 69, 330 | "interval": "", 331 | "links": [], 332 | "options": { 333 | "legend": { 334 | "calcs": [], 335 | "displayMode": "list", 336 | "placement": "bottom", 337 | "showLegend": false 338 | }, 339 | "tooltip": { 340 | "mode": "multi", 341 | "sort": "none" 342 | } 343 | }, 344 | "pluginVersion": "9.3.0", 345 | "repeatDirection": "h", 346 | "targets": [ 347 | { 348 | "alias": "$tag_station $tag_module", 349 | "datasource": { 350 | "type": "influxdb", 351 | "uid": "${DS_NETATMO}" 352 | }, 353 | "groupBy": [ 354 | { 355 | "params": [ 356 | "10m" 357 | ], 358 | "type": "time" 359 | }, 360 | { 361 | "params": [ 362 | "module" 363 | ], 364 | "type": "tag" 365 | }, 366 | { 367 | "params": [ 368 | "station" 369 | ], 370 | "type": "tag" 371 | }, 372 | { 373 | "params": [ 374 | "previous" 375 | ], 376 | "type": "fill" 377 | } 378 | ], 379 | "measurement": "noise", 380 | "orderByTime": "ASC", 381 | "policy": "default", 382 | "refId": "A", 383 | "resultFormat": "time_series", 384 | "select": [ 385 | [ 386 | { 387 | "params": [ 388 | "value" 389 | ], 390 | "type": "field" 391 | }, 392 | { 393 | "params": [], 394 | "type": "last" 395 | } 396 | ] 397 | ], 398 | "tags": [ 399 | { 400 | "key": "station", 401 | "operator": "=~", 402 | "value": "/^$Station$/" 403 | } 404 | ] 405 | } 406 | ], 407 | "title": "Noise", 408 | "transparent": true, 409 | "type": "timeseries" 410 | }, 411 | { 412 | "datasource": { 413 | "type": "influxdb", 414 | "uid": "${DS_NETATMO}" 415 | }, 416 | "fieldConfig": { 417 | "defaults": { 418 | "color": { 419 | "mode": "thresholds" 420 | }, 421 | "mappings": [ 422 | { 423 | "options": { 424 | "match": "null", 425 | "result": { 426 | "text": "N/A" 427 | } 428 | }, 429 | "type": "special" 430 | } 431 | ], 432 | "max": 120, 433 | "min": 0, 434 | "thresholds": { 435 | "mode": "absolute", 436 | "steps": [ 437 | { 438 | "color": "#299c46", 439 | "value": null 440 | }, 441 | { 442 | "color": "rgba(237, 129, 40, 0.89)", 443 | "value": 80 444 | }, 445 | { 446 | "color": "#d44a3a", 447 | "value": 90 448 | } 449 | ] 450 | }, 451 | "unit": "dB" 452 | }, 453 | "overrides": [] 454 | }, 455 | "gridPos": { 456 | "h": 6, 457 | "w": 3, 458 | "x": 21, 459 | "y": 0 460 | }, 461 | "id": 6, 462 | "links": [], 463 | "options": { 464 | "orientation": "horizontal", 465 | "reduceOptions": { 466 | "calcs": [ 467 | "lastNotNull" 468 | ], 469 | "fields": "", 470 | "values": false 471 | }, 472 | "showThresholdLabels": false, 473 | "showThresholdMarkers": false 474 | }, 475 | "pluginVersion": "9.3.0", 476 | "repeatDirection": "h", 477 | "targets": [ 478 | { 479 | "alias": "$tag_station $tag_module", 480 | "datasource": { 481 | "type": "influxdb", 482 | "uid": "${DS_NETATMO}" 483 | }, 484 | "groupBy": [ 485 | { 486 | "params": [ 487 | "10m" 488 | ], 489 | "type": "time" 490 | }, 491 | { 492 | "params": [ 493 | "module" 494 | ], 495 | "type": "tag" 496 | }, 497 | { 498 | "params": [ 499 | "station" 500 | ], 501 | "type": "tag" 502 | }, 503 | { 504 | "params": [ 505 | "null" 506 | ], 507 | "type": "fill" 508 | } 509 | ], 510 | "measurement": "noise", 511 | "orderByTime": "ASC", 512 | "policy": "default", 513 | "query": "SELECT last(\"noise\") FROM /^$Station$/ WHERE (\"station\" =~ /^$Module$/) AND $timeFilter GROUP BY time(10m), \"module\", \"station\" fill(null)", 514 | "rawQuery": false, 515 | "refId": "A", 516 | "resultFormat": "time_series", 517 | "select": [ 518 | [ 519 | { 520 | "params": [ 521 | "value" 522 | ], 523 | "type": "field" 524 | }, 525 | { 526 | "params": [], 527 | "type": "last" 528 | } 529 | ] 530 | ], 531 | "tags": [ 532 | { 533 | "key": "station", 534 | "operator": "=~", 535 | "value": "/^$Station$/" 536 | }, 537 | { 538 | "condition": "AND", 539 | "key": "module", 540 | "operator": "=~", 541 | "value": "/^$Module$/" 542 | } 543 | ] 544 | } 545 | ], 546 | "title": "Noise Level", 547 | "transparent": true, 548 | "type": "gauge" 549 | }, 550 | { 551 | "datasource": { 552 | "type": "influxdb", 553 | "uid": "${DS_NETATMO}" 554 | }, 555 | "fieldConfig": { 556 | "defaults": { 557 | "color": { 558 | "mode": "thresholds" 559 | }, 560 | "mappings": [ 561 | { 562 | "options": { 563 | "match": "null", 564 | "result": { 565 | "text": "N/A" 566 | } 567 | }, 568 | "type": "special" 569 | } 570 | ], 571 | "thresholds": { 572 | "mode": "absolute", 573 | "steps": [ 574 | { 575 | "color": "green", 576 | "value": null 577 | }, 578 | { 579 | "color": "red", 580 | "value": 80 581 | } 582 | ] 583 | }, 584 | "unit": "lengthm" 585 | }, 586 | "overrides": [] 587 | }, 588 | "gridPos": { 589 | "h": 3, 590 | "w": 4, 591 | "x": 7, 592 | "y": 3 593 | }, 594 | "id": 37, 595 | "links": [], 596 | "maxDataPoints": 100, 597 | "options": { 598 | "colorMode": "none", 599 | "graphMode": "none", 600 | "justifyMode": "auto", 601 | "orientation": "horizontal", 602 | "reduceOptions": { 603 | "calcs": [ 604 | "lastNotNull" 605 | ], 606 | "fields": "", 607 | "values": false 608 | }, 609 | "textMode": "auto" 610 | }, 611 | "pluginVersion": "9.3.0", 612 | "targets": [ 613 | { 614 | "datasource": { 615 | "type": "influxdb", 616 | "uid": "${DS_NETATMO}" 617 | }, 618 | "groupBy": [ 619 | { 620 | "params": [ 621 | "$__interval" 622 | ], 623 | "type": "time" 624 | }, 625 | { 626 | "params": [ 627 | "null" 628 | ], 629 | "type": "fill" 630 | } 631 | ], 632 | "measurement": "altitude", 633 | "orderByTime": "ASC", 634 | "policy": "default", 635 | "refId": "A", 636 | "resultFormat": "time_series", 637 | "select": [ 638 | [ 639 | { 640 | "params": [ 641 | "value" 642 | ], 643 | "type": "field" 644 | }, 645 | { 646 | "params": [], 647 | "type": "last" 648 | } 649 | ] 650 | ], 651 | "tags": [ 652 | { 653 | "key": "station", 654 | "operator": "=~", 655 | "value": "/^$Station$/" 656 | } 657 | ] 658 | } 659 | ], 660 | "title": "Altitude", 661 | "transparent": true, 662 | "type": "stat" 663 | }, 664 | { 665 | "datasource": { 666 | "type": "influxdb", 667 | "uid": "${DS_NETATMO}" 668 | }, 669 | "fieldConfig": { 670 | "defaults": { 671 | "color": { 672 | "mode": "palette-classic" 673 | }, 674 | "custom": { 675 | "axisCenteredZero": false, 676 | "axisColorMode": "text", 677 | "axisLabel": "", 678 | "axisPlacement": "auto", 679 | "barAlignment": 0, 680 | "drawStyle": "line", 681 | "fillOpacity": 10, 682 | "gradientMode": "none", 683 | "hideFrom": { 684 | "legend": false, 685 | "tooltip": false, 686 | "viz": false 687 | }, 688 | "lineInterpolation": "linear", 689 | "lineWidth": 1, 690 | "pointSize": 5, 691 | "scaleDistribution": { 692 | "type": "linear" 693 | }, 694 | "showPoints": "never", 695 | "spanNulls": true, 696 | "stacking": { 697 | "group": "A", 698 | "mode": "none" 699 | }, 700 | "thresholdsStyle": { 701 | "mode": "line+area" 702 | } 703 | }, 704 | "links": [], 705 | "mappings": [], 706 | "thresholds": { 707 | "mode": "absolute", 708 | "steps": [ 709 | { 710 | "color": "transparent", 711 | "value": null 712 | }, 713 | { 714 | "color": "orange", 715 | "value": 2000 716 | } 717 | ] 718 | }, 719 | "unit": "ppm" 720 | }, 721 | "overrides": [ 722 | { 723 | "matcher": { 724 | "id": "byName", 725 | "options": "Brainfusion Bedroom" 726 | }, 727 | "properties": [ 728 | { 729 | "id": "color", 730 | "value": { 731 | "fixedColor": "semi-dark-blue", 732 | "mode": "fixed" 733 | } 734 | } 735 | ] 736 | }, 737 | { 738 | "matcher": { 739 | "id": "byName", 740 | "options": "Brainfusion Indoor" 741 | }, 742 | "properties": [ 743 | { 744 | "id": "color", 745 | "value": { 746 | "fixedColor": "dark-blue", 747 | "mode": "fixed" 748 | } 749 | } 750 | ] 751 | } 752 | ] 753 | }, 754 | "gridPos": { 755 | "h": 6, 756 | "w": 12, 757 | "x": 0, 758 | "y": 6 759 | }, 760 | "id": 4, 761 | "interval": "", 762 | "links": [], 763 | "options": { 764 | "legend": { 765 | "calcs": [ 766 | "mean" 767 | ], 768 | "displayMode": "list", 769 | "placement": "bottom", 770 | "showLegend": false 771 | }, 772 | "tooltip": { 773 | "mode": "multi", 774 | "sort": "none" 775 | } 776 | }, 777 | "pluginVersion": "9.3.0", 778 | "repeatDirection": "h", 779 | "targets": [ 780 | { 781 | "alias": "$tag_station $tag_module", 782 | "datasource": { 783 | "type": "influxdb", 784 | "uid": "${DS_NETATMO}" 785 | }, 786 | "groupBy": [ 787 | { 788 | "params": [ 789 | "10m" 790 | ], 791 | "type": "time" 792 | }, 793 | { 794 | "params": [ 795 | "module" 796 | ], 797 | "type": "tag" 798 | }, 799 | { 800 | "params": [ 801 | "station" 802 | ], 803 | "type": "tag" 804 | }, 805 | { 806 | "params": [ 807 | "previous" 808 | ], 809 | "type": "fill" 810 | } 811 | ], 812 | "measurement": "co2", 813 | "orderByTime": "ASC", 814 | "policy": "default", 815 | "refId": "A", 816 | "resultFormat": "time_series", 817 | "select": [ 818 | [ 819 | { 820 | "params": [ 821 | "value" 822 | ], 823 | "type": "field" 824 | }, 825 | { 826 | "params": [], 827 | "type": "last" 828 | } 829 | ] 830 | ], 831 | "tags": [ 832 | { 833 | "key": "station", 834 | "operator": "=~", 835 | "value": "/^$Station$/" 836 | } 837 | ] 838 | } 839 | ], 840 | "title": "CO2", 841 | "transparent": true, 842 | "type": "timeseries" 843 | }, 844 | { 845 | "datasource": { 846 | "type": "influxdb", 847 | "uid": "${DS_NETATMO}" 848 | }, 849 | "fieldConfig": { 850 | "defaults": { 851 | "color": { 852 | "mode": "palette-classic" 853 | }, 854 | "custom": { 855 | "axisCenteredZero": false, 856 | "axisColorMode": "text", 857 | "axisLabel": "mbar", 858 | "axisPlacement": "auto", 859 | "barAlignment": 0, 860 | "drawStyle": "line", 861 | "fillOpacity": 10, 862 | "gradientMode": "none", 863 | "hideFrom": { 864 | "legend": false, 865 | "tooltip": false, 866 | "viz": false 867 | }, 868 | "lineInterpolation": "linear", 869 | "lineWidth": 1, 870 | "pointSize": 5, 871 | "scaleDistribution": { 872 | "type": "linear" 873 | }, 874 | "showPoints": "never", 875 | "spanNulls": true, 876 | "stacking": { 877 | "group": "A", 878 | "mode": "none" 879 | }, 880 | "thresholdsStyle": { 881 | "mode": "off" 882 | } 883 | }, 884 | "links": [], 885 | "mappings": [], 886 | "thresholds": { 887 | "mode": "absolute", 888 | "steps": [ 889 | { 890 | "color": "green", 891 | "value": null 892 | }, 893 | { 894 | "color": "red", 895 | "value": 80 896 | } 897 | ] 898 | }, 899 | "unit": "none" 900 | }, 901 | "overrides": [ 902 | { 903 | "matcher": { 904 | "id": "byName", 905 | "options": "Brainfusion Bedroom" 906 | }, 907 | "properties": [ 908 | { 909 | "id": "color", 910 | "value": { 911 | "fixedColor": "dark-orange", 912 | "mode": "fixed" 913 | } 914 | } 915 | ] 916 | }, 917 | { 918 | "matcher": { 919 | "id": "byName", 920 | "options": "Brainfusion Indoor" 921 | }, 922 | "properties": [ 923 | { 924 | "id": "color", 925 | "value": { 926 | "fixedColor": "semi-dark-orange", 927 | "mode": "fixed" 928 | } 929 | } 930 | ] 931 | } 932 | ] 933 | }, 934 | "gridPos": { 935 | "h": 6, 936 | "w": 9, 937 | "x": 12, 938 | "y": 6 939 | }, 940 | "id": 10, 941 | "interval": "", 942 | "links": [], 943 | "options": { 944 | "legend": { 945 | "calcs": [ 946 | "mean" 947 | ], 948 | "displayMode": "list", 949 | "placement": "bottom", 950 | "showLegend": false 951 | }, 952 | "tooltip": { 953 | "mode": "multi", 954 | "sort": "none" 955 | } 956 | }, 957 | "pluginVersion": "9.3.0", 958 | "repeatDirection": "h", 959 | "targets": [ 960 | { 961 | "alias": "$tag_station $tag_module", 962 | "datasource": { 963 | "type": "influxdb", 964 | "uid": "${DS_NETATMO}" 965 | }, 966 | "groupBy": [ 967 | { 968 | "params": [ 969 | "10m" 970 | ], 971 | "type": "time" 972 | }, 973 | { 974 | "params": [ 975 | "module" 976 | ], 977 | "type": "tag" 978 | }, 979 | { 980 | "params": [ 981 | "station" 982 | ], 983 | "type": "tag" 984 | }, 985 | { 986 | "params": [ 987 | "previous" 988 | ], 989 | "type": "fill" 990 | } 991 | ], 992 | "measurement": "pressure", 993 | "orderByTime": "ASC", 994 | "policy": "default", 995 | "refId": "A", 996 | "resultFormat": "time_series", 997 | "select": [ 998 | [ 999 | { 1000 | "params": [ 1001 | "value" 1002 | ], 1003 | "type": "field" 1004 | }, 1005 | { 1006 | "params": [], 1007 | "type": "last" 1008 | } 1009 | ] 1010 | ], 1011 | "tags": [ 1012 | { 1013 | "key": "station", 1014 | "operator": "=~", 1015 | "value": "/^$Station$/" 1016 | } 1017 | ] 1018 | } 1019 | ], 1020 | "title": "Pressure", 1021 | "transparent": true, 1022 | "type": "timeseries" 1023 | }, 1024 | { 1025 | "datasource": { 1026 | "type": "influxdb", 1027 | "uid": "${DS_NETATMO}" 1028 | }, 1029 | "fieldConfig": { 1030 | "defaults": { 1031 | "color": { 1032 | "mode": "thresholds" 1033 | }, 1034 | "mappings": [ 1035 | { 1036 | "options": { 1037 | "down": { 1038 | "text": "⇣" 1039 | }, 1040 | "up": { 1041 | "text": "⇡" 1042 | } 1043 | }, 1044 | "type": "value" 1045 | } 1046 | ], 1047 | "thresholds": { 1048 | "mode": "absolute", 1049 | "steps": [ 1050 | { 1051 | "color": "green", 1052 | "value": null 1053 | }, 1054 | { 1055 | "color": "red", 1056 | "value": 80 1057 | } 1058 | ] 1059 | }, 1060 | "unit": "none" 1061 | }, 1062 | "overrides": [] 1063 | }, 1064 | "gridPos": { 1065 | "h": 6, 1066 | "w": 3, 1067 | "x": 21, 1068 | "y": 6 1069 | }, 1070 | "id": 15, 1071 | "links": [], 1072 | "maxDataPoints": 100, 1073 | "options": { 1074 | "colorMode": "none", 1075 | "graphMode": "none", 1076 | "justifyMode": "auto", 1077 | "orientation": "horizontal", 1078 | "reduceOptions": { 1079 | "calcs": [ 1080 | "lastNotNull" 1081 | ], 1082 | "fields": "/^pressure_trend\\.last \\{station: Brain Fusion \\(Bedroom\\)\\}$/", 1083 | "values": false 1084 | }, 1085 | "textMode": "auto" 1086 | }, 1087 | "pluginVersion": "9.3.0", 1088 | "targets": [ 1089 | { 1090 | "datasource": { 1091 | "type": "influxdb", 1092 | "uid": "${DS_NETATMO}" 1093 | }, 1094 | "groupBy": [ 1095 | { 1096 | "params": [ 1097 | "$__interval" 1098 | ], 1099 | "type": "time" 1100 | }, 1101 | { 1102 | "params": [ 1103 | "station" 1104 | ], 1105 | "type": "tag" 1106 | }, 1107 | { 1108 | "params": [ 1109 | "previous" 1110 | ], 1111 | "type": "fill" 1112 | } 1113 | ], 1114 | "measurement": "pressure_trend", 1115 | "orderByTime": "ASC", 1116 | "policy": "default", 1117 | "refId": "A", 1118 | "resultFormat": "time_series", 1119 | "select": [ 1120 | [ 1121 | { 1122 | "params": [ 1123 | "value" 1124 | ], 1125 | "type": "field" 1126 | }, 1127 | { 1128 | "params": [], 1129 | "type": "last" 1130 | } 1131 | ] 1132 | ], 1133 | "tags": [ 1134 | { 1135 | "key": "station", 1136 | "operator": "=~", 1137 | "value": "/^$Station$/" 1138 | } 1139 | ] 1140 | } 1141 | ], 1142 | "title": "Pressure Trend", 1143 | "transparent": true, 1144 | "type": "stat" 1145 | }, 1146 | { 1147 | "collapsed": false, 1148 | "datasource": { 1149 | "type": "datasource", 1150 | "uid": "grafana" 1151 | }, 1152 | "gridPos": { 1153 | "h": 1, 1154 | "w": 24, 1155 | "x": 0, 1156 | "y": 12 1157 | }, 1158 | "id": 24, 1159 | "panels": [], 1160 | "repeat": "Module", 1161 | "targets": [ 1162 | { 1163 | "datasource": { 1164 | "type": "datasource", 1165 | "uid": "grafana" 1166 | }, 1167 | "refId": "A" 1168 | } 1169 | ], 1170 | "title": "$Module", 1171 | "type": "row" 1172 | }, 1173 | { 1174 | "datasource": { 1175 | "type": "influxdb", 1176 | "uid": "${DS_NETATMO}" 1177 | }, 1178 | "fieldConfig": { 1179 | "defaults": { 1180 | "color": { 1181 | "mode": "palette-classic" 1182 | }, 1183 | "custom": { 1184 | "axisCenteredZero": false, 1185 | "axisColorMode": "text", 1186 | "axisLabel": "", 1187 | "axisPlacement": "auto", 1188 | "barAlignment": 0, 1189 | "drawStyle": "line", 1190 | "fillOpacity": 10, 1191 | "gradientMode": "none", 1192 | "hideFrom": { 1193 | "legend": false, 1194 | "tooltip": false, 1195 | "viz": false 1196 | }, 1197 | "lineInterpolation": "linear", 1198 | "lineWidth": 1, 1199 | "pointSize": 5, 1200 | "scaleDistribution": { 1201 | "type": "linear" 1202 | }, 1203 | "showPoints": "never", 1204 | "spanNulls": true, 1205 | "stacking": { 1206 | "group": "A", 1207 | "mode": "none" 1208 | }, 1209 | "thresholdsStyle": { 1210 | "mode": "off" 1211 | } 1212 | }, 1213 | "decimals": 1, 1214 | "links": [], 1215 | "mappings": [], 1216 | "thresholds": { 1217 | "mode": "absolute", 1218 | "steps": [ 1219 | { 1220 | "color": "green", 1221 | "value": null 1222 | }, 1223 | { 1224 | "color": "red", 1225 | "value": 80 1226 | } 1227 | ] 1228 | }, 1229 | "unit": "celsius" 1230 | }, 1231 | "overrides": [] 1232 | }, 1233 | "gridPos": { 1234 | "h": 6, 1235 | "w": 12, 1236 | "x": 0, 1237 | "y": 13 1238 | }, 1239 | "id": 2, 1240 | "interval": "", 1241 | "links": [], 1242 | "options": { 1243 | "legend": { 1244 | "calcs": [ 1245 | "mean" 1246 | ], 1247 | "displayMode": "list", 1248 | "placement": "bottom", 1249 | "showLegend": false 1250 | }, 1251 | "tooltip": { 1252 | "mode": "multi", 1253 | "sort": "none" 1254 | } 1255 | }, 1256 | "pluginVersion": "9.3.0", 1257 | "repeatDirection": "h", 1258 | "targets": [ 1259 | { 1260 | "alias": "$tag_station $tag_module", 1261 | "datasource": { 1262 | "type": "influxdb", 1263 | "uid": "${DS_NETATMO}" 1264 | }, 1265 | "groupBy": [ 1266 | { 1267 | "params": [ 1268 | "10m" 1269 | ], 1270 | "type": "time" 1271 | }, 1272 | { 1273 | "params": [ 1274 | "module" 1275 | ], 1276 | "type": "tag" 1277 | }, 1278 | { 1279 | "params": [ 1280 | "station" 1281 | ], 1282 | "type": "tag" 1283 | }, 1284 | { 1285 | "params": [ 1286 | "previous" 1287 | ], 1288 | "type": "fill" 1289 | } 1290 | ], 1291 | "measurement": "temperature", 1292 | "orderByTime": "ASC", 1293 | "policy": "default", 1294 | "query": "SELECT last(\"temp\") FROM /^$Station$/ WHERE (\"module\" =~ /^$Module$/ AND \"station\" =~ /^$Station$/) AND $timeFilter GROUP BY time(10m), \"module\", \"station\" fill(previous)", 1295 | "rawQuery": false, 1296 | "refId": "A", 1297 | "resultFormat": "time_series", 1298 | "select": [ 1299 | [ 1300 | { 1301 | "params": [ 1302 | "value" 1303 | ], 1304 | "type": "field" 1305 | }, 1306 | { 1307 | "params": [], 1308 | "type": "last" 1309 | } 1310 | ] 1311 | ], 1312 | "tags": [ 1313 | { 1314 | "key": "module", 1315 | "operator": "=~", 1316 | "value": "/^$Module$/" 1317 | }, 1318 | { 1319 | "condition": "AND", 1320 | "key": "station", 1321 | "operator": "=~", 1322 | "value": "/^$Station$/" 1323 | } 1324 | ] 1325 | } 1326 | ], 1327 | "title": "Temperature", 1328 | "transparent": true, 1329 | "type": "timeseries" 1330 | }, 1331 | { 1332 | "datasource": { 1333 | "type": "influxdb", 1334 | "uid": "${DS_NETATMO}" 1335 | }, 1336 | "fieldConfig": { 1337 | "defaults": { 1338 | "color": { 1339 | "mode": "thresholds" 1340 | }, 1341 | "decimals": 1, 1342 | "mappings": [ 1343 | { 1344 | "options": { 1345 | "match": "null", 1346 | "result": { 1347 | "text": "N/A" 1348 | } 1349 | }, 1350 | "type": "special" 1351 | } 1352 | ], 1353 | "thresholds": { 1354 | "mode": "absolute", 1355 | "steps": [ 1356 | { 1357 | "color": "green", 1358 | "value": null 1359 | }, 1360 | { 1361 | "color": "red", 1362 | "value": 80 1363 | } 1364 | ] 1365 | }, 1366 | "unit": "celsius" 1367 | }, 1368 | "overrides": [] 1369 | }, 1370 | "gridPos": { 1371 | "h": 3, 1372 | "w": 3, 1373 | "x": 12, 1374 | "y": 13 1375 | }, 1376 | "id": 40, 1377 | "links": [], 1378 | "maxDataPoints": 100, 1379 | "options": { 1380 | "colorMode": "none", 1381 | "graphMode": "none", 1382 | "justifyMode": "auto", 1383 | "orientation": "horizontal", 1384 | "reduceOptions": { 1385 | "calcs": [ 1386 | "lastNotNull" 1387 | ], 1388 | "fields": "", 1389 | "values": false 1390 | }, 1391 | "textMode": "auto" 1392 | }, 1393 | "pluginVersion": "9.3.0", 1394 | "repeatDirection": "h", 1395 | "targets": [ 1396 | { 1397 | "datasource": { 1398 | "type": "influxdb", 1399 | "uid": "${DS_NETATMO}" 1400 | }, 1401 | "groupBy": [ 1402 | { 1403 | "params": [ 1404 | "$__interval" 1405 | ], 1406 | "type": "time" 1407 | }, 1408 | { 1409 | "params": [ 1410 | "station" 1411 | ], 1412 | "type": "tag" 1413 | }, 1414 | { 1415 | "params": [ 1416 | "null" 1417 | ], 1418 | "type": "fill" 1419 | } 1420 | ], 1421 | "measurement": "temperature", 1422 | "orderByTime": "ASC", 1423 | "policy": "default", 1424 | "refId": "A", 1425 | "resultFormat": "time_series", 1426 | "select": [ 1427 | [ 1428 | { 1429 | "params": [ 1430 | "value" 1431 | ], 1432 | "type": "field" 1433 | }, 1434 | { 1435 | "params": [], 1436 | "type": "last" 1437 | } 1438 | ] 1439 | ], 1440 | "tags": [ 1441 | { 1442 | "key": "module", 1443 | "operator": "=~", 1444 | "value": "/^$Module$/" 1445 | }, 1446 | { 1447 | "condition": "AND", 1448 | "key": "station", 1449 | "operator": "=~", 1450 | "value": "/^$Station$/" 1451 | } 1452 | ] 1453 | } 1454 | ], 1455 | "title": "Current", 1456 | "transparent": true, 1457 | "type": "stat" 1458 | }, 1459 | { 1460 | "datasource": { 1461 | "type": "influxdb", 1462 | "uid": "${DS_NETATMO}" 1463 | }, 1464 | "fieldConfig": { 1465 | "defaults": { 1466 | "color": { 1467 | "mode": "thresholds" 1468 | }, 1469 | "decimals": 1, 1470 | "mappings": [ 1471 | { 1472 | "options": { 1473 | "match": "null", 1474 | "result": { 1475 | "text": "N/A" 1476 | } 1477 | }, 1478 | "type": "special" 1479 | } 1480 | ], 1481 | "thresholds": { 1482 | "mode": "absolute", 1483 | "steps": [ 1484 | { 1485 | "color": "green", 1486 | "value": null 1487 | }, 1488 | { 1489 | "color": "red", 1490 | "value": 80 1491 | } 1492 | ] 1493 | }, 1494 | "unit": "celsius" 1495 | }, 1496 | "overrides": [] 1497 | }, 1498 | "gridPos": { 1499 | "h": 3, 1500 | "w": 2, 1501 | "x": 15, 1502 | "y": 13 1503 | }, 1504 | "id": 30, 1505 | "links": [], 1506 | "maxDataPoints": 100, 1507 | "options": { 1508 | "colorMode": "none", 1509 | "graphMode": "none", 1510 | "justifyMode": "auto", 1511 | "orientation": "horizontal", 1512 | "reduceOptions": { 1513 | "calcs": [ 1514 | "max" 1515 | ], 1516 | "fields": "", 1517 | "values": false 1518 | }, 1519 | "textMode": "auto" 1520 | }, 1521 | "pluginVersion": "9.3.0", 1522 | "repeatDirection": "h", 1523 | "targets": [ 1524 | { 1525 | "datasource": { 1526 | "type": "influxdb", 1527 | "uid": "${DS_NETATMO}" 1528 | }, 1529 | "groupBy": [ 1530 | { 1531 | "params": [ 1532 | "$__interval" 1533 | ], 1534 | "type": "time" 1535 | }, 1536 | { 1537 | "params": [ 1538 | "station" 1539 | ], 1540 | "type": "tag" 1541 | }, 1542 | { 1543 | "params": [ 1544 | "null" 1545 | ], 1546 | "type": "fill" 1547 | } 1548 | ], 1549 | "measurement": "max_temp", 1550 | "orderByTime": "ASC", 1551 | "policy": "default", 1552 | "refId": "A", 1553 | "resultFormat": "time_series", 1554 | "select": [ 1555 | [ 1556 | { 1557 | "params": [ 1558 | "value" 1559 | ], 1560 | "type": "field" 1561 | }, 1562 | { 1563 | "params": [], 1564 | "type": "last" 1565 | } 1566 | ] 1567 | ], 1568 | "tags": [ 1569 | { 1570 | "key": "module", 1571 | "operator": "=~", 1572 | "value": "/^$Module$/" 1573 | }, 1574 | { 1575 | "condition": "AND", 1576 | "key": "station", 1577 | "operator": "=~", 1578 | "value": "/^$Station$/" 1579 | } 1580 | ] 1581 | } 1582 | ], 1583 | "title": "Max", 1584 | "transparent": true, 1585 | "type": "stat" 1586 | }, 1587 | { 1588 | "datasource": { 1589 | "type": "influxdb", 1590 | "uid": "${DS_NETATMO}" 1591 | }, 1592 | "fieldConfig": { 1593 | "defaults": { 1594 | "color": { 1595 | "mode": "thresholds" 1596 | }, 1597 | "mappings": [ 1598 | { 1599 | "options": { 1600 | "match": "null", 1601 | "result": { 1602 | "text": "N/A" 1603 | } 1604 | }, 1605 | "type": "special" 1606 | } 1607 | ], 1608 | "max": 100, 1609 | "min": 0, 1610 | "thresholds": { 1611 | "mode": "absolute", 1612 | "steps": [ 1613 | { 1614 | "color": "#FADE2A", 1615 | "value": null 1616 | }, 1617 | { 1618 | "color": "rgba(237, 129, 40, 0.89)", 1619 | "value": 100 1620 | }, 1621 | { 1622 | "color": "#d44a3a", 1623 | "value": 150 1624 | } 1625 | ] 1626 | }, 1627 | "unit": "percent" 1628 | }, 1629 | "overrides": [] 1630 | }, 1631 | "gridPos": { 1632 | "h": 6, 1633 | "w": 3, 1634 | "x": 17, 1635 | "y": 13 1636 | }, 1637 | "id": 7, 1638 | "links": [], 1639 | "options": { 1640 | "orientation": "horizontal", 1641 | "reduceOptions": { 1642 | "calcs": [ 1643 | "lastNotNull" 1644 | ], 1645 | "fields": "", 1646 | "values": false 1647 | }, 1648 | "showThresholdLabels": false, 1649 | "showThresholdMarkers": false 1650 | }, 1651 | "pluginVersion": "9.3.0", 1652 | "repeatDirection": "h", 1653 | "targets": [ 1654 | { 1655 | "alias": "$tag_station $tag_module", 1656 | "datasource": { 1657 | "type": "influxdb", 1658 | "uid": "${DS_NETATMO}" 1659 | }, 1660 | "groupBy": [ 1661 | { 1662 | "params": [ 1663 | "10m" 1664 | ], 1665 | "type": "time" 1666 | }, 1667 | { 1668 | "params": [ 1669 | "module" 1670 | ], 1671 | "type": "tag" 1672 | }, 1673 | { 1674 | "params": [ 1675 | "station" 1676 | ], 1677 | "type": "tag" 1678 | }, 1679 | { 1680 | "params": [ 1681 | "null" 1682 | ], 1683 | "type": "fill" 1684 | } 1685 | ], 1686 | "measurement": "humidity", 1687 | "orderByTime": "ASC", 1688 | "policy": "default", 1689 | "refId": "A", 1690 | "resultFormat": "time_series", 1691 | "select": [ 1692 | [ 1693 | { 1694 | "params": [ 1695 | "value" 1696 | ], 1697 | "type": "field" 1698 | }, 1699 | { 1700 | "params": [], 1701 | "type": "last" 1702 | } 1703 | ] 1704 | ], 1705 | "tags": [ 1706 | { 1707 | "key": "module", 1708 | "operator": "=~", 1709 | "value": "/^$Module$/" 1710 | }, 1711 | { 1712 | "condition": "AND", 1713 | "key": "station", 1714 | "operator": "=~", 1715 | "value": "/^$Station$/" 1716 | } 1717 | ] 1718 | } 1719 | ], 1720 | "title": "Humidity", 1721 | "transparent": true, 1722 | "type": "gauge" 1723 | }, 1724 | { 1725 | "datasource": { 1726 | "type": "influxdb", 1727 | "uid": "${DS_NETATMO}" 1728 | }, 1729 | "fieldConfig": { 1730 | "defaults": { 1731 | "decimals": 0, 1732 | "displayName": "", 1733 | "mappings": [ 1734 | { 1735 | "options": { 1736 | "match": "null", 1737 | "result": { 1738 | "text": "-" 1739 | } 1740 | }, 1741 | "type": "special" 1742 | } 1743 | ], 1744 | "max": 0, 1745 | "min": -127, 1746 | "thresholds": { 1747 | "mode": "absolute", 1748 | "steps": [ 1749 | { 1750 | "color": "semi-dark-red", 1751 | "value": null 1752 | }, 1753 | { 1754 | "color": "semi-dark-orange", 1755 | "value": -86 1756 | }, 1757 | { 1758 | "color": "semi-dark-blue", 1759 | "value": -71 1760 | }, 1761 | { 1762 | "color": "rgba(0, 0, 0, 0)", 1763 | "value": 0 1764 | } 1765 | ] 1766 | }, 1767 | "unit": "dBm" 1768 | }, 1769 | "overrides": [] 1770 | }, 1771 | "gridPos": { 1772 | "h": 4, 1773 | "w": 2, 1774 | "x": 20, 1775 | "y": 13 1776 | }, 1777 | "id": 59, 1778 | "options": { 1779 | "orientation": "auto", 1780 | "reduceOptions": { 1781 | "calcs": [ 1782 | "last" 1783 | ], 1784 | "fields": "", 1785 | "values": false 1786 | }, 1787 | "showThresholdLabels": false, 1788 | "showThresholdMarkers": false 1789 | }, 1790 | "pluginVersion": "9.3.0", 1791 | "targets": [ 1792 | { 1793 | "alias": "", 1794 | "datasource": { 1795 | "type": "influxdb", 1796 | "uid": "${DS_NETATMO}" 1797 | }, 1798 | "groupBy": [ 1799 | { 1800 | "params": [ 1801 | "$__interval" 1802 | ], 1803 | "type": "time" 1804 | }, 1805 | { 1806 | "params": [ 1807 | "previous" 1808 | ], 1809 | "type": "fill" 1810 | } 1811 | ], 1812 | "measurement": "rf_status", 1813 | "orderByTime": "ASC", 1814 | "policy": "default", 1815 | "query": "SELECT last(\"value\") *-1 FROM \"rf_status\" WHERE (\"station\" =~ /^$Station$/ AND \"module\" =~ /^$Module$/) AND $timeFilter GROUP BY time($__interval) fill(previous)", 1816 | "rawQuery": false, 1817 | "refId": "A", 1818 | "resultFormat": "time_series", 1819 | "select": [ 1820 | [ 1821 | { 1822 | "params": [ 1823 | "value" 1824 | ], 1825 | "type": "field" 1826 | }, 1827 | { 1828 | "params": [], 1829 | "type": "last" 1830 | }, 1831 | { 1832 | "params": [ 1833 | "*-1" 1834 | ], 1835 | "type": "math" 1836 | } 1837 | ] 1838 | ], 1839 | "tags": [ 1840 | { 1841 | "key": "station", 1842 | "operator": "=~", 1843 | "value": "/^$Station$/" 1844 | }, 1845 | { 1846 | "condition": "AND", 1847 | "key": "module", 1848 | "operator": "=~", 1849 | "value": "/^$Module$/" 1850 | } 1851 | ] 1852 | }, 1853 | { 1854 | "datasource": { 1855 | "type": "influxdb", 1856 | "uid": "${DS_NETATMO}" 1857 | }, 1858 | "groupBy": [ 1859 | { 1860 | "params": [ 1861 | "$__interval" 1862 | ], 1863 | "type": "time" 1864 | }, 1865 | { 1866 | "params": [ 1867 | "previous" 1868 | ], 1869 | "type": "fill" 1870 | } 1871 | ], 1872 | "measurement": "wifi_status", 1873 | "orderByTime": "ASC", 1874 | "policy": "default", 1875 | "query": "SELECT last(\"value\") *-1 FROM \"rf_status\" WHERE (\"station\" =~ /^$Station$/ AND \"module\" =~ /^$Module$/) AND $timeFilter GROUP BY time($__interval) fill(previous)", 1876 | "rawQuery": false, 1877 | "refId": "B", 1878 | "resultFormat": "time_series", 1879 | "select": [ 1880 | [ 1881 | { 1882 | "params": [ 1883 | "value" 1884 | ], 1885 | "type": "field" 1886 | }, 1887 | { 1888 | "params": [], 1889 | "type": "last" 1890 | }, 1891 | { 1892 | "params": [ 1893 | "*-1" 1894 | ], 1895 | "type": "math" 1896 | } 1897 | ] 1898 | ], 1899 | "tags": [ 1900 | { 1901 | "key": "station", 1902 | "operator": "=~", 1903 | "value": "/^$Station$/" 1904 | }, 1905 | { 1906 | "condition": "AND", 1907 | "key": "module", 1908 | "operator": "=~", 1909 | "value": "/^$Module$/" 1910 | } 1911 | ] 1912 | } 1913 | ], 1914 | "title": "Signal", 1915 | "transparent": true, 1916 | "type": "gauge" 1917 | }, 1918 | { 1919 | "datasource": { 1920 | "type": "influxdb", 1921 | "uid": "${DS_NETATMO}" 1922 | }, 1923 | "fieldConfig": { 1924 | "defaults": { 1925 | "color": { 1926 | "mode": "thresholds" 1927 | }, 1928 | "mappings": [ 1929 | { 1930 | "options": { 1931 | "match": "null", 1932 | "result": { 1933 | "text": "-" 1934 | } 1935 | }, 1936 | "type": "special" 1937 | } 1938 | ], 1939 | "max": 100, 1940 | "min": 0, 1941 | "thresholds": { 1942 | "mode": "absolute", 1943 | "steps": [ 1944 | { 1945 | "color": "#d44a3a", 1946 | "value": null 1947 | }, 1948 | { 1949 | "color": "rgba(237, 129, 40, 0.89)", 1950 | "value": 10 1951 | }, 1952 | { 1953 | "color": "#299c46", 1954 | "value": 20 1955 | } 1956 | ] 1957 | }, 1958 | "unit": "percent" 1959 | }, 1960 | "overrides": [] 1961 | }, 1962 | "gridPos": { 1963 | "h": 4, 1964 | "w": 2, 1965 | "x": 22, 1966 | "y": 13 1967 | }, 1968 | "id": 18, 1969 | "links": [], 1970 | "options": { 1971 | "orientation": "horizontal", 1972 | "reduceOptions": { 1973 | "calcs": [ 1974 | "lastNotNull" 1975 | ], 1976 | "fields": "", 1977 | "values": false 1978 | }, 1979 | "showThresholdLabels": false, 1980 | "showThresholdMarkers": false 1981 | }, 1982 | "pluginVersion": "9.3.0", 1983 | "targets": [ 1984 | { 1985 | "datasource": { 1986 | "type": "influxdb", 1987 | "uid": "${DS_NETATMO}" 1988 | }, 1989 | "groupBy": [ 1990 | { 1991 | "params": [ 1992 | "$__interval" 1993 | ], 1994 | "type": "time" 1995 | }, 1996 | { 1997 | "params": [ 1998 | "station" 1999 | ], 2000 | "type": "tag" 2001 | }, 2002 | { 2003 | "params": [ 2004 | "null" 2005 | ], 2006 | "type": "fill" 2007 | } 2008 | ], 2009 | "measurement": "battery_percent", 2010 | "orderByTime": "ASC", 2011 | "policy": "default", 2012 | "refId": "A", 2013 | "resultFormat": "time_series", 2014 | "select": [ 2015 | [ 2016 | { 2017 | "params": [ 2018 | "value" 2019 | ], 2020 | "type": "field" 2021 | }, 2022 | { 2023 | "params": [], 2024 | "type": "last" 2025 | } 2026 | ] 2027 | ], 2028 | "tags": [ 2029 | { 2030 | "key": "module", 2031 | "operator": "=~", 2032 | "value": "/^$Module$/" 2033 | }, 2034 | { 2035 | "condition": "AND", 2036 | "key": "station", 2037 | "operator": "=~", 2038 | "value": "/^$Station$/" 2039 | } 2040 | ] 2041 | } 2042 | ], 2043 | "title": "Battery", 2044 | "transparent": true, 2045 | "type": "gauge" 2046 | }, 2047 | { 2048 | "datasource": { 2049 | "type": "influxdb", 2050 | "uid": "${DS_NETATMO}" 2051 | }, 2052 | "fieldConfig": { 2053 | "defaults": { 2054 | "color": { 2055 | "mode": "thresholds" 2056 | }, 2057 | "mappings": [ 2058 | { 2059 | "options": { 2060 | "match": "null", 2061 | "result": { 2062 | "text": "N/A" 2063 | } 2064 | }, 2065 | "type": "special" 2066 | } 2067 | ], 2068 | "thresholds": { 2069 | "mode": "absolute", 2070 | "steps": [ 2071 | { 2072 | "color": "green", 2073 | "value": null 2074 | }, 2075 | { 2076 | "color": "red", 2077 | "value": 80 2078 | } 2079 | ] 2080 | }, 2081 | "unit": "none" 2082 | }, 2083 | "overrides": [] 2084 | }, 2085 | "gridPos": { 2086 | "h": 3, 2087 | "w": 3, 2088 | "x": 12, 2089 | "y": 16 2090 | }, 2091 | "id": 14, 2092 | "links": [], 2093 | "maxDataPoints": 100, 2094 | "options": { 2095 | "colorMode": "none", 2096 | "graphMode": "none", 2097 | "justifyMode": "auto", 2098 | "orientation": "horizontal", 2099 | "reduceOptions": { 2100 | "calcs": [ 2101 | "lastNotNull" 2102 | ], 2103 | "fields": "/^temp_trend\\.last$/", 2104 | "values": false 2105 | }, 2106 | "textMode": "auto" 2107 | }, 2108 | "pluginVersion": "9.3.0", 2109 | "targets": [ 2110 | { 2111 | "datasource": { 2112 | "type": "influxdb", 2113 | "uid": "${DS_NETATMO}" 2114 | }, 2115 | "groupBy": [], 2116 | "measurement": "temp_trend", 2117 | "orderByTime": "ASC", 2118 | "policy": "default", 2119 | "refId": "A", 2120 | "resultFormat": "time_series", 2121 | "select": [ 2122 | [ 2123 | { 2124 | "params": [ 2125 | "value" 2126 | ], 2127 | "type": "field" 2128 | }, 2129 | { 2130 | "params": [], 2131 | "type": "last" 2132 | } 2133 | ] 2134 | ], 2135 | "tags": [ 2136 | { 2137 | "key": "station", 2138 | "operator": "=~", 2139 | "value": "/^$Station$/" 2140 | }, 2141 | { 2142 | "condition": "AND", 2143 | "key": "module", 2144 | "operator": "=~", 2145 | "value": "/^$Module$/" 2146 | } 2147 | ] 2148 | } 2149 | ], 2150 | "title": "Temperature Trend", 2151 | "transparent": true, 2152 | "type": "stat" 2153 | }, 2154 | { 2155 | "datasource": { 2156 | "type": "influxdb", 2157 | "uid": "${DS_NETATMO}" 2158 | }, 2159 | "fieldConfig": { 2160 | "defaults": { 2161 | "color": { 2162 | "mode": "thresholds" 2163 | }, 2164 | "decimals": 1, 2165 | "mappings": [ 2166 | { 2167 | "options": { 2168 | "match": "null", 2169 | "result": { 2170 | "text": "N/A" 2171 | } 2172 | }, 2173 | "type": "special" 2174 | } 2175 | ], 2176 | "thresholds": { 2177 | "mode": "absolute", 2178 | "steps": [ 2179 | { 2180 | "color": "green", 2181 | "value": null 2182 | }, 2183 | { 2184 | "color": "red", 2185 | "value": 80 2186 | } 2187 | ] 2188 | }, 2189 | "unit": "celsius" 2190 | }, 2191 | "overrides": [] 2192 | }, 2193 | "gridPos": { 2194 | "h": 3, 2195 | "w": 2, 2196 | "x": 15, 2197 | "y": 16 2198 | }, 2199 | "id": 17, 2200 | "links": [], 2201 | "maxDataPoints": 100, 2202 | "options": { 2203 | "colorMode": "none", 2204 | "graphMode": "none", 2205 | "justifyMode": "auto", 2206 | "orientation": "horizontal", 2207 | "reduceOptions": { 2208 | "calcs": [ 2209 | "min" 2210 | ], 2211 | "fields": "", 2212 | "values": false 2213 | }, 2214 | "textMode": "auto" 2215 | }, 2216 | "pluginVersion": "9.3.0", 2217 | "repeatDirection": "h", 2218 | "targets": [ 2219 | { 2220 | "datasource": { 2221 | "type": "influxdb", 2222 | "uid": "${DS_NETATMO}" 2223 | }, 2224 | "groupBy": [ 2225 | { 2226 | "params": [ 2227 | "$__interval" 2228 | ], 2229 | "type": "time" 2230 | }, 2231 | { 2232 | "params": [ 2233 | "station" 2234 | ], 2235 | "type": "tag" 2236 | }, 2237 | { 2238 | "params": [ 2239 | "null" 2240 | ], 2241 | "type": "fill" 2242 | } 2243 | ], 2244 | "measurement": "min_temp", 2245 | "orderByTime": "ASC", 2246 | "policy": "default", 2247 | "refId": "A", 2248 | "resultFormat": "time_series", 2249 | "select": [ 2250 | [ 2251 | { 2252 | "params": [ 2253 | "value" 2254 | ], 2255 | "type": "field" 2256 | }, 2257 | { 2258 | "params": [], 2259 | "type": "last" 2260 | } 2261 | ] 2262 | ], 2263 | "tags": [ 2264 | { 2265 | "key": "module", 2266 | "operator": "=~", 2267 | "value": "/^$Module$/" 2268 | }, 2269 | { 2270 | "condition": "AND", 2271 | "key": "station", 2272 | "operator": "=~", 2273 | "value": "/^$Station$/" 2274 | } 2275 | ] 2276 | } 2277 | ], 2278 | "title": "Min", 2279 | "transparent": true, 2280 | "type": "stat" 2281 | } 2282 | ], 2283 | "refresh": "5m", 2284 | "schemaVersion": 37, 2285 | "style": "dark", 2286 | "tags": [ 2287 | "influxdb" 2288 | ], 2289 | "templating": { 2290 | "list": [ 2291 | { 2292 | "current": {}, 2293 | "datasource": { 2294 | "type": "influxdb", 2295 | "uid": "${DS_NETATMO}" 2296 | }, 2297 | "definition": "show tag values with key = \"station\"", 2298 | "hide": 0, 2299 | "includeAll": false, 2300 | "multi": false, 2301 | "name": "Station", 2302 | "options": [], 2303 | "query": "show tag values with key = \"station\"", 2304 | "refresh": 1, 2305 | "regex": "", 2306 | "skipUrlSync": false, 2307 | "sort": 0, 2308 | "tagValuesQuery": "", 2309 | "tagsQuery": "", 2310 | "type": "query", 2311 | "useTags": false 2312 | }, 2313 | { 2314 | "current": {}, 2315 | "datasource": { 2316 | "type": "influxdb", 2317 | "uid": "${DS_NETATMO}" 2318 | }, 2319 | "definition": "show tag values with key = \"module\" WHERE station =~ /$Station/", 2320 | "hide": 0, 2321 | "includeAll": true, 2322 | "multi": false, 2323 | "name": "Module", 2324 | "options": [], 2325 | "query": "show tag values with key = \"module\" WHERE station =~ /$Station/", 2326 | "refresh": 1, 2327 | "regex": "", 2328 | "skipUrlSync": false, 2329 | "sort": 0, 2330 | "tagValuesQuery": "", 2331 | "tagsQuery": "", 2332 | "type": "query", 2333 | "useTags": false 2334 | } 2335 | ] 2336 | }, 2337 | "time": { 2338 | "from": "now-24h", 2339 | "to": "now" 2340 | }, 2341 | "timepicker": { 2342 | "nowDelay": "", 2343 | "refresh_intervals": [ 2344 | "5s", 2345 | "10s", 2346 | "30s", 2347 | "1m", 2348 | "5m", 2349 | "15m", 2350 | "30m", 2351 | "1h", 2352 | "2h", 2353 | "1d" 2354 | ], 2355 | "time_options": [ 2356 | "5m", 2357 | "15m", 2358 | "1h", 2359 | "6h", 2360 | "12h", 2361 | "24h", 2362 | "2d", 2363 | "7d", 2364 | "30d" 2365 | ] 2366 | }, 2367 | "timezone": "", 2368 | "title": "Netatmo Weather Station", 2369 | "uid": "6LB43bzZz", 2370 | "version": 85, 2371 | "weekStart": "" 2372 | } 2373 | -------------------------------------------------------------------------------- /netatmo_influx.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # encoding=utf-8 3 | 4 | import lnetatmo 5 | from influxdb import InfluxDBClient 6 | 7 | authorization = lnetatmo.ClientAuth() 8 | 9 | weatherData = lnetatmo.WeatherStationData(authorization) 10 | 11 | client = InfluxDBClient() 12 | if {'name': 'netatmo'} not in client.get_list_database(): 13 | client.create_database('netatmo') 14 | 15 | for station in weatherData.stations: 16 | station_data = [] 17 | module_data = [] 18 | station = weatherData.stationById(station) 19 | station_name = station['station_name'] 20 | altitude = station['place']['altitude'] 21 | country= station['place']['country'] 22 | timezone = station['place']['timezone'] 23 | longitude = station['place']['location'][0] 24 | latitude = station['place']['location'][1] 25 | for module, moduleData in weatherData.lastData(station=station_name, exclude=3600).items(): 26 | for measurement in ['altitude', 'country', 'longitude', 'latitude', 'timezone']: 27 | value = eval(measurement) 28 | if type(value) == int: 29 | value = float(value) 30 | station_data.append({ 31 | "measurement": measurement, 32 | "tags": { 33 | "station": station_name, 34 | "module": module 35 | }, 36 | "time": moduleData['When'], 37 | "fields": { 38 | "value": value 39 | } 40 | }) 41 | 42 | for sensor, value in moduleData.items(): 43 | if sensor.lower() != 'when': 44 | if type(value) == int: 45 | value = float(value) 46 | module_data.append({ 47 | "measurement": sensor.lower(), 48 | "tags": { 49 | "station": station_name, 50 | "module": module 51 | }, 52 | "time": moduleData['When'], 53 | "fields": { 54 | "value": value 55 | } 56 | }) 57 | 58 | client.write_points(station_data, time_precision='s', database='netatmo') 59 | client.write_points(module_data, time_precision='s', database='netatmo') 60 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florianbeer/grafana-netatmo/9cdd2f91b4ac137a92c1b40972819b40d009173c/screenshot.png --------------------------------------------------------------------------------