{"id":4538,"date":"2024-06-28T00:41:42","date_gmt":"2024-06-27T15:41:42","guid":{"rendered":"https:\/\/blog.smartlight.co.jp\/?p=4538"},"modified":"2024-06-28T15:10:46","modified_gmt":"2024-06-28T06:10:46","slug":"%e3%82%b9%e3%82%a4%e3%83%83%e3%83%81%e3%81%aeon-off%e3%82%92grafana%e3%81%a7%e6%99%82%e7%b3%bb%e5%88%97%e8%a1%a8%e7%a4%ba4%e6%97%a5%e7%9b%ae","status":"publish","type":"post","link":"https:\/\/blog.smartlight.co.jp\/?p=4538","title":{"rendered":"\u30b9\u30a4\u30c3\u30c1\u306eON\/OFF\u3092Grafana\u3067\u6642\u7cfb\u5217\u8868\u793a(4\u30fb\uff15\u65e5\u76ee)"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u306f\u3058\u3081\u306b<\/h2>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<p>Easyfit Single\u30b9\u30a4\u30c3\u30c1\u306eON\u30fbOFF\u30c7\u30fc\u30bf\u3092Node-RED\u3067\u53d6\u5f97\u3057\u3001InfluxDB\u3067\u30c7\u30fc\u30bf\u3092\u683c\u7d0d\u3001\u305d\u306e\u30c7\u30fc\u30bf\u3092Grafana\u3067\u53ef\u8996\u5316\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3059\u308b\u3002<\/p>\n\n\n\n<p><\/p>\n<\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u76ee\u6b21<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#a1\">Docker-Compose\u3092\u7528\u3044\u305f\u74b0\u5883\u8a2d\u5b9a<\/a><\/li>\n\n\n\n<li><a href=\"#a2\">Node-RED\u306e\u521d\u671f\u8a2d\u5b9a<\/a><\/li>\n\n\n\n<li><a href=\"#a3\">InfluxDB\u306e\u521d\u671f\u8a2d\u5b9a<\/a><\/li>\n\n\n\n<li><a href=\"#a4\">Grafana\u306e\u521d\u671f\u8a2d\u5b9a<\/a><\/li>\n\n\n\n<li><a href=\"#a5\">\u30d5\u30ed\u30fc\u4f5c\u6210<\/a><\/li>\n\n\n\n<li><a href=\"#a6\">\u30c7\u30fc\u30bf\u306e\u53ef\u8996\u5316<\/a><\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"a1\">Docker-Compose\u3092\u7528\u3044\u305f\u74b0\u5883\u8a2d\u5b9a<\/h2>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"wp-block-jin-gb-block-box simple-box1\">\n<p><span class=\"marker\"><strong>\u300c<strong>DockerCompose<\/strong>\u300d<\/strong>\u3068\u306f\u30fb\u30fb\u30fb<\/span><br><br>\u8907\u6570\u306eDocker\u30b3\u30f3\u30c6\u30ca\u3092\u7c21\u5358\u306b\u5b9a\u7fa9\u3001\u7ba1\u7406\u3001\u5b9f\u884c\u3059\u308b\u305f\u3081\u306e\u30c4\u30fc\u30eb\u3002YAML\u30d5\u30a1\u30a4\u30eb\u3092\u4f7f\u7528\u3057\u3066\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30b5\u30fc\u30d3\u30b9\u3092\u8a2d\u5b9a\u3057\u3001\u4e00\u9023\u306e\u30b3\u30de\u30f3\u30c9\u3067\u305d\u308c\u3089\u306e\u30b5\u30fc\u30d3\u30b9\u3092\u8d77\u52d5\u3001\u505c\u6b62\u3001\u518d\u69cb\u7bc9\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3002<\/p>\n<\/div>\n<\/div>\n<\/div>\n\n\n\n<p>\u203b\u3053\u3053\u304b\u3089\u306e\u64cd\u4f5c\u306f<strong>DockerDesktop<\/strong>\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u524d\u63d0\u3068\u306a\u3063\u3066\u3044\u308b<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-medium-font-size\"><br><span class=\"marker\"><span class=\"marker2\"><strong>\u3000\u2460 DockerCompose<\/strong>\u306e<strong>yml\u30d5\u30a1\u30a4\u30eb<\/strong>\u3092\u4f5c\u6210<strong>\u3000<\/strong><\/span><\/span><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u3000\u3000\u30fb\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001\u5c02\u7528\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3068yml\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>mkdir my_docker_project\ncd my_docker_project\ntype nul &gt; docker-compose.yml<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-medium-font-size\"><span class=\"marker2\"><strong>\u3000\u2781 <\/strong>\u4f5c\u6210\u3057\u305f<strong>yml\u30d5\u30a1\u30a4\u30eb\u306e\u7de8\u96c6\u3000<\/strong><\/span><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u3000\u3000\u30fb\u4f5c\u6210\u3057\u305f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u4e2d\u306b\u3042\u308b<code>yml<\/code>\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304d\u3001\u4e0b\u8a18\u306e\u30b3\u30fc\u30c9\u3092\u8cbc\u308a\u4ed8\u3051\u308b\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>version: &#039;3&#039;\nservices:\n  mosquitto:\n    image: eclipse-mosquitto:latest\n    container_name: mosquitto\n    ports:\n      - &quot;1883:1883&quot;\n      - &quot;9001:9001&quot;\n    volumes:\n      - mosquitto_data:\/mosquitto\/data\n      - mosquitto_config:\/mosquitto\/config\n      - mosquitto_log:\/mosquitto\/log\n\n  influxdb:\n    image: influxdb:latest\n    container_name: influxdb\n    ports:\n      - &quot;8086:8086&quot;\n    volumes:\n      - influxdb-storage:\/var\/lib\/influxdb2\n\n  grafana:\n    image: grafana\/grafana:latest\n    container_name: grafana\n    ports:\n      - &quot;3000:3000&quot;\n    volumes:\n      - grafana-storage:\/var\/lib\/grafana\n\nvolumes:\n  mosquitto_data:\n  mosquitto_config:\n  mosquitto_log:\n  influxdb-storage:\n  grafana-storage:\n<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-medium-font-size\"><span class=\"marker2\"><strong>\u3000\u2782 DockerCompose\u306e\u5b9f\u884c\u3000<\/strong><\/span><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u3000\u3000\u30fb\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001DockerCompose\u3092\u8d77\u52d5\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>docker-compose up -d<\/code><\/pre><\/div>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"814\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-229-1024x814.png\" alt=\"\" class=\"wp-image-4560\" srcset=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-229-1024x814.png 1024w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-229-300x238.png 300w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-229-768x610.png 768w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-229-1536x1221.png 1536w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-229.png 1862w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-229-1024x814.png 856w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"a2\">Node-RED\u306e\u521d\u671f\u8a2d\u5b9a<\/h2>\n\n\n\n<p class=\"has-medium-font-size\"><span class=\"marker2\">\u3000\u2460 \u30d6\u30e9\u30a6\u30b6\u3067<code><a href=\"http:\/\/localhost:1880\">http:\/\/localhost:1880<\/a><\/code>\u306b\u30a2\u30af\u30bb\u30b9<\/span><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-medium-font-size\"><span class=\"marker2\">\u3000\u2781\u300c<strong>node-red-contrib-influxdb<\/strong><a href=\"https:\/\/flows.nodered.org\/node\/node-red-contrib-influxdb\" target=\"_blank\" rel=\"noreferrer noopener\"><\/a>\u300d\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/span><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u3000\u30001.  \u53f3\u4e0a\u306e\u300c<strong>\u30cf\u30f3\u30d0\u30fc\u30ac\u30fc\u30dc\u30bf\u30f3<\/strong>\u300d\u3092\u62bc\u3059<\/p>\n\n\n\n<p>\u3000\u30002. \u300c<strong>\u30ce\u30fc\u30c9\u3092\u8ffd\u52a0<\/strong>\u300d\u30bf\u30d6\u3092\u9078\u629e<\/p>\n\n\n\n<p>\u3000\u30003.  \u691c\u7d22\u6b04\u304b\u3089\u300c<strong>node-red-contrib-influxdb<\/strong>\u300d\u3092\u8ffd\u52a0<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"495\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-246-1024x495.png\" alt=\"\" class=\"wp-image-4577\" srcset=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-246-1024x495.png 1024w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-246-300x145.png 300w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-246-768x371.png 768w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-246-1536x743.png 1536w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-246-2048x990.png 2048w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-246-1024x495.png 856w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"a3\">InfluxDB\u306e\u521d\u671f\u8a2d\u5b9a<\/h2>\n\n\n\n<p class=\"has-medium-font-size\"><span class=\"marker2\">\u3000\u2460 \u30d6\u30e9\u30a6\u30b6\u3067<code><a href=\"http:\/\/localhost:8086\">http:\/\/localhost:8086<\/a><\/code>\u306b\u30a2\u30af\u30bb\u30b9<\/span><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-medium-font-size\"><span class=\"marker2\">\u3000\u2781 InfluxDB\u306e<strong>\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7<\/strong><\/span><\/p>\n\n\n\n<p><br>\u3000\u3000 \u30fb\u300c<strong>\u30e6\u30fc\u30b6\u30fc\u540d<\/strong>\u300d\u300c<strong>\u30d1\u30b9\u30ef\u30fc\u30c9<\/strong>(+\u78ba\u8a8d)\u300d\u300c<strong>\u7d44\u7e54\u540d<\/strong>\u300d\u300c<strong>\u30d0\u30b1\u30c3\u30c8\u540d<\/strong>\u300d\u3092\u8a2d\u5b9a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"494\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-250-1024x494.png\" alt=\"\" class=\"wp-image-4581\" srcset=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-250-1024x494.png 1024w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-250-300x145.png 300w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-250-768x371.png 768w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-250-1536x741.png 1536w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-250.png 2000w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-250-1024x494.png 856w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-medium-font-size\"><span class=\"marker2\">\u3000\u2782 \u300c<strong>APIToken<\/strong>\u300d\u306e\u4f5c\u6210<\/span><\/p>\n\n\n\n<p>\u3000\u3000\u3000\u30fb \u5de6\u306e\u6b04\u306b\u3042\u308b\u300c<strong>\u2191<\/strong>\u300d\u30de\u30fc\u30af\u3092\u62bc\u3057\u3001\u300c<strong>API TOKENS<\/strong>\u300d\u3092\u9078\u629e\u3002<\/p>\n\n\n\n<p>\u3000\u3000\u3000\u30fb \u300c<strong>GENERATE API TOKEN<\/strong>\u300d\u3092\u62bc\u3057\u3001\u300c<strong>AII Access API Token<\/strong>\u300d\u3092\u9078\u629e\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"494\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-204-1024x494.png\" alt=\"\" class=\"wp-image-4523\" srcset=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-204-1024x494.png 1024w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-204-300x145.png 300w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-204-768x371.png 768w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-204-1536x741.png 1536w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-204-2048x989.png 2048w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-204-1024x494.png 856w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"672\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-205-1024x672.png\" alt=\"\" class=\"wp-image-4524\" srcset=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-205-1024x672.png 1024w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-205-300x197.png 300w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-205-768x504.png 768w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-205.png 1250w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-205-1024x672.png 856w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u3000\u3000\u3000\u30fb \u5fc5\u8981\u306a\u5834\u5408\u8aac\u660e\u3092\u8a18\u8f09\u3057\u3001\u300c<strong>SAVE<\/strong>\u300d\u3092\u62bc\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"428\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-206-1024x428.png\" alt=\"\" class=\"wp-image-4525\" srcset=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-206-1024x428.png 1024w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-206-300x126.png 300w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-206-768x321.png 768w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-206.png 1470w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-206-1024x428.png 856w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u3000\u3000\u3000\u30fb \u4f5c\u6210\u3057\u305f\u300c<strong>API TOKEN<\/strong>\u300d\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3001<br>\u3000\u3000\u3000\u3000 \u30b3\u30d4\u30fc\u3057\u3001<strong>\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b<\/strong>\u5225\u306e\u5834\u6240\u306b<strong>\u4fdd\u5b58<\/strong>\u3059\u308b\u306a\u3069\u3057\u3066\u5bfe\u7b56\u3059\u308b\u3002<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"a4\">Grafana\u306e\u521d\u671f\u8a2d\u5b9a<\/h2>\n\n\n\n<p class=\"has-medium-font-size\"><span class=\"marker2\">\u3000\u2460 \u30d6\u30e9\u30a6\u30b6\u3067<code><a href=\"http:\/\/localhost:3000\">http:\/\/localhost:3000<\/a><\/code>\u306b\u30a2\u30af\u30bb\u30b9<\/span><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-medium-font-size\"><span class=\"marker2\">\u3000\u2781 <strong>Grafana\u30ed\u30b0\u30a4\u30f3<\/strong><\/span><\/p>\n\n\n\n<p>\u3000\u3000\u3000\u30fb\u521d\u56de\u6642\u3001\u30e6\u30fc\u30b6\u30fc\u540d\u30fb\u30d1\u30b9\u30ef\u30fc\u30c9\u306f\u300c<strong>admin<\/strong>\u300d\u3068\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<p>\u3000\u3000\u3000\u30fb\u30ed\u30b0\u30a4\u30f3\u5f8c\u3001<strong>\u65b0\u3057\u3044\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a<\/strong>\u3059\u308b\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-medium-font-size\"><span class=\"marker2\">\u3000\u2782 \u30c7\u30fc\u30bf\u30bd\u30fc\u30b9( <strong>InfluxDB<\/strong> )\u306e<strong>\u8ffd\u52a0<\/strong><\/span><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"493\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-208-1024x493.png\" alt=\"\" class=\"wp-image-4527\" srcset=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-208-1024x493.png 1024w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-208-300x144.png 300w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-208-768x369.png 768w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-208-1536x739.png 1536w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-208-2048x985.png 2048w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-208-1024x493.png 856w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u3000\u30fb \u5de6\u5074\u306e\u30e1\u30cb\u30e5\u30fc\u304b\u3089\u300c<strong>Connections<\/strong>\u300d &gt; \u300c<strong>Data Sources <\/strong>(\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9)\u300d\u3092\u9078\u629e\u3002<\/p>\n\n\n\n<p>\u3000\u30fb\u300c<strong>Add data source<\/strong> (\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u3092\u8ffd\u52a0)\u300d\u3092\u30af\u30ea\u30c3\u30af\u3002<\/p>\n\n\n\n<p>\u3000\u30fb\u300c<strong>InfluxDB<\/strong>\u300d\u3092\u9078\u629e\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-medium-font-size\"><span class=\"marker2\">\u3000\u2783 InfluxDB\u306e<strong>\u63a5\u7d9a\u60c5\u5831\u3092\u5165\u529b<\/strong><\/span><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"494\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-209-1024x494.png\" alt=\"\" class=\"wp-image-4528\" srcset=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-209-1024x494.png 1024w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-209-300x145.png 300w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-209-768x370.png 768w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-209-1536x741.png 1536w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-209-2048x988.png 2048w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-209-1024x494.png 856w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"493\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-210-1024x493.png\" alt=\"\" class=\"wp-image-4529\" srcset=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-210-1024x493.png 1024w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-210-300x144.png 300w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-210-768x370.png 768w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-210-1536x740.png 1536w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-210-2048x986.png 2048w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-210-1024x493.png 856w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u3000\u30fb\u4e0b\u8a18\u306e\u901a\u308a\u306b\u5909\u66f4\u30fb\u5165\u529b\u3059\u308b<\/p>\n\n\n\n<p>\u3000\u3000\u2460  <strong>Query Language<\/strong>  \u2192 <code>\u300c<code><strong>Flux<\/strong><\/code>\u300d<\/code>\u306b\u5909\u66f4<\/p>\n\n\n\n<p>\u3000\u3000\u2781 <strong>HTTP \u306e URL<\/strong><code> \u2192 \u300c<\/code><strong>http:\/\/localhost:8086<\/strong><code>\u300d<\/code><\/p>\n\n\n\n<p>\u3000\u3000\u2782 \u300c<strong>Basic auth<\/strong>\u300d\u304c<strong>\u30aa\u30f3<\/strong>\u306b\u306a\u3063\u3066\u3044\u308b\u304b\u78ba\u8a8d<\/p>\n\n\n\n<p>\u3000\u3000\u2783  InfluxDB\u3067\u8a2d\u5b9a\u3057\u305f\u300c<strong>\u30e6\u30fc\u30b6\u30fc\u540d<\/strong>\u300d\u3092\u5165\u529b<\/p>\n\n\n\n<p>\u3000\u3000\u2784  InfluxDB\u3067\u8a2d\u5b9a\u3057\u305f\u300c<strong>\u30d1\u30b9\u30ef\u30fc\u30c9<\/strong>\u300d\u3092\u5165\u529b<\/p>\n\n\n\n<p>\u3000\u3000<strong>\u2785  Organization<\/strong> \u2192 InfluxDB\u3067\u8a2d\u5b9a\u3057\u305f\u300c<strong>\u7d44\u7e54\u540d<\/strong>\u300d\u3092\u5165\u529b<\/p>\n\n\n\n<p>\u3000\u3000\u2466  <strong>Token<\/strong><code> \u2192 <\/code>InfluxDB\u3067\u751f\u6210\u3057\u305f<strong>API\u30c8\u30fc\u30af\u30f3<\/strong>\u3092\u30b3\u30d4\u30fc\u3057\u3066\u8cbc\u308a\u4ed8\u3051\u308b\u3002<\/p>\n\n\n\n<p>\u3000\u3000\u2467  <strong>Default Bucket<\/strong><code><strong> \u2192 <\/strong>InfluxDB\u3067\u8a2d\u5b9a\u3057\u305f\u300c<strong>\u30d0\u30b1\u30c3\u30c8\u540d<\/strong>\u300d\u3092\u5165\u529b<\/code><\/p>\n\n\n\n<p>\u3000\u3000\u3000\u3000\u2192\u300c<strong>Save &amp; Test<\/strong>\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u63a5\u7d9a<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"a5\">\u30d5\u30ed\u30fc\u4f5c\u6210<\/h2>\n\n\n\n<div class=\"wp-block-jin-gb-block-box simple-box1\">\n<p class=\"has-medium-font-size\"><span class=\"marker\">\u30fb<strong>\u5168\u4f53<\/strong><\/span><span class=\"marker2\"><span class=\"marker\"><strong>\u50cf<\/strong>\u3000<\/span><\/span><br><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"694\" height=\"169\" class=\"wp-image-4584\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-253.png\" alt=\"\"><\/figure><\/p>\n<\/div>\n\n\n\n<p class=\"has-medium-font-size\"><span class=\"marker2\">\u3000\u2460\u300c<strong>serial in<\/strong>\u300d\u306e\u8a2d\u5b9a<\/span><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u3000\u3000\u30fb\u300c<strong>serial in<\/strong>\u300d\u30ce\u30fc\u30c9\u3092\u30c9\u30e9\u30c3\u30b0\uff06\u30c9\u30ed\u30c3\u30d7<\/p>\n\n\n\n<p>\u3000\u3000\u30fb \u30ce\u30fc\u30c9\u3092\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3057\u3001\u8a2d\u5b9a<br>\u3000\u3000\u3000\u3000\u2192\u30da\u30f3\u30de\u30fc\u30af\u3092\u62bc\u3057\u3066\u8a73\u7d30\u8a2d\u5b9a\u3078<\/p>\n\n\n\n<p>\u3000\u3000\u30fb <strong>\u30b7\u30ea\u30a2\u30eb\u30dd\u30fc\u30c8<\/strong>\u3092\u8a2d\u5b9a(<strong>\u30c7\u30d0\u30a4\u30b9\u30de\u30cd\u30fc\u30b8\u30e3\u30fc<\/strong>\u3067\u78ba\u8a8d)<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"942\" height=\"1024\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-256-942x1024.png\" alt=\"\" class=\"wp-image-4587\" style=\"width:435px;height:auto\" srcset=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-256-942x1024.png 942w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-256-276x300.png 276w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-256-768x834.png 768w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-256.png 1132w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-256-942x1024.png 856w\" sizes=\"auto, (max-width: 942px) 100vw, 942px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"has-medium-font-size\"><span class=\"marker2\">\u3000\u2781\u300c<strong>function<\/strong>\u300d\u306e\u8a2d\u5b9a<\/span><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u3000\u3000\u30fb\u300c<strong>function<\/strong>\u300d\u30ce\u30fc\u30c9\u3092\u30c9\u30e9\u30c3\u30b0\uff06\u30c9\u30ed\u30c3\u30d7<\/p>\n\n\n\n<p>\u3000\u3000\u30fb \u30ce\u30fc\u30c9\u3092\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3057\u3001\u4e0b\u8a18\u306e\u30b3\u30fc\u30c9\u3092\u633f\u5165<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>var date = new Date();\nvar ESP3_Packet = msg.payload;\nvar Header = ESP3_Packet.slice(1, 5);\nvar DataLength = 256 * ESP3_Packet<img decoding=\"async\" class=\"ranking-number\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/themes\/jin\/img\/rank01.png\" \/> + ESP3_Packet<img decoding=\"async\" class=\"ranking-number\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/themes\/jin\/img\/rank02.png\" \/>;\nvar RawData = ESP3_Packet.slice(6, 6 + DataLength);\nvar ERP2_Header = RawData.slice(0, 1).toString(&quot;hex&quot;);\nvar EEP = &quot;RPS&quot;;\nvar OriginatorID = &quot;00000000&quot;;\nvar Data1 = &quot;00&quot;;\nvar Data4 = &quot;00000000&quot;;\nvar OptionalData = ESP3_Packet.slice(6 + DataLength, 8 + DataLength);\nvar SubTelNum = OptionalData.slice(0, 1);\nvar dBm = OptionalData.slice(1, 2);\n\nswitch (ERP2_Header) {\n    case &quot;20&quot;:\n        EEP = &quot;RPS&quot;;\n        OriginatorID = RawData.slice(1, 5).toString(&quot;hex&quot;);\n        Data1 = RawData.slice(5, 6).toString(&quot;hex&quot;);\n        break;\n    case &quot;21&quot;:\n        EEP = &quot;1BS&quot;;\n        OriginatorID = RawData.slice(1, 5).toString(&quot;hex&quot;);\n        Data1 = RawData.slice(5, 6).toString(&quot;hex&quot;);\n        break;\n    case &quot;22&quot;:\n        EEP = &quot;4BS&quot;;\n        OriginatorID = RawData.slice(1, 5).toString(&quot;hex&quot;);\n        Data4 = RawData.slice(5, 9).toString(&quot;hex&quot;);\n        break;\n    case &quot;61&quot;:\n        EEP = &quot;1BS teach-in&quot;;\n        OriginatorID = RawData.slice(3, 7).toString(&quot;hex&quot;);\n        Data1 = RawData.slice(7, 8).toString(&quot;hex&quot;);\n        break;\n    case &quot;62&quot;:\n        EEP = &quot;4BS teach-in&quot;;\n        OriginatorID = RawData.slice(3, 7).toString(&quot;hex&quot;);\n        Data4 = RawData.slice(7, 11).toString(&quot;hex&quot;);\n        break;\n    default:\n        break;\n}\n\nvar SwitchState = global.get(&#039;buttonState_&#039; + OriginatorID) || 0;\n\nif (Data1 === &quot;84&quot; || Data1 === &quot;88&quot;) {\n    SwitchState = (SwitchState === 0) ? 1 : 0;\n    global.set(&#039;buttonState_&#039; + OriginatorID, SwitchState);\n} else if (Data1 === &quot;00&quot;) {\n    return null;\n}\n\nmsg.payload = {\n    Time: date.toISOString(),\n    OriginatorID: OriginatorID,\n    SwitchState: SwitchState, \/\/ Ensure this is a number (1 or 0)\n    EEP: EEP,\n    Data1: Data1,\n    Data4: Data4,\n    SubTelNum: SubTelNum,\n    dBm: dBm,\n};\n\nreturn msg;<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-medium-font-size\"><span class=\"marker2\">\u3000\u2782\u300c<strong>influxdb out<\/strong>\u300d\u306e\u8a2d\u5b9a<\/span><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u3000\u3000\u30fb\u300c<strong>influxdb out<\/strong>\u300d\u30ce\u30fc\u30c9\u3092\u30c9\u30e9\u30c3\u30b0\uff06\u30c9\u30ed\u30c3\u30d7<\/p>\n\n\n\n<p>\u3000\u3000\u30fb \u30ce\u30fc\u30c9\u3092\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3057\u3001\u4ee5\u4e0b\u306e\u5185\u5bb9\u3092\u8a18\u5165<\/p>\n\n\n\n<p>\u3000\u3000\u30fb\u300c<strong>Organization<\/strong>\u300d\uff1a\u8a2d\u5b9a\u3057\u305f<strong>\u7d44\u7e54\u540d<\/strong><br>\u3000\u3000\u30fb\u300c<strong>Bucket<\/strong>\u300d\uff1a\u8a2d\u5b9a\u3057\u305f<strong>\u30d0\u30b1\u30c3\u30c8\u540d<\/strong><br>\u3000\u3000\u30fb\u300c<strong>Measurement<\/strong>\u300d\uff1a\u81ea\u8eab\u3067\u6307\u5b9a\u3059\u308b<br><br>\u3000\u3000\u2192 \u300c<strong>\u30da\u30f3\u30de\u30fc\u30af<\/strong>\u300d\u3092\u62bc\u3057\u3066\u6b21\u306e\u753b\u9762\u3078<br>\u3000\u3000\u30fb\u300c<strong>URL<\/strong>\u300d\uff1a\u300c<strong>http:\/\/localhost:8086<\/strong>\u300d<br>\u3000\u3000\u30fb\u300c<strong>Token<\/strong>\u300d\uff1a\u4f5c\u6210\u3057\u305fToken\u3092\u30da\u30fc\u30b9\u30c8<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"644\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-260-1024x644.png\" alt=\"\" class=\"wp-image-4591\" srcset=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-260-1024x644.png 1024w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-260-300x189.png 300w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-260-768x483.png 768w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-260-1536x966.png 1536w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-260-2048x1288.png 2048w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-260-1024x644.png 856w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"579\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-259-1024x579.png\" alt=\"\" class=\"wp-image-4590\" srcset=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-259-1024x579.png 1024w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-259-300x170.png 300w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-259-768x434.png 768w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-259-1536x868.png 1536w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-259-2048x1157.png 2048w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-259-320x180.png 320w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-259-1024x579.png 856w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-medium-font-size\"><span class=\"marker2\">\u3000\u2783 \u305d\u308c\u305e\u308c\u306e<strong>\u30ce\u30fc\u30c9\u3092\u7e4b\u3052\u308b<\/strong>(\u4efb\u610f\u3067\u30c7\u30d0\u30c3\u30b0\u30ce\u30fc\u30c9\u3082)<\/span><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"a6\">\u30c7\u30fc\u30bf\u306e\u53ef\u8996\u5316<\/h2>\n\n\n\n<p class=\"has-medium-font-size\"><span class=\"marker2\">\u3000\u2460 \u4f5c\u6210\u3057\u305f\u30d5\u30ed\u30fc\u306e\u5b9f\u884c<\/span><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u3000\u3000\u30fb\u5b9f\u884c\u3057\u3001\u30c7\u30d0\u30c3\u30b0\u3092\u78ba\u8a8d\u3059\u308b\u3068\u62bc\u3059\u305f\u3073\u306b\u300c<strong>ON\/OFF (0\/1)<\/strong>\u300d\u304c\u5207\u308a\u66ff\u308f\u3063\u3066\u3044\u308b\u306e\u304c\u78ba\u8a8d\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"477\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-262-1024x477.png\" alt=\"\" class=\"wp-image-4595\" srcset=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-262-1024x477.png 1024w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-262-300x140.png 300w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-262-768x358.png 768w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-262-1536x715.png 1536w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-262.png 1759w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-262-1024x477.png 856w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\"><span class=\"marker2\">\u3000\u2781 DataExplorer\u3067\u78ba\u8a8d<\/span><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u3000\u3000\u30fb\u6b21\u306b\u3001<strong>InfluxDB\u306eDataExplorer<\/strong>\u3092\u7528\u3044\u3066\u5f97\u3089\u308c\u305f\u30c7\u30fc\u30bf\u3092<strong>\u30c6\u30fc\u30d6\u30eb<\/strong>\u3084<strong>\u30b0\u30e9\u30d5<\/strong>\u3067\u78ba\u8a8d\u3059\u308b<\/p>\n\n\n\n<p>\u3000\u30001. \u5de6\u306e\u6b04\u304b\u3089\u300c<strong>DataExplorer<\/strong>\u300d\u3092\u958b\u304f<br>\u3000\u30002. \u4f5c\u6210\u30fb\u6307\u5b9a\u3057\u305f\u30d0\u30b1\u30c3\u30c8\u3092\u9078\u629e<br>\u3000\u30003. \u300c<strong>Measurement<\/strong>\u300d\u3092\u9078\u629e<br>\u3000\u30004. \u300cSwitchState\u300d\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u9078\u629e<br>\u3000\u30005. \u53f3\u4e0b\u306e\u300c<strong>AGGREGATE FUNCTION<\/strong>\u300d\u3092\u300cCUSTOM\u300d\u306b\u3057\u3001\u300cmean\u300d\u3092\u30aa\u30d5<br>\u3000\u30006. \u300cSUBMIT\u300d\u3092\u62bc\u3059<br>\u3000\u30007. \u8868\u793a\u5f62\u5f0f\u3092\u300c<strong>Table<\/strong>\u300d\u306b\u3059\u308b\u3053\u3068\u3067\u5024\u306e\u78ba\u8a8d\u3082\u53ef\u80fd<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"495\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-263-1024x495.png\" alt=\"\" class=\"wp-image-4596\" srcset=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-263-1024x495.png 1024w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-263-300x145.png 300w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-263-768x371.png 768w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-263-1536x743.png 1536w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-263.png 2000w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-263-1024x495.png 856w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"494\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-265-1024x494.png\" alt=\"\" class=\"wp-image-4599\" srcset=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-265-1024x494.png 1024w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-265-300x145.png 300w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-265-768x370.png 768w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-265-1536x741.png 1536w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-265-2048x988.png 2048w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-265-1024x494.png 856w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-medium-font-size\"><span class=\"marker2\">\u3000\u2782 Grafana\u3067\u53ef\u8996\u5316<\/span><\/p>\n\n\n\n<p>\u3000\u30fb\u4e0b\u8a18\u306e\u30b3\u30fc\u30c9\u3092<strong>\u30af\u30a8\u30ea\u306b\u633f\u5165<\/strong>\u5f8c\u3001\u300c<strong>Apply<\/strong>\u300d\u3092\u62bc\u3059\u3053\u3068\u3067\u30b0\u30e9\u30d5\u306e\u53ef\u8996\u5316\u304c\u3067\u304d\u308b<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>from(bucket: &quot;newbucket&quot;)\n  |&gt; range(start: -1h)  \/\/ \u904e\u53bb1\u6642\u9593\u306e\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\n  |&gt; filter(fn: (r) =&gt; r._measurement == &quot;switch_state&quot;)  \/\/ switch_state\u306e\u6e2c\u5b9a\u5024\u3092\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\n  |&gt; filter(fn: (r) =&gt; r._field == &quot;SwitchState&quot;)  \/\/ SwitchState\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"494\" src=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-264-1024x494.png\" alt=\"\" class=\"wp-image-4597\" srcset=\"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-264-1024x494.png 1024w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-264-300x145.png 300w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-264-768x371.png 768w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-264-1536x741.png 1536w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-264-2048x988.png 2048w, https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-264-1024x494.png 856w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u306f\u3058\u3081\u306b Easyfit Single\u30b9\u30a4\u30c3\u30c1\u306eON\u30fbOFF\u30c7\u30fc\u30bf\u3092Node-RED\u3067\u53d6\u5f97\u3057\u3001InfluxDB\u3067\u30c7\u30fc\u30bf\u3092\u683c\u7d0d\u3001\u305d\u306e\u30c7\u30fc\u30bf\u3092Grafana\u3067\u53ef\u8996\u5316\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3059\u308b\u3002 \u76ee\u6b21 Docker-Compose\u3092\u7528<\/p>\n","protected":false},"author":16,"featured_media":4657,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jin_ogp_image_url":"","_jin_last_featured_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-4538","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-intern"],"jetpack_featured_media_url":"https:\/\/blog.smartlight.co.jp\/wp-content\/uploads\/2024\/06\/image-298.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blog.smartlight.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/4538","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.smartlight.co.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.smartlight.co.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.smartlight.co.jp\/index.php?rest_route=\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.smartlight.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4538"}],"version-history":[{"count":6,"href":"https:\/\/blog.smartlight.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/4538\/revisions"}],"predecessor-version":[{"id":4611,"href":"https:\/\/blog.smartlight.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/4538\/revisions\/4611"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.smartlight.co.jp\/index.php?rest_route=\/wp\/v2\/media\/4657"}],"wp:attachment":[{"href":"https:\/\/blog.smartlight.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4538"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.smartlight.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4538"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.smartlight.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4538"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}