{"id":136,"date":"2026-08-03T20:32:29","date_gmt":"2026-08-03T20:32:29","guid":{"rendered":"https:\/\/sjefke.synology.me\/?page_id=136"},"modified":"2026-08-31T19:02:12","modified_gmt":"2026-08-31T19:02:12","slug":"climate-on-falcon","status":"publish","type":"page","link":"https:\/\/sjefke.synology.me\/index.php\/climate-on-falcon\/","title":{"rendered":"Climate on Falcon"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Battery voltages, solar panel voltage and household battery state of charge:<\/p>\n\n\n\n<div style=\"width: 100%; height: 400px;\">\n    <canvas id=\"sensorChartV\"><\/canvas>\n<\/div>\n\n<script src=\"https:\/\/cdn.jsdelivr.net\/npm\/chart.js\"><\/script>\n\n<script>\nfetch('https:\/\/sjefke.synology.me\/bms_sensordata.php')\n  .then(response => response.json())\n  .then(data => {\n\n    const labels = data.map(row => row.time);\n\n    const chartData = {\n      labels: labels,\n      datasets: [\n        {\n          label: 'V1',\n          data: data.map(row => row.V1),\n          borderColor: 'red',\n          fill: false\n        },\n        {\n          label: 'V2',\n          data: data.map(row => row.V2),\n          borderColor: 'blue',\n          fill: false\n        },\n        {\n          label: 'SOC',\n          data: data.map(row => row.SOC),\n          borderColor: 'green',\n          fill: false,\n          yAxisID: 'y1'\n        },\n        {\n          label: 'VPV',\n          data: data.map(row => row.VPV),\n          borderColor: 'purple',\n          fill: false,\n        },\n\n      ]\n    };\n\n\t new Chart(document.getElementById('sensorChartV'), {\n\t  type: 'line',\n\t  data: {\n\t\tlabels: labels,\n\t\tdatasets: [\n\t\t  {\n\t\t\tlabel: 'V1',\n\t\t\tdata: data.map(row => row.V1),\n\t\t\tborderColor: 'red',\n\t\t\tfill: false,\n\t\t\tyAxisID: 'y'\n\t\t  },\n\t\t  {\n\t\t\tlabel: 'V2',\n\t\t\tdata: data.map(row => row.V2),\n\t\t\tborderColor: 'blue',\n\t\t\tfill: false,\n\t\t\tyAxisID: 'y'\n\t\t  },\n\t\t  {\n\t\t\tlabel: 'SOC',\n\t\t\tdata: data.map(row => row.SOC),\n\t\t\tborderColor: 'green',\n\t\t\tfill: false,\n\t\t\tyAxisID: 'y1'   \/\/ <<< SOC op rechter Y-as\n\t\t  },\n\t\t  {\n\t\t\tlabel: 'VPV',\n\t\t\tdata: data.map(row => row.VPV),\n\t\t\tborderColor: 'purple',\n\t\t\tfill: false,\n\t\t\tyAxisID: 'y'\n\t\t  }\n\t\t]\n\t  },\n\t  options: {\n\t\tresponsive: true,\n\t\tmaintainAspectRatio: false,\n\t\tscales: {\n\t\t  y: {\n\t\t\ttype: 'linear',\n\t\t\tposition: 'left',\n\t\t\tbeginAtZero: false\n\t\t  },\n\t\t  y1: {\n\t\t\ttype: 'linear',\n\t\t\tposition: 'right',\n\t\t\tbeginAtZero: false,\n\t\t\tgrid: { drawOnChartArea: false } \/\/ <<< voorkomt dubbele gridlijnen\n\t\t  },\n\t\t  x: {\n\t\t\tticks: { maxRotation: 90, minRotation: 45 }\n\t\t  }\n\t\t}\n\t  }\n\t});\n\n  });\n<\/script>\n\n\n\n<p class=\"wp-block-paragraph\">And the climate data:<\/p>\n\n\n\n<div style=\"width: 100%; height: 400px;\">\n    <canvas id=\"sensorChart\"><\/canvas>\n<\/div>\n\n<script src=\"https:\/\/cdn.jsdelivr.net\/npm\/chart.js\"><\/script>\n\n<script>\nfetch('https:\/\/sjefke.synology.me\/bms_sensordata.php')\n  .then(response => response.json())\n  .then(data => {\n\n    const labels = data.map(row => row.time);\n\n    new Chart(document.getElementById('sensorChart'), {\n      type: 'line',\n      data: {\n        labels: labels,\n        datasets: [\n          {\n            label: 'RH (%)',\n            data: data.map(row => row.RH),\n            borderColor: 'red',\n            fill: false,\n            yAxisID: 'y'\n          },\n          {\n            label: 'T (\u00b0C)',\n            data: data.map(row => row.T),\n            borderColor: 'green',\n            fill: false,\n            yAxisID: 'y'\n          },\n          {\n            label: 'P (hPa)',\n            data: data.map(row => row.P),\n            borderColor: 'blue',\n            fill: false,\n            yAxisID: 'y1'   \n          }\n        ]\n      },\n      options: {\n        responsive: true,\n        maintainAspectRatio: false,\n        scales: {\n          y: {\n            type: 'linear',\n            position: 'left',\n            beginAtZero: false,\n            title: { display: true, text: 'RH (%) \/ T (\u00b0C)' }\n          },\n          y1: {\n            type: 'linear',\n            position: 'right',\n            beginAtZero: false,\n            grid: { drawOnChartArea: false },\n            title: { display: true, text: 'P (hPa)' }\n          },\n          x: {\n            ticks: { maxRotation: 90, minRotation: 45 }\n          }\n        }\n      }\n    });\n\n  });\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>Battery voltages, solar panel voltage and household battery state of charge: And the climate data:<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-136","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/sjefke.synology.me\/index.php\/wp-json\/wp\/v2\/pages\/136","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sjefke.synology.me\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sjefke.synology.me\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sjefke.synology.me\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sjefke.synology.me\/index.php\/wp-json\/wp\/v2\/comments?post=136"}],"version-history":[{"count":22,"href":"https:\/\/sjefke.synology.me\/index.php\/wp-json\/wp\/v2\/pages\/136\/revisions"}],"predecessor-version":[{"id":160,"href":"https:\/\/sjefke.synology.me\/index.php\/wp-json\/wp\/v2\/pages\/136\/revisions\/160"}],"wp:attachment":[{"href":"https:\/\/sjefke.synology.me\/index.php\/wp-json\/wp\/v2\/media?parent=136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}