diff --git a/milesight-iot-am107/CHANGELOG.md b/milesight-iot-am107/CHANGELOG.md new file mode 100644 index 000000000..b585d3a0f --- /dev/null +++ b/milesight-iot-am107/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +## 1.0.0 - 2026-03-26 + +- First version of plugin \ No newline at end of file diff --git a/milesight-iot-am107/LICENSE.md b/milesight-iot-am107/LICENSE.md new file mode 100644 index 000000000..bffeef341 --- /dev/null +++ b/milesight-iot-am107/LICENSE.md @@ -0,0 +1,7 @@ +Copyright 2026 Thinger.io + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/milesight-iot-am107/README.md b/milesight-iot-am107/README.md new file mode 100644 index 000000000..a4e3f1590 --- /dev/null +++ b/milesight-iot-am107/README.md @@ -0,0 +1,59 @@ +# AM107 - Ambience Monitoring Sensors + +The Milesight AM107 is a comprehensive LoRaWAN ambience monitoring sensor designed for Indoor Air Quality (IAQ) monitoring. This all-in-one device integrates seven smart sensors to measure CO2 concentration, temperature, humidity, light, TVOC (Total Volatile Organic Compounds), barometric pressure, and motion detection (PIR). The AM107 displays IAQ data in real-time and is equipped with NFC (Near Field Communication) for easy configuration via smartphone or PC software. + +## Features + +- **7-in-1 Multi-Sensor Solution**: Temperature, humidity, light intensity, CO2, TVOC, barometric pressure, and motion (PIR) detection +- **LoRaWAN Connectivity**: Long-range wireless communication for reliable data transmission +- **Real-Time Data Display**: Built-in display for instant IAQ data visualization +- **NFC Configuration**: Simple setup and configuration via smartphone or PC +- **Battery or USB Powered**: Dual power options with 2 × 1.5V AA alkaline batteries or Type-C port +- **Compact Design**: Dimensions of 105 × 21.2 × 70.4 mm +- **IP30 Enclosure**: Suitable for indoor environments +- **Wide Temperature Range**: Operating temperature from 0°C to 45°C (sensor range: -20°C to +70°C) + +## Use Cases + +- Indoor Air Quality (IAQ) monitoring in offices, schools, and commercial buildings +- Smart building automation and environmental control +- Workspace occupancy detection and management +- HVAC system optimization +- Health and safety compliance monitoring + +## Thinger.io Integration + +The AM107 integrates seamlessly with Thinger.io through LoRaWAN network servers, enabling centralized monitoring and data analysis of all environmental parameters. + +## Requirements + +A LoRaWAN server is required to communicate the Milesight AM107 into Thinger.io, some options are: + +- [The Things Stack](https://www.thethingsindustries.com/stack/) +- [LORIOT](https://loriot.io/) +- [ChirpStack](https://www.chirpstack.io/) + +Alongside, the corresponding plugin for the selected LoRaWAN server needs to be installed in your Thinger.io instance. + +## Get Started + +### Installation + +Look for the plugin in the [Thinger.io Plugin Store](https://marketplace.thinger.io/) and install it in your Thinger.io instance. Once the plugin is installed a new Product will be created for this device. + +### Configuration + +The Product is already preconfigured, check that the auto provision prefix matches the one selected in your LoRaWAN server plugin in Thinger.io, or change it to your desire. + +### Usage + +Start sending uplinks for autoprovisioning devices and buckets. +This product also provides a predefined dashboard and downlinks. + +## Additional Resources + +Milesight resources can be found at: + +- [Product Page](https://www.milesight.com/iot/product/lorawan-sensor/am107) +- [Device Repository](https://www.thethingsnetwork.org/device-repository/devices/milesight-iot/am107/) +- [Thinger docs](https://docs.thinger.io) \ No newline at end of file diff --git a/milesight-iot-am107/assets/am107.png b/milesight-iot-am107/assets/am107.png new file mode 100644 index 000000000..729864872 Binary files /dev/null and b/milesight-iot-am107/assets/am107.png differ diff --git a/milesight-iot-am107/plugin.json b/milesight-iot-am107/plugin.json new file mode 100644 index 000000000..436a7f3a9 --- /dev/null +++ b/milesight-iot-am107/plugin.json @@ -0,0 +1,1068 @@ +{ + "name": "milesight_iot_am107", + "version": "1.0.0", + "description": "Ambience Monitoring Sensors", + "author": "Thinger.io", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/thinger-io/plugins.git", + "directory": "milesight-iot-am107" + }, + "metadata": { + "name": "Milesight-Iot AM107", + "description": "Ambience Monitoring Sensors", + "image": "assets/am107.png", + "category": "devices", + "vendor": "milesight-iot" + }, + "resources": { + "products": [ + { + "description": "Ambience Monitoring Sensors", + "enabled": true, + "name": "Milesight-Iot AM107", + "product": "milesight_iot_am107", + "profile": { + "api": { + "downlink": { + "enabled": true, + "handle_connectivity": false, + "request": { + "data": { + "path": "/downlink", + "payload": "{\r\n \"data\" : \"{{payload.data=\"\"}}\",\r\n \"port\" : {{payload.port=2}},\r\n \"priority\": {{payload.priority=3}},\r\n \"confirmed\" : {{payload.confirmed=false}},\r\n \"uplink\" : {{property.uplink}} \r\n}", + "payload_function": "", + "payload_type": "", + "plugin": "{{property.uplink.source}}", + "target": "plugin_endpoint" + } + }, + "response": { + "data": { + "source": "request_response" + } + } + }, + "uplink": { + "enabled": true, + "handle_connectivity": true, + "request": { + "data": { + "payload": "{{payload}}", + "payload_function": "", + "payload_type": "source_payload", + "resource_stream": "uplink", + "target": "resource_stream" + } + }, + "response": { + "data": { + "source": "request_response" + } + } + } + }, + "autoprovisions": { + "device_autoprovisioning": { + "config": { + "mode": "pattern", + "pattern": "am107_.*" + }, + "enabled": true + } + }, + "buckets": { + "milesight_am107_data": { + "backend": "mongodb", + "data": { + "payload": "{{payload}}", + "payload_function": "", + "payload_type": "source_payload", + "resource_stream": "uplink_decoded", + "target": "resource_stream" + }, + "enabled": true, + "retention": { + "period": 3, + "unit": "months" + }, + "tags": [] + } + }, + "code": { + "code": "function decodeThingerUplink(thingerData) {\n // 0. If data has already been decoded, we will return it\n if (thingerData.decodedPayload) return thingerData.decodedPayload;\n \n // 1. Extract and Validate Input\n // We need 'payload' (hex string) and 'fPort' (integer)\n const hexPayload = thingerData.payload || \"\";\n const port = thingerData.fPort || 1;\n\n // 2. Convert Hex String to Byte Array\n const bytes = [];\n for (let i = 0; i < hexPayload.length; i += 2) {\n bytes.push(parseInt(hexPayload.substr(i, 2), 16));\n }\n\n // 3. Dynamic Function Detection and Execution\n \n // CASE A: (The Things Stack v3)\n if (typeof decodeUplink === 'function') {\n try {\n const input = {\n bytes: bytes,\n fPort: port\n };\n var result = decodeUplink(input);\n \n if (result.data) return result.data;\n\n return result; \n } catch (e) {\n console.error(\"Error inside decodeUplink:\", e);\n throw e;\n }\n }\n\n // CASE B: Legacy TTN (v2)\n else if (typeof Decoder === 'function') {\n try {\n return Decoder(bytes, port);\n } catch (e) {\n console.error(\"Error inside Decoder:\", e);\n throw e;\n }\n }\n\n // CASE C: No decoder found\n else {\n throw new Error(\"No compatible TTN decoder function (decodeUplink or Decoder) found in scope.\");\n }\n}\n\n\n// TTN decoder\n\nfunction decodeUplink(input) {\n var res = Decoder(input.bytes, input.fPort);\n if (res.error) {\n return {\n errors: [res.error],\n };\n }\n return {\n data: res,\n };\n}\n\n/**\n * Payload Decoder for The Things Network\n * \n * Copyright 2021 Milesight IoT\n * \n * @product AM104 / AM107\n */\nfunction Decoder(bytes, port) {\n var decoded = {};\n\n for (var i = 0; i < bytes.length;) {\n var channel_id = bytes[i++];\n var channel_type = bytes[i++];\n // BATTERY\n if (channel_id === 0x01 && channel_type === 0x75) {\n decoded.battery = bytes[i];\n i += 1;\n }\n // TEMPERATURE\n else if (channel_id === 0x03 && channel_type === 0x67) {\n // ℃\n decoded.temperature = readInt16LE(bytes.slice(i, i + 2)) / 10;\n i += 2;\n\n // ℉\n // decoded.temperature = readInt16LE(bytes.slice(i, i + 2)) / 10 * 1.8 + 32;\n // i +=2;\n }\n // HUMIDITY\n else if (channel_id === 0x04 && channel_type === 0x68) {\n decoded.humidity = bytes[i] / 2;\n i += 1;\n }\n // PIR\n else if (channel_id === 0x05 && channel_type === 0x6A) {\n decoded.activity = readUInt16LE(bytes.slice(i, i + 2));\n i += 2;\n }\n // LIGHT\n else if (channel_id === 0x06 && channel_type === 0x65) {\n decoded.illumination = readUInt16LE(bytes.slice(i, i + 2));\n decoded.infrared_and_visible = readUInt16LE(bytes.slice(i + 2, i + 4));\n decoded.infrared = readUInt16LE(bytes.slice(i + 4, i + 6));\n i += 6;\n }\n // CO2\n else if (channel_id === 0x07 && channel_type === 0x7D) {\n decoded.co2 = readUInt16LE(bytes.slice(i, i + 2));\n i += 2;\n }\n // TVOC\n else if (channel_id === 0x08 && channel_type === 0x7D) {\n decoded.tvoc = readUInt16LE(bytes.slice(i, i + 2));\n i += 2;\n }\n // PRESSURE\n else if (channel_id === 0x09 && channel_type === 0x73) {\n decoded.pressure = readUInt16LE(bytes.slice(i, i + 2)) / 10;\n i += 2;\n } else {\n break;\n }\n }\n\n return decoded;\n}\n\n/* ******************************************\n* bytes to number\n********************************************/\nfunction readUInt16LE(bytes) {\n var value = (bytes[1] << 8) + bytes[0];\n return value & 0xffff;\n}\n\nfunction readInt16LE(bytes) {\n var ref = readUInt16LE(bytes);\n return ref > 0x7fff ? ref - 0x10000 : ref;\n}\n", + "environment": "javascript", + "storage": "", + "version": "1.0" + }, + "properties": { + "uplink": { + "data": { + "payload": "{{payload}}", + "payload_function": "", + "payload_type": "source_payload", + "resource": "uplink", + "source": "resource", + "update": "events" + }, + "default": { + "source": "value" + }, + "enabled": true + } + } + }, + "_resources": { + "properties": [ + { + "property": "dashboard", + "value": { + "tabs": [ + { + "name": "Environment", + "widgets": [ + { + "layout": { + "col": 0, + "row": 0, + "sizeX": 2, + "sizeY": 5 + }, + "panel": { + "color": "#ffffff", + "currentColor": "#ffffff", + "showOffline": { + "type": "none" + }, + "title": "Temperature" + }, + "properties": { + "decimalPlaces": 2, + "enableExtraTextColor": false, + "enableIconColor": false, + "enableIconSize": false, + "extraText": "", + "extraTextColor": "#1E313E", + "extraTextColorConditions": [], + "extraTextConditions": [], + "extraTextPosition": "above-value", + "extraTextSize": "20px", + "extraTextWeight": "font-light", + "icon": "", + "iconColor": "#1E313E", + "iconColorConditions": [], + "iconConditions": [], + "iconGap": "8px", + "iconPosition": "before-value", + "iconSize": "75px", + "iconVerticalOffset": "0px", + "link": "", + "textAlign": "center", + "textColor": "#1E313E", + "textColorConditions": [], + "textSize": "75px", + "textWeight": "font-light", + "unit": "ºC", + "unitSize": "20px" + }, + "sources": [ + { + "bucket": { + "backend": "mongodb", + "id": "milesight_am107_data", + "mapping": "temperature", + "tags": { + "device": [], + "group": [] + } + }, + "color": "#d1311f", + "name": "Temperature", + "source": "bucket", + "timespan": { + "mode": "latest" + } + } + ], + "type": "text" + }, + { + "layout": { + "col": 0, + "row": 5, + "sizeX": 2, + "sizeY": 5 + }, + "panel": { + "color": "#ffffff", + "currentColor": "#ffffff", + "showOffline": { + "type": "none" + }, + "title": "Humidity" + }, + "properties": { + "decimalPlaces": 2, + "enableExtraTextColor": false, + "enableIconColor": false, + "enableIconSize": false, + "extraText": "", + "extraTextColor": "#1E313E", + "extraTextColorConditions": [], + "extraTextConditions": [], + "extraTextPosition": "above-value", + "extraTextSize": "20px", + "extraTextWeight": "font-light", + "icon": "", + "iconColor": "#1E313E", + "iconColorConditions": [], + "iconConditions": [], + "iconGap": "8px", + "iconPosition": "before-value", + "iconSize": "75px", + "iconVerticalOffset": "0px", + "link": "", + "textAlign": "center", + "textColor": "#1E313E", + "textColorConditions": [], + "textSize": "75px", + "textWeight": "font-light", + "unit": "%", + "unitSize": "20px" + }, + "sources": [ + { + "bucket": { + "backend": "mongodb", + "id": "milesight_am107_data", + "mapping": "humidity", + "tags": { + "device": [], + "group": [] + } + }, + "color": "#329fcd", + "name": "Humidity", + "source": "bucket", + "timespan": { + "mode": "latest" + } + } + ], + "type": "text" + }, + { + "layout": { + "col": 2, + "row": 0, + "sizeX": 4, + "sizeY": 10 + }, + "panel": { + "color": "#ffffff", + "currentColor": "#ffffff", + "showOffline": { + "type": "none" + }, + "title": "Temperature & Humidity (24h)" + }, + "properties": { + "alignTimeSeries": false, + "dataAppend": false, + "options": "var options = {\n chart: {\n type: 'area',\n stacked: false\n },\n dataLabels: {\n enabled: false\n },\n stroke: {\n curve: 'smooth'\n },\n xaxis: {\n type: 'datetime',\n labels: {\n datetimeUTC: false\n },\n tooltip: {\n enabled: false\n }\n },\n yaxis: [\n {\n title: {\n text: 'Temperature (ºC)'\n },\n labels: {\n formatter: function (val) {\n if (val !== null && typeof val !== 'undefined')\n return val.toFixed(2);\n }\n }\n },\n {\n opposite: true,\n title: {\n text: 'Humidity (%)'\n },\n labels: {\n formatter: function (val) {\n if (val !== null && typeof val !== 'undefined')\n return val.toFixed(2);\n }\n }\n }\n ],\n tooltip: {\n x: {\n format: 'dd/MM/yyyy HH:mm:ss'\n }\n }\n};\n", + "realTimeUpdate": true + }, + "sources": [ + { + "aggregation": {}, + "bucket": { + "backend": "mongodb", + "id": "milesight_am107_data", + "mapping": "temperature", + "tags": { + "device": [], + "group": [] + } + }, + "color": "#d1311f", + "name": "Temperature", + "source": "bucket", + "timespan": { + "magnitude": "hour", + "mode": "relative", + "period": "latest", + "value": 24 + } + }, + { + "aggregation": {}, + "bucket": { + "backend": "mongodb", + "id": "milesight_am107_data", + "mapping": "humidity", + "tags": { + "device": [], + "group": [] + } + }, + "color": "#329fcd", + "name": "Humidity", + "source": "bucket", + "timespan": { + "magnitude": "hour", + "mode": "relative", + "period": "latest", + "value": 24 + } + } + ], + "type": "apex_charts" + }, + { + "layout": { + "col": 0, + "row": 10, + "sizeX": 2, + "sizeY": 5 + }, + "panel": { + "color": "#ffffff", + "currentColor": "#ffffff", + "showOffline": { + "type": "none" + }, + "title": "Battery" + }, + "properties": { + "color": "#2ebd59", + "gradient": false, + "max": 100, + "min": 0, + "unit": "%" + }, + "sources": [ + { + "bucket": { + "backend": "mongodb", + "id": "milesight_am107_data", + "mapping": "battery", + "tags": { + "device": [], + "group": [] + } + }, + "color": "#2ebd59", + "name": "Battery", + "source": "bucket", + "timespan": { + "mode": "latest" + } + } + ], + "type": "gauge" + }, + { + "layout": { + "col": 2, + "row": 10, + "sizeX": 4, + "sizeY": 5 + }, + "panel": { + "color": "#ffffff", + "currentColor": "#ffffff", + "showOffline": { + "type": "none" + }, + "title": "Battery (24h)" + }, + "properties": { + "alignTimeSeries": false, + "dataAppend": false, + "options": "var options = {\n chart: {\n type: 'line'\n },\n dataLabels: {\n enabled: false\n },\n stroke: {\n curve: 'smooth'\n },\n xaxis: {\n type: 'datetime',\n labels: {\n datetimeUTC: false\n },\n tooltip: {\n enabled: false\n }\n },\n yaxis: {\n labels: {\n formatter: function (val) {\n if (val !== null && typeof val !== 'undefined')\n return val.toFixed(0);\n }\n }\n },\n tooltip: {\n x: {\n format: 'dd/MM/yyyy HH:mm:ss'\n }\n }\n};\n", + "realTimeUpdate": true + }, + "sources": [ + { + "aggregation": {}, + "bucket": { + "backend": "mongodb", + "id": "milesight_am107_data", + "mapping": "battery", + "tags": { + "device": [], + "group": [] + } + }, + "color": "#2ebd59", + "name": "Battery", + "source": "bucket", + "timespan": { + "magnitude": "hour", + "mode": "relative", + "period": "latest", + "value": 24 + } + } + ], + "type": "apex_charts" + } + ] + }, + { + "name": "Air Quality", + "widgets": [ + { + "layout": { + "col": 0, + "row": 0, + "sizeX": 2, + "sizeY": 5 + }, + "panel": { + "color": "#ffffff", + "currentColor": "#ffffff", + "showOffline": { + "type": "none" + }, + "title": "CO2" + }, + "properties": { + "decimalPlaces": 0, + "enableExtraTextColor": false, + "enableIconColor": false, + "enableIconSize": false, + "extraText": "", + "extraTextColor": "#1E313E", + "extraTextColorConditions": [], + "extraTextConditions": [], + "extraTextPosition": "above-value", + "extraTextSize": "20px", + "extraTextWeight": "font-light", + "icon": "", + "iconColor": "#1E313E", + "iconColorConditions": [], + "iconConditions": [], + "iconGap": "8px", + "iconPosition": "before-value", + "iconSize": "75px", + "iconVerticalOffset": "0px", + "link": "", + "textAlign": "center", + "textColor": "#1E313E", + "textColorConditions": [], + "textSize": "75px", + "textWeight": "font-light", + "unit": "ppm", + "unitSize": "20px" + }, + "sources": [ + { + "bucket": { + "backend": "mongodb", + "id": "milesight_am107_data", + "mapping": "co2", + "tags": { + "device": [], + "group": [] + } + }, + "color": "#e67e22", + "name": "CO2", + "source": "bucket", + "timespan": { + "mode": "latest" + } + } + ], + "type": "text" + }, + { + "layout": { + "col": 0, + "row": 5, + "sizeX": 2, + "sizeY": 5 + }, + "panel": { + "color": "#ffffff", + "currentColor": "#ffffff", + "showOffline": { + "type": "none" + }, + "title": "TVOC" + }, + "properties": { + "decimalPlaces": 0, + "enableExtraTextColor": false, + "enableIconColor": false, + "enableIconSize": false, + "extraText": "", + "extraTextColor": "#1E313E", + "extraTextColorConditions": [], + "extraTextConditions": [], + "extraTextPosition": "above-value", + "extraTextSize": "20px", + "extraTextWeight": "font-light", + "icon": "", + "iconColor": "#1E313E", + "iconColorConditions": [], + "iconConditions": [], + "iconGap": "8px", + "iconPosition": "before-value", + "iconSize": "75px", + "iconVerticalOffset": "0px", + "link": "", + "textAlign": "center", + "textColor": "#1E313E", + "textColorConditions": [], + "textSize": "75px", + "textWeight": "font-light", + "unit": "ppb", + "unitSize": "20px" + }, + "sources": [ + { + "bucket": { + "backend": "mongodb", + "id": "milesight_am107_data", + "mapping": "tvoc", + "tags": { + "device": [], + "group": [] + } + }, + "color": "#9b59b6", + "name": "TVOC", + "source": "bucket", + "timespan": { + "mode": "latest" + } + } + ], + "type": "text" + }, + { + "layout": { + "col": 0, + "row": 10, + "sizeX": 2, + "sizeY": 5 + }, + "panel": { + "color": "#ffffff", + "currentColor": "#ffffff", + "showOffline": { + "type": "none" + }, + "title": "Pressure" + }, + "properties": { + "decimalPlaces": 1, + "enableExtraTextColor": false, + "enableIconColor": false, + "enableIconSize": false, + "extraText": "", + "extraTextColor": "#1E313E", + "extraTextColorConditions": [], + "extraTextConditions": [], + "extraTextPosition": "above-value", + "extraTextSize": "20px", + "extraTextWeight": "font-light", + "icon": "", + "iconColor": "#1E313E", + "iconColorConditions": [], + "iconConditions": [], + "iconGap": "8px", + "iconPosition": "before-value", + "iconSize": "75px", + "iconVerticalOffset": "0px", + "link": "", + "textAlign": "center", + "textColor": "#1E313E", + "textColorConditions": [], + "textSize": "75px", + "textWeight": "font-light", + "unit": "hPa", + "unitSize": "20px" + }, + "sources": [ + { + "bucket": { + "backend": "mongodb", + "id": "milesight_am107_data", + "mapping": "pressure", + "tags": { + "device": [], + "group": [] + } + }, + "color": "#34495e", + "name": "Pressure", + "source": "bucket", + "timespan": { + "mode": "latest" + } + } + ], + "type": "text" + }, + { + "layout": { + "col": 2, + "row": 0, + "sizeX": 4, + "sizeY": 10 + }, + "panel": { + "color": "#ffffff", + "currentColor": "#ffffff", + "showOffline": { + "type": "none" + }, + "title": "CO2 & TVOC (24h)" + }, + "properties": { + "alignTimeSeries": false, + "dataAppend": false, + "options": "var options = {\n chart: {\n type: 'line',\n stacked: false\n },\n dataLabels: {\n enabled: false\n },\n stroke: {\n curve: 'smooth',\n width: 2\n },\n xaxis: {\n type: 'datetime',\n labels: {\n datetimeUTC: false\n },\n tooltip: {\n enabled: false\n }\n },\n yaxis: [\n {\n title: {\n text: 'CO2 (ppm)'\n },\n labels: {\n formatter: function (val) {\n if (val !== null && typeof val !== 'undefined')\n return val.toFixed(0);\n }\n }\n },\n {\n opposite: true,\n title: {\n text: 'TVOC (ppb)'\n },\n labels: {\n formatter: function (val) {\n if (val !== null && typeof val !== 'undefined')\n return val.toFixed(0);\n }\n }\n }\n ],\n tooltip: {\n x: {\n format: 'dd/MM/yyyy HH:mm:ss'\n }\n }\n};\n", + "realTimeUpdate": true + }, + "sources": [ + { + "aggregation": {}, + "bucket": { + "backend": "mongodb", + "id": "milesight_am107_data", + "mapping": "co2", + "tags": { + "device": [], + "group": [] + } + }, + "color": "#e67e22", + "name": "CO2", + "source": "bucket", + "timespan": { + "magnitude": "hour", + "mode": "relative", + "period": "latest", + "value": 24 + } + }, + { + "aggregation": {}, + "bucket": { + "backend": "mongodb", + "id": "milesight_am107_data", + "mapping": "tvoc", + "tags": { + "device": [], + "group": [] + } + }, + "color": "#9b59b6", + "name": "TVOC", + "source": "bucket", + "timespan": { + "magnitude": "hour", + "mode": "relative", + "period": "latest", + "value": 24 + } + } + ], + "type": "apex_charts" + }, + { + "layout": { + "col": 2, + "row": 10, + "sizeX": 4, + "sizeY": 5 + }, + "panel": { + "color": "#ffffff", + "currentColor": "#ffffff", + "showOffline": { + "type": "none" + }, + "title": "Pressure (24h)" + }, + "properties": { + "alignTimeSeries": false, + "dataAppend": false, + "options": "var options = {\n chart: {\n type: 'line'\n },\n dataLabels: {\n enabled: false\n },\n stroke: {\n curve: 'smooth',\n width: 2\n },\n xaxis: {\n type: 'datetime',\n labels: {\n datetimeUTC: false\n },\n tooltip: {\n enabled: false\n }\n },\n yaxis: {\n labels: {\n formatter: function (val) {\n if (val !== null && typeof val !== 'undefined')\n return val.toFixed(1);\n }\n }\n },\n tooltip: {\n x: {\n format: 'dd/MM/yyyy HH:mm:ss'\n }\n }\n};\n", + "realTimeUpdate": true + }, + "sources": [ + { + "aggregation": {}, + "bucket": { + "backend": "mongodb", + "id": "milesight_am107_data", + "mapping": "pressure", + "tags": { + "device": [], + "group": [] + } + }, + "color": "#34495e", + "name": "Pressure", + "source": "bucket", + "timespan": { + "magnitude": "hour", + "mode": "relative", + "period": "latest", + "value": 24 + } + } + ], + "type": "apex_charts" + } + ] + }, + { + "name": "Light & Motion", + "widgets": [ + { + "layout": { + "col": 0, + "row": 0, + "sizeX": 2, + "sizeY": 5 + }, + "panel": { + "color": "#ffffff", + "currentColor": "#ffffff", + "showOffline": { + "type": "none" + }, + "title": "Illumination" + }, + "properties": { + "decimalPlaces": 0, + "enableExtraTextColor": false, + "enableIconColor": false, + "enableIconSize": false, + "extraText": "", + "extraTextColor": "#1E313E", + "extraTextColorConditions": [], + "extraTextConditions": [], + "extraTextPosition": "above-value", + "extraTextSize": "20px", + "extraTextWeight": "font-light", + "icon": "", + "iconColor": "#1E313E", + "iconColorConditions": [], + "iconConditions": [], + "iconGap": "8px", + "iconPosition": "before-value", + "iconSize": "75px", + "iconVerticalOffset": "0px", + "link": "", + "textAlign": "center", + "textColor": "#1E313E", + "textColorConditions": [], + "textSize": "75px", + "textWeight": "font-light", + "unit": "lux", + "unitSize": "20px" + }, + "sources": [ + { + "bucket": { + "backend": "mongodb", + "id": "milesight_am107_data", + "mapping": "illumination", + "tags": { + "device": [], + "group": [] + } + }, + "color": "#f1c40f", + "name": "Illumination", + "source": "bucket", + "timespan": { + "mode": "latest" + } + } + ], + "type": "text" + }, + { + "layout": { + "col": 0, + "row": 5, + "sizeX": 2, + "sizeY": 5 + }, + "panel": { + "color": "#ffffff", + "currentColor": "#ffffff", + "showOffline": { + "type": "none" + }, + "title": "PIR Activity" + }, + "properties": { + "decimalPlaces": 0, + "enableExtraTextColor": false, + "enableIconColor": false, + "enableIconSize": false, + "extraText": "", + "extraTextColor": "#1E313E", + "extraTextColorConditions": [], + "extraTextConditions": [], + "extraTextPosition": "above-value", + "extraTextSize": "20px", + "extraTextWeight": "font-light", + "icon": "", + "iconColor": "#1E313E", + "iconColorConditions": [], + "iconConditions": [], + "iconGap": "8px", + "iconPosition": "before-value", + "iconSize": "75px", + "iconVerticalOffset": "0px", + "link": "", + "textAlign": "center", + "textColor": "#1E313E", + "textColorConditions": [], + "textSize": "75px", + "textWeight": "font-light", + "unit": "events", + "unitSize": "20px" + }, + "sources": [ + { + "bucket": { + "backend": "mongodb", + "id": "milesight_am107_data", + "mapping": "activity", + "tags": { + "device": [], + "group": [] + } + }, + "color": "#27ae60", + "name": "Activity", + "source": "bucket", + "timespan": { + "mode": "latest" + } + } + ], + "type": "text" + }, + { + "layout": { + "col": 2, + "row": 0, + "sizeX": 4, + "sizeY": 10 + }, + "panel": { + "color": "#ffffff", + "currentColor": "#ffffff", + "showOffline": { + "type": "none" + }, + "title": "Illumination (24h)" + }, + "properties": { + "alignTimeSeries": false, + "dataAppend": false, + "options": "var options = {\n chart: {\n type: 'area',\n stacked: false\n },\n dataLabels: {\n enabled: false\n },\n stroke: {\n curve: 'smooth',\n width: 2\n },\n xaxis: {\n type: 'datetime',\n labels: {\n datetimeUTC: false\n },\n tooltip: {\n enabled: false\n }\n },\n yaxis: {\n title: {\n text: 'Light (lux)'\n },\n labels: {\n formatter: function (val) {\n if (val !== null && typeof val !== 'undefined')\n return val.toFixed(0);\n }\n }\n },\n tooltip: {\n x: {\n format: 'dd/MM/yyyy HH:mm:ss'\n }\n },\n fill: {\n type: 'gradient',\n gradient: {\n shadeIntensity: 1,\n opacityFrom: 0.7,\n opacityTo: 0.3\n }\n }\n};\n", + "realTimeUpdate": true + }, + "sources": [ + { + "aggregation": {}, + "bucket": { + "backend": "mongodb", + "id": "milesight_am107_data", + "mapping": "illumination", + "tags": { + "device": [], + "group": [] + } + }, + "color": "#f1c40f", + "name": "Illumination", + "source": "bucket", + "timespan": { + "magnitude": "hour", + "mode": "relative", + "period": "latest", + "value": 24 + } + }, + { + "aggregation": {}, + "bucket": { + "backend": "mongodb", + "id": "milesight_am107_data", + "mapping": "infrared_and_visible", + "tags": { + "device": [], + "group": [] + } + }, + "color": "#e74c3c", + "name": "IR + Visible", + "source": "bucket", + "timespan": { + "magnitude": "hour", + "mode": "relative", + "period": "latest", + "value": 24 + } + }, + { + "aggregation": {}, + "bucket": { + "backend": "mongodb", + "id": "milesight_am107_data", + "mapping": "infrared", + "tags": { + "device": [], + "group": [] + } + }, + "color": "#95a5a6", + "name": "Infrared", + "source": "bucket", + "timespan": { + "magnitude": "hour", + "mode": "relative", + "period": "latest", + "value": 24 + } + } + ], + "type": "apex_charts" + }, + { + "layout": { + "col": 2, + "row": 10, + "sizeX": 4, + "sizeY": 5 + }, + "panel": { + "color": "#ffffff", + "currentColor": "#ffffff", + "showOffline": { + "type": "none" + }, + "title": "PIR Activity (24h)" + }, + "properties": { + "alignTimeSeries": false, + "dataAppend": false, + "options": "var options = {\n chart: {\n type: 'bar'\n },\n dataLabels: {\n enabled: false\n },\n xaxis: {\n type: 'datetime',\n labels: {\n datetimeUTC: false\n },\n tooltip: {\n enabled: false\n }\n },\n yaxis: {\n labels: {\n formatter: function (val) {\n if (val !== null && typeof val !== 'undefined')\n return val.toFixed(0);\n }\n }\n },\n tooltip: {\n x: {\n format: 'dd/MM/yyyy HH:mm:ss'\n }\n }\n};\n", + "realTimeUpdate": true + }, + "sources": [ + { + "aggregation": {}, + "bucket": { + "backend": "mongodb", + "id": "milesight_am107_data", + "mapping": "activity", + "tags": { + "device": [], + "group": [] + } + }, + "color": "#27ae60", + "name": "Activity", + "source": "bucket", + "timespan": { + "magnitude": "hour", + "mode": "relative", + "period": "latest", + "value": 24 + } + } + ], + "type": "apex_charts" + }, + { + "layout": { + "col": 0, + "row": 10, + "sizeX": 2, + "sizeY": 5 + }, + "panel": { + "color": "#ffffff", + "currentColor": "#ffffff", + "showOffline": { + "type": "none" + }, + "title": "Infrared" + }, + "properties": { + "decimalPlaces": 0, + "enableExtraTextColor": false, + "enableIconColor": false, + "enableIconSize": false, + "extraText": "", + "extraTextColor": "#1E313E", + "extraTextColorConditions": [], + "extraTextConditions": [], + "extraTextPosition": "above-value", + "extraTextSize": "18px", + "extraTextWeight": "font-light", + "icon": "", + "iconColor": "#1E313E", + "iconColorConditions": [], + "iconConditions": [], + "iconGap": "8px", + "iconPosition": "before-value", + "iconSize": "60px", + "iconVerticalOffset": "0px", + "link": "", + "textAlign": "center", + "textColor": "#1E313E", + "textColorConditions": [], + "textSize": "60px", + "textWeight": "font-light", + "unit": "lux", + "unitSize": "18px" + }, + "sources": [ + { + "bucket": { + "backend": "mongodb", + "id": "milesight_am107_data", + "mapping": "infrared", + "tags": { + "device": [], + "group": [] + } + }, + "color": "#95a5a6", + "name": "Infrared", + "source": "bucket", + "timespan": { + "mode": "latest" + } + } + ], + "type": "text" + } + ] + } + ] + } + } + ] + } + } + ] + } +} \ No newline at end of file