From b48eb7fa88fcf382dcfd6631d5881a7c7e8538ad Mon Sep 17 00:00:00 2001 From: Liz Cray Date: Mon, 16 Dec 2024 21:22:13 -0500 Subject: [PATCH] WIP prototype --- LICENSE.txt | 21 +++ README.md | 2 + decons-api.json | 429 ++++++++++++++++++++++++++++++++++++++++++++ example.config.json | 23 +++ index.js | 4 + package.json | 15 ++ 6 files changed, 494 insertions(+) create mode 100644 LICENSE.txt create mode 100644 README.md create mode 100644 decons-api.json create mode 100644 example.config.json create mode 100644 index.js create mode 100644 package.json diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..5e53c74 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Elizabeth Cray + +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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..0bad5d6 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# `Dec0ntamination` + diff --git a/decons-api.json b/decons-api.json new file mode 100644 index 0000000..bd4a900 --- /dev/null +++ b/decons-api.json @@ -0,0 +1,429 @@ +{ + "1": { + "config": { + "configured": true, + "on": true, + "sunriseoffset": 30, + "sunsetoffset": -30 + }, + "etag": "3cb5d1b086eae04ee0b0de75db5aae56", + "manufacturername": "Philips", + "modelid": "PHDL00", + "name": "Daylight", + "state": { + "dark": true, + "daylight": false, + "lastupdated": "2024-12-16T23:25:15.812", + "status": 230, + "sunrise": "2024-12-16T12:22:55", + "sunset": "2024-12-16T21:49:01" + }, + "swversion": "1.0", + "type": "Daylight", + "uniqueid": "00:21:2e:ff:ff:0e:53:ba-01" + }, + "10": { + "config": { + "battery": 0, + "offset": 0, + "on": true, + "reachable": false + }, + "ep": 1, + "etag": "ba0d365520b4b5ee5a4b271c8951dbae", + "lastannounced": null, + "lastseen": "2024-12-14T02:12Z", + "manufacturername": "LUMI", + "modelid": "lumi.weather", + "name": "Gantry Sensor", + "state": { + "humidity": 4341, + "lastupdated": "2024-10-15T01:39:20.620" + }, + "swversion": "0.0.0_0005", + "type": "ZHAHumidity", + "uniqueid": "00:15:8d:00:8b:11:04:bf-01-0405" + }, + "11": { + "config": { + "battery": 0, + "offset": 0, + "on": true, + "reachable": false + }, + "ep": 1, + "etag": "71c01da7a56608800e3b9491fea7cd35", + "lastannounced": null, + "lastseen": "2024-12-14T02:12Z", + "manufacturername": "LUMI", + "modelid": "lumi.weather", + "name": "Gantry Sensor", + "state": { + "lastupdated": "2024-10-15T01:39:20.636", + "pressure": 1006 + }, + "swversion": "0.0.0_0005", + "type": "ZHAPressure", + "uniqueid": "00:15:8d:00:8b:11:04:bf-01-0403" + }, + "12": { + "config": { + "battery": 100, + "offset": 0, + "on": true, + "reachable": true + }, + "ep": 1, + "etag": "4a70d4e90337e257df42213e69fa0b9e", + "lastannounced": null, + "lastseen": "2024-12-16T23:38Z", + "manufacturername": "LUMI", + "modelid": "lumi.weather", + "name": "lumi.weather", + "state": { + "lastupdated": "2024-12-16T23:38:01.353", + "temperature": 2161 + }, + "swversion": "0.0.0_0005", + "type": "ZHATemperature", + "uniqueid": "00:15:8d:00:8b:11:52:80-01-0402" + }, + "13": { + "config": { + "battery": 100, + "offset": 0, + "on": true, + "reachable": true + }, + "ep": 1, + "etag": "8adbf9da29ad11e1d7e20e42d25a7545", + "lastannounced": null, + "lastseen": "2024-12-16T23:38Z", + "manufacturername": "LUMI", + "modelid": "lumi.weather", + "name": "Humidity 13", + "state": { + "humidity": 3925, + "lastupdated": "2024-12-16T23:38:01.370" + }, + "swversion": "0.0.0_0005", + "type": "ZHAHumidity", + "uniqueid": "00:15:8d:00:8b:11:52:80-01-0405" + }, + "14": { + "config": { + "battery": 100, + "offset": 0, + "on": true, + "reachable": true + }, + "ep": 1, + "etag": "7718ada5c54f6203146dce76b0c9843c", + "lastannounced": null, + "lastseen": "2024-12-16T23:38Z", + "manufacturername": "LUMI", + "modelid": "lumi.weather", + "name": "Pressure 14", + "state": { + "lastupdated": "2024-12-16T23:38:01.385", + "pressure": 1016 + }, + "swversion": "0.0.0_0005", + "type": "ZHAPressure", + "uniqueid": "00:15:8d:00:8b:11:52:80-01-0403" + }, + "15": { + "config": { + "alert": "none", + "battery": 90, + "on": true, + "reachable": true + }, + "ep": 1, + "etag": "86c358ee17d41f2d2041220ecf71aaaf", + "lastannounced": null, + "lastseen": "2024-12-16T23:16Z", + "manufacturername": "IKEA of Sweden", + "mode": 1, + "modelid": "Remote Control N2", + "name": "Remote Control N2", + "productid": "E2002", + "state": { + "buttonevent": 2002, + "lastupdated": "2024-12-14T16:51:00.643" + }, + "swversion": "2.4.5", + "type": "ZHASwitch", + "uniqueid": "60:b6:47:ff:fe:da:c5:9a-01-1000" + }, + "16": { + "config": { + "alert": "none", + "battery": 86, + "delay": 20, + "group": "20000", + "on": true, + "reachable": true + }, + "ep": 2, + "etag": "c9ca0728b16f0e6213df3399027aa8d2", + "lastannounced": null, + "lastseen": "2024-12-16T23:46Z", + "manufacturername": "IKEA of Sweden", + "modelid": "VALLHORN Wireless Motion Sensor", + "name": "VALLHORN Wireless Motion Sensor", + "productid": "E2134", + "productname": "Vallhorn presence sensor", + "state": { + "lastupdated": "2024-12-16T23:47:21.195", + "presence": false + }, + "swversion": "1.0.64", + "type": "ZHAPresence", + "uniqueid": "ec:f6:4c:ff:fe:45:14:74-02-0406" + }, + "17": { + "config": { + "alert": "none", + "battery": 86, + "on": true, + "reachable": true, + "tholddark": 12000, + "tholdoffset": 7000 + }, + "ep": 2, + "etag": "24ec1371b2d96fa1a69d9daee8ab1cf5", + "lastannounced": null, + "lastseen": "2024-12-16T23:46Z", + "manufacturername": "IKEA of Sweden", + "modelid": "VALLHORN Wireless Motion Sensor", + "name": "LightLevel 17", + "productname": "Vallhorn light sensor", + "state": { + "dark": false, + "daylight": false, + "lastupdated": "2024-12-16T23:46:55.871", + "lightlevel": 13979, + "lux": 25 + }, + "swversion": "1.0.64", + "type": "ZHALightLevel", + "uniqueid": "ec:f6:4c:ff:fe:45:14:74-02-0400" + }, + "18": { + "config": { + "duration": 60, + "on": true, + "reachable": true + }, + "etag": "276c412778404a53b07990dda6684b05", + "manufacturername": "Phoscon", + "modelid": "PHOSCON_VPIR", + "name": "VPIR PIR-Motion Detected", + "state": { + "lastupdated": "2024-12-16T23:37:24.313", + "presence": false + }, + "swversion": "1.0", + "type": "CLIPPresence", + "uniqueid": "vpir-1730675210681" + }, + "19": { + "config": { + "on": true, + "reachable": true + }, + "etag": "c8a5ad0393286a78c723abcd101ef5c6", + "manufacturername": "Phoscon", + "modelid": "PHOSCON_FSM_STATE", + "name": "FSM_STATE PIR-Motion Detected", + "state": { + "lastupdated": "2024-12-16T23:39:25.313", + "status": 0 + }, + "swversion": "1.0", + "type": "CLIPGenericStatus", + "uniqueid": "fsm-state-1730675210681" + }, + "2": { + "config": { + "mode": "sunset", + "offset": 0, + "on": true, + "reachable": true + }, + "etag": "725c26278a25172da0e800e337f01a00", + "manufacturername": "Phoscon", + "modelid": "DLOFFSET1211", + "name": "Offset Ref P-SS", + "state": { + "lastupdated": "2024-12-16T05:10:05.812", + "localtime": "2024-12-16T16:49:01" + }, + "swversion": "1.0", + "type": "CLIPDaylightOffset", + "uniqueid": "AB:30:F8:4B-C7E4-2E28-8694-5F:5F:73:81:03:39" + }, + "20": { + "config": { + "on": true, + "reachable": true + }, + "etag": "c9ca0728b16f0e6213df3399027aa8d2", + "manufacturername": "Phoscon", + "modelid": "Motion Detected_CLIPGenericFlag_CLIPPresence", + "name": "VSen_CLIPPresence_Motion Detected", + "state": { + "flag": false, + "lastupdated": "2024-12-16T23:47:21.195" + }, + "swversion": "1.0", + "type": "CLIPGenericFlag", + "uniqueid": "vSen-1730675238128" + }, + "3": { + "config": { + "mode": "sunrise", + "offset": 0, + "on": true, + "reachable": true + }, + "etag": "484cd31e2377a36774cf21a1bcbd0a79", + "manufacturername": "Phoscon", + "modelid": "DLOFFSET2100", + "name": "Offset Ref P-SR", + "state": { + "lastupdated": "2024-12-16T05:10:35.813", + "localtime": "2024-12-16T07:22:55" + }, + "swversion": "1.0", + "type": "CLIPDaylightOffset", + "uniqueid": "D6:32:DB:82-0CB4-7262-84C9-61:D3:57:F3:FE:64" + }, + "4": { + "config": { + "mode": "sunset", + "offset": -392, + "on": true, + "reachable": true + }, + "etag": "d7d3cd7bc958d8df033541fdb42e6d5b", + "manufacturername": "Phoscon", + "modelid": "DLOFFSET2112", + "name": "Offset Ref P10002", + "state": { + "lastupdated": "2024-12-16T05:10:15.813", + "localtime": "2024-12-16T10:17:01" + }, + "swversion": "1.0", + "type": "CLIPDaylightOffset", + "uniqueid": "3B:FD:76:20-EC05-1E9C-BBDC-E8:E1:48:86:19:F3" + }, + "5": { + "config": { + "mode": "sunset", + "offset": 167, + "on": true, + "reachable": true + }, + "etag": "2051531b7bd6e5761f154102b954d15d", + "manufacturername": "Phoscon", + "modelid": "DLOFFSET1002", + "name": "Offset Ref P200", + "state": { + "lastupdated": "2024-12-16T05:10:45.812", + "localtime": "2024-12-16T19:36:01" + }, + "swversion": "1.0", + "type": "CLIPDaylightOffset", + "uniqueid": "8E:3E:86:90-78E7-E4BD-BE13-CE:E9:F1:92:DC:33" + }, + "6": { + "config": { + "battery": 85, + "offset": 0, + "on": true, + "reachable": false + }, + "ep": 1, + "etag": "d9651d3bc6eb16709fb30473b907d7fa", + "lastannounced": "2024-12-14T02:37:27Z", + "lastseen": "2024-12-14T03:18Z", + "manufacturername": "LUMI", + "modelid": "lumi.weather", + "name": "Server Bathroom", + "state": { + "lastupdated": "2024-12-14T03:18:41.381", + "temperature": 1417 + }, + "swversion": "0.0.0_0005", + "type": "ZHATemperature", + "uniqueid": "00:15:8d:00:8b:11:04:f3-01-0402" + }, + "7": { + "config": { + "battery": 85, + "offset": 0, + "on": true, + "reachable": false + }, + "ep": 1, + "etag": "d9651d3bc6eb16709fb30473b907d7fa", + "lastannounced": "2024-12-14T02:37:27Z", + "lastseen": "2024-12-14T03:18Z", + "manufacturername": "LUMI", + "modelid": "lumi.weather", + "name": "Server Bathroom", + "state": { + "humidity": 3555, + "lastupdated": "2024-12-14T03:18:41.397" + }, + "swversion": "0.0.0_0005", + "type": "ZHAHumidity", + "uniqueid": "00:15:8d:00:8b:11:04:f3-01-0405" + }, + "8": { + "config": { + "battery": 85, + "offset": 0, + "on": true, + "reachable": false + }, + "ep": 1, + "etag": "d9651d3bc6eb16709fb30473b907d7fa", + "lastannounced": "2024-12-14T02:37:27Z", + "lastseen": "2024-12-14T03:18Z", + "manufacturername": "LUMI", + "modelid": "lumi.weather", + "name": "Server Bathroom", + "state": { + "lastupdated": "2024-12-14T03:18:41.413", + "pressure": 1034 + }, + "swversion": "0.0.0_0005", + "type": "ZHAPressure", + "uniqueid": "00:15:8d:00:8b:11:04:f3-01-0403" + }, + "9": { + "config": { + "battery": 0, + "offset": 0, + "on": true, + "reachable": false + }, + "ep": 1, + "etag": "ba0d365520b4b5ee5a4b271c8951dbae", + "lastannounced": null, + "lastseen": "2024-12-14T02:12Z", + "manufacturername": "LUMI", + "modelid": "lumi.weather", + "name": "Gantry Sensor", + "state": { + "lastupdated": "2024-10-15T01:39:20.604", + "temperature": 2356 + }, + "swversion": "0.0.0_0005", + "type": "ZHATemperature", + "uniqueid": "00:15:8d:00:8b:11:04:bf-01-0402" + } +} diff --git a/example.config.json b/example.config.json new file mode 100644 index 0000000..cd6fa90 --- /dev/null +++ b/example.config.json @@ -0,0 +1,23 @@ +{ + "servers": { + "deconz": { + "url": "http://zigbee.hacdcserver.org", + "apiKey": "", + "clientName": "dec0ntaminator" + }, + "influx": { + "url": "http://influx.hacdc.org", + "apiKey": "", + "bucket": "" + } + }, + "devices": [ + { + "name": "", + "uniqueId": "", + "valueKey": "", + "valueModifier": "1", + "unit": "" + } + ] +} diff --git a/index.js b/index.js new file mode 100644 index 0000000..0864347 --- /dev/null +++ b/index.js @@ -0,0 +1,4 @@ + + +const config = JSON.parse(fs.readFileSync('config.json', 'utf8')); + diff --git a/package.json b/package.json new file mode 100644 index 0000000..492e5df --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "name": "dec0ntamination", + "version": "1.0.0", + "description": "Deconz sensor to InfluxDB uploader", + "main": "index.js", + "scripts": { + "test": "node index.js" + }, + "repository": { + "type": "git", + "url": "https://git.corrupt.link/liz/dec0ntamination" + }, + "author": "Liz Cray", + "license": "MIT" +}