{"id":4100,"date":"2023-08-10T19:27:50","date_gmt":"2023-08-10T17:27:50","guid":{"rendered":"https:\/\/www.benecomunecernusco.it\/wordpress\/?page_id=4100"},"modified":"2023-11-02T01:20:40","modified_gmt":"2023-11-02T00:20:40","slug":"sensore-001","status":"publish","type":"page","link":"https:\/\/www.benecomunecernusco.it\/wordpress\/sensore-001\/","title":{"rendered":"Sensore 001"},"content":{"rendered":"\n<hr class=\"wp-block-separator has-css-opacity is-style-wide\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">Posizione (+ e &#8212; per modificare lo zoom):<\/p>\n\n\n\n<iframe loading=\"lazy\" width=\"660\" height=\"300\" style=\"border: 1px solid #cccccc;\" src=\"https:\/\/thingspeak.com\/channels\/1694115\/maps\/channel_show?width=658&amp;heigth=235\"><\/iframe>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity is-style-wide\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">PM2.5 istantaneo:<\/p>\n\n\n\n<iframe loading=\"lazy\" width=\"450\" height=\"260\" style=\"border: 1px solid #cccccc;\" src=\"https:\/\/thingspeak.com\/channels\/1694115\/widgets\/696445\"><\/iframe>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity is-style-wide\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">PM10 istantaneo:<\/p>\n\n\n\n<iframe loading=\"lazy\" width=\"450\" height=\"260\" style=\"border: 1px solid #cccccc;\" src=\"https:\/\/thingspeak.com\/channels\/1694115\/widgets\/696446\"><\/iframe>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity is-style-wide\"\/>\n\n\n\n<iframe loading=\"lazy\" width=\"660\" height=\"300\" style=\"border: 1px solid #cccccc;\" src=\"https:\/\/thingspeak.com\/channels\/1694115\/charts\/1?width=auto&amp;heigth=auto&amp;average=10&amp;bgcolor=%23ffffff&amp;color=%23d62020&amp;dynamic=true&amp;results=240&amp;title=PM2.5+Ultime+12+ore&amp;xaxis=Ora&amp;yaxis=PM2.5+%28\u00b5g%2Fm3%29;type=column\"><\/iframe>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity is-style-wide\"\/>\n\n\n\n<iframe loading=\"lazy\" width=\"660\" height=\"300\" style=\"border: 1px solid #cccccc;\" src=\"https:\/\/thingspeak.com\/channels\/1694115\/charts\/3?width=auto&amp;heigth=auto&amp;average=10&amp;bgcolor=%23ffffff&amp;color=%23038d07&amp;dynamic=true&amp;results=240&amp;round=2&amp;title=PM10+-+Ultime+12+ore&amp;type=column&amp;xaxis=Ora&amp;yaxis=PM10+%28\u00b5g%2Fm3%29\"><\/iframe>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity is-style-wide\"\/>\n\n\n\n<style>\n.highcharts-figure, .highcharts-data-table table {\n    min-width: 310px;\n    max-width: 800px;\n    margin: 1em auto;\n}\n.highcharts-data-table table {\n\tfont-family: Verdana, sans-serif;\n\tborder-collapse: collapse;\n\tborder: 1px solid #EBEBEB;\n\tmargin: 10px auto;\n\ttext-align: center;\n\twidth: 100%;\n\tmax-width: 600px;\n}\n.highcharts-data-table caption {\n    padding: 1em 0;\n    font-size: 0.9em;\n    color: #555;\n}\n.highcharts-data-table th {\n    font-weight: 500;\n    padding: 0.5em;\n}\n.highcharts-data-table td, .highcharts-data-table th, .highcharts-data-table caption {\n    padding: 1em;\n}\n.highcharts-data-table thead tr, .highcharts-data-table tr:nth-child(even) {\n    background: #f8f8f8;\n}\n.highcharts-data-table tr:hover {\n    background: #f1f7ff;\n}\n<\/style>\n\n<script src=\"https:\/\/code.highcharts.com\/highcharts.js\"><\/script>\n<script src=\"https:\/\/code.highcharts.com\/highcharts-more.js\"><\/script>\n<script src=\"https:\/\/code.highcharts.com\/modules\/exporting.js\"><\/script>\n<script src=\"https:\/\/code\/modules\/series-label.js\"><\/script>\n<script src=\"https:\/\/code\/modules\/export-data.js\"><\/script>\n<script src=\"https:\/\/code\/modules\/accessibility.js\"><\/script>\n<script src=\"https:\/\/code.jquery.com\/jquery-3.1.1.min.js\"><\/script>\n\n<figure class=\"highcharts-figure\">\n    <div id=\"container\"><\/div>\n    <p class=\"highcharts-description\"><\/p><figcaption>\n        Grafico degli ultimi 4 giorni di registrazione di PM2.5 e PM10 rilevati dalla centralina PMS5003 n.001. Ogni punto mostra il valore della media delle misure fatte nell&#8217;ora precedente (media mobile oraria).<\/figcaption>\n    <p><\/p>\n<\/figure>\n\n\n<script>\n\n\/\/ Data retrieved from https:\/\/api.thingspeak.com\/channels\/2224837\/feeds.json?\n\n\nlet requestURL = 'https:\/\/api.thingspeak.com\/channels\/2224837\/feeds.json?api_key=RQ1L6S4PUKYIC0BK&days=4';\nlet request = new XMLHttpRequest();\nrequest.open('GET', requestURL);\nrequest.responseType = 'json';\nrequest.send();\nrequest.onload = function() {\n  var pinco = request.response;\n\n  populatechart(pinco);\n\n}\n\nfunction populatechart(pallino) {\n  console.log(pallino)\n  var misure = pallino.feeds;\n  var serie25 = [\n    []\n  ];\n  var serie10 = [\n    []\n  ];\n\n  for (let i = 0; i < misure.length; i++) {\n    serie25[i] = []\n    serie25[i][0] = misure[i].created_at\n    serie25[i][1] = parseFloat(misure[i].field3)\n    \n    serie10[i] = []\n    serie10[i][0] = misure[i].created_at\n    serie10[i][1] = parseFloat(misure[i].field4)\n\n  }\n\n  serie25.forEach(function(point) {\n    point[0] = Date.parse(point[0])\n  });\n  serie10.forEach(function(point) {\n    point[0] = Date.parse(point[0])\n  });\n\n  Highcharts.chart('container', {\n    xAxis: {\n      type: 'datetime',\n      \/\/max: 4 * 24 * 3600000,\n      labels: {\n        overflow: 'justify'\n      }\n      },\n    title: {\n    text: 'PM 2.5 \/ PM 10 Ultimi 4 giorni',\n    align: 'center'\n      },\n    subtitle: {\n      text: 'Sensore PMS5003 n.001 situato in Cernusco sul Naviglio (MI) - Via Melghera',\n      align: 'center'\n      },\n    yAxis: {\n      title: {\n        text: '\u00b5g\/m3 '\n      },\n      min: 0,\n      minorGridLineWidth: 1,\n      gridLineWidth: 1,\n      gridZIndex: 3,\n      minorThickInterval: 'auto',\n      minorTickLength: 5,\n      alternateGridColor: '#ffffff',\n      plotBands: [{ \/\/ good\n        from: 0,\n        to: 10,\n        color: 'rgba(0, 255, 0, 0.25)',\n        label: {\n          text: 'Good',\n          style: {\n            color: '#606060'\n          }\n        }\n      }, { \/\/ Acceptable\n        from: 10,\n        to: 25,\n        color: 'rgba(255, 255, 0, 0.35)',\n        label: {\n          text: 'Acceptable',\n          style: {\n            color: '#606060'\n          }\n        }\n      }, { \/\/ Worrying\n        from: 25,\n        to: 75,\n        color: 'rgba(255, 192, 0, 0.35)',\n        label: {\n          text: 'Worrying',\n          style: {\n            color: '#606060'\n          }\n        }\n      }, { \/\/ bad\n        from: 75,\n        to: 125,\n        color: 'rgba(255, 0, 0, 0.35)',\n        label: {\n          text: 'Bad',\n          style: {\n            color: '#606060'\n          }\n        }\n      }, { \/\/ Very bad\n        from: 125,\n        to: 200,\n        color: 'rgba(112, 48, 160, 0.40)',\n        label: {\n          text: 'Very Bad',\n          style: {\n            color: '#606060'\n          }\n        }\n      }, { \/\/ Dangerous\n        from: 200,\n        to: 250,\n        color: 'rgba(16, 7, 23, 0.4)',\n        label: {\n          text: 'Dangerous',\n          style: {\n            color: '#ffffff'\n          }\n        }\n      }, { \/\/ Health Alert\n        from: 250,\n        to: 300,\n        color: 'rgba(16, 7, 23, 0.55)',\n        label: {\n          text: 'Health Alert',\n          style: {\n            color: '#ffffff'\n          }\n        }\n        }]\n      },  \n      series: [{\n        type: 'line',\n        color: '#ff0000',\n        name: 'PM2.5',\n        data: serie25\n        },\n      {\n        type: 'line',\n        color: '#0106bf',\n        name: 'PM10',\n        data: serie10\n      }],\n  });\n\n}\n\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>Posizione (+ e &#8212; per modificare lo zoom): PM2.5 istantaneo: PM10 istantaneo: Grafico degli ultimi 4 giorni di registrazione di PM2.5 e PM10 rilevati dalla centralina PMS5003 n.001. Ogni punto mostra il valore della media delle misure fatte nell&#8217;ora precedente (media mobile oraria).<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"give_campaign_id":0,"footnotes":""},"class_list":["post-4100","page","type-page","status-publish","hentry","post-preview"],"campaignId":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/P5jWVr-148","_links":{"self":[{"href":"https:\/\/www.benecomunecernusco.it\/wordpress\/wp-json\/wp\/v2\/pages\/4100","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.benecomunecernusco.it\/wordpress\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.benecomunecernusco.it\/wordpress\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.benecomunecernusco.it\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.benecomunecernusco.it\/wordpress\/wp-json\/wp\/v2\/comments?post=4100"}],"version-history":[{"count":19,"href":"https:\/\/www.benecomunecernusco.it\/wordpress\/wp-json\/wp\/v2\/pages\/4100\/revisions"}],"predecessor-version":[{"id":4377,"href":"https:\/\/www.benecomunecernusco.it\/wordpress\/wp-json\/wp\/v2\/pages\/4100\/revisions\/4377"}],"wp:attachment":[{"href":"https:\/\/www.benecomunecernusco.it\/wordpress\/wp-json\/wp\/v2\/media?parent=4100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}