diff --git a/.DS_Store b/.DS_Store index 83bf3a8..ab3ef46 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/README.md b/README.md index 7fffc45..60c2e12 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,6 @@ If you like my work, please feel free to provide a personal donation ## Changelog ### __WORK IN PROGRESS__ - Initialization error for Nano V1 solved * (DutchmanNL) Initialization error for Nano V1 solved - -### 0.2.1-alpha.0 (2022-06-05) - Error logging and reporting improved * (DutchmanNL) Error logging and reporting improved ### 0.2.0 (2022-06-04) - PitMaster Control & ESP32 support diff --git a/admin/.DS_Store b/admin/.DS_Store new file mode 100644 index 0000000..feca861 Binary files /dev/null and b/admin/.DS_Store differ diff --git a/admin/src/.DS_Store b/admin/src/.DS_Store new file mode 100644 index 0000000..6da6e2e Binary files /dev/null and b/admin/src/.DS_Store differ diff --git a/build/main.js b/build/main.js index b1674a8..0aea865 100644 --- a/build/main.js +++ b/build/main.js @@ -127,37 +127,39 @@ class WlanthermoNano extends utils.Adapter { this.subscribeStates(`${sensorRoot}.${key}`); } } - const pitmaster = activeDevices[deviceIP].data.pitmaster; - for (let i2 = 0; i2 < pitmaster.pm.length; i2++) { - const stateRoot = `${serial}.Pitmaster.Pitmaster_${1 + i2}`; - this.log.debug(`Create Pitmaster states ${stateRoot}`); - await this.setObjectNotExistsAsync(stateRoot, { - type: "channel", - common: { - name: "Pitmaster" - }, - native: {} - }); - for (const [key, value] of Object.entries(pitmaster.pm[i2])) { - if (key === "typ") { - await this.setObjectAndState(`${stateRoot}`, `modus`, value); - } else if (key === "pid") { - await this.setObjectAndState(`${stateRoot}`, `${key}`, value); - } else if (key === "id") { - const pidProfiles = {}; - for (const profile in activeDevices[deviceIP].settings.pid) { - pidProfiles[profile] = activeDevices[deviceIP].settings.pid[profile].name; + if (activeDevices[deviceIP].data.pitmaster != null) { + const pitmaster = activeDevices[deviceIP].data.pitmaster; + for (let i2 = 0; i2 < pitmaster.pm.length; i2++) { + const stateRoot = `${serial}.Pitmaster.Pitmaster_${1 + i2}`; + this.log.debug(`Create Pitmaster states ${stateRoot}`); + await this.setObjectNotExistsAsync(stateRoot, { + type: "channel", + common: { + name: "Pitmaster" + }, + native: {} + }); + for (const [key, value] of Object.entries(pitmaster.pm[i2])) { + if (key === "typ") { + await this.setObjectAndState(`${stateRoot}`, `modus`, value); + } else if (key === "pid") { + await this.setObjectAndState(`${stateRoot}`, `${key}`, value); + } else if (key === "id") { + const pidProfiles = {}; + for (const profile in activeDevices[deviceIP].settings.pid) { + pidProfiles[profile] = activeDevices[deviceIP].settings.pid[profile].name; + } + await this.setObjectAndState(`${stateRoot}`, `${key}`, value, pidProfiles); + } else { + await this.setObjectAndState(`${stateRoot}`, `${key}`, value); } - await this.setObjectAndState(`${stateRoot}`, `${key}`, value, pidProfiles); - } else { - await this.setObjectAndState(`${stateRoot}`, `${key}`, value); } } + this.setState(`${activeDevices[deviceIP].settings.device.serial}.Info.connected`, { + val: true, + ack: true + }); } - this.setState(`${activeDevices[deviceIP].settings.device.serial}.Info.connected`, { - val: true, - ack: true - }); } } } catch (error) { @@ -204,24 +206,28 @@ class WlanthermoNano extends utils.Adapter { this.log.debug(`Create device settings state ${activeDevices[device.ip].settings.device.serial}.Info.${i} | ${response_settings.data.device[i]}`); await this.setObjectAndState(`${activeDevices[device.ip].settings.device.serial}.Info`, `${i}`, `${response_settings.data.device[i]}`); } - for (const [key, value] of Object.entries(activeDevices[device.ip].settings.features)) { - this.log.debug(`Create feature state ${activeDevices[device.ip].settings.device.serial}.features.${key} | ${value}`); - await this.setObjectAndState(`${activeDevices[device.ip].settings.device.serial}.Features`, `${key}`, value); + if (activeDevices[device.ip].settings.features != null) { + for (const [key, value] of Object.entries(activeDevices[device.ip].settings.features)) { + this.log.debug(`Create feature state ${activeDevices[device.ip].settings.device.serial}.features.${key} | ${value}`); + await this.setObjectAndState(`${activeDevices[device.ip].settings.device.serial}.Features`, `${key}`, value); + } } - const pidProfile = activeDevices[device.ip].settings.pid; - for (let i = 0; i < pidProfile.length; i++) { - const sensorRoot = `${activeDevices[device.ip].settings.device.serial}.Pitmaster.Profiles.Profile_${1 + +i}`; - this.log.debug(`Create profile states ${sensorRoot}`); - await this.setObjectNotExistsAsync(sensorRoot, { - type: "channel", - common: { - name: pidProfile[i].name - }, - native: {} - }); - for (const [key, value] of Object.entries(pidProfile[i])) { - await this.setObjectAndState(`${sensorRoot}`, `${key}`, value); - this.subscribeStates(`${sensorRoot}.${key}`); + if (activeDevices[device.ip].settings.pid != null) { + const pidProfile = activeDevices[device.ip].settings.pid; + for (let i = 0; i < pidProfile.length; i++) { + const sensorRoot = `${activeDevices[device.ip].settings.device.serial}.Pitmaster.Profiles.Profile_${1 + +i}`; + this.log.debug(`Create profile states ${sensorRoot}`); + await this.setObjectNotExistsAsync(sensorRoot, { + type: "channel", + common: { + name: pidProfile[i].name + }, + native: {} + }); + for (const [key, value] of Object.entries(pidProfile[i])) { + await this.setObjectAndState(`${sensorRoot}`, `${key}`, value); + this.subscribeStates(`${sensorRoot}.${key}`); + } } } this.log.info(`${ip} Connected, refreshing data every ${activeDevices[device.ip].basicInfo.interval} seconds`); diff --git a/build/main.js.map b/build/main.js.map index f68fdb7..96b7eaf 100644 --- a/build/main.js.map +++ b/build/main.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../src/main.ts"], - "sourcesContent": ["/*\n * Created with @iobroker/create-adapter v2.1.1\n */\n\n// The adapter-core module gives you access to the core ioBroker functions\n// you need to create an adapter\nimport * as utils from '@iobroker/adapter-core';\n\n// Load your modules here, e.g.:\n// import * as fs from \"fs\";\nimport axios from 'axios'; // Load Axios module to allow handle http get & post\nimport { MyObjectsDefinitions, BasicStates, buildCommon } from './lib/stateDefinitions';\n\nconst activeDevices: activeDevices = {};\nconst polling: { [key: string]: object } = {};\nconst ipSerialMapping: { [key: string]: { ip: string } } = {};\nconst createdObjs: string[] = [];\nlet initializing = true;\n\nclass WlanthermoNano extends utils.Adapter {\n\tpublic constructor(options: Partial = {}) {\n\t\tsuper({\n\t\t\t...options,\n\t\t\tname: 'wlanthermo-nano',\n\t\t});\n\t\tthis.on('ready', this.onReady.bind(this));\n\t\tthis.on('stateChange', this.onStateChange.bind(this));\n\t\tthis.on('unload', this.onUnload.bind(this));\n\t}\n\n\t/**\n\t * Is called when databases are connected and adapter received configuration.\n\t */\n\tprivate async onReady(): Promise {\n\t\tthis.setState('info.connection', false, true);\n\t\tconst devices: DeviceList = this.config.deviceList;\n\t\tthis.log.info(`WLANThermo startet, loading ${devices.length} devices`);\n\t\tthis.log.debug(`Configured devices ${devices}`);\n\n\t\t// Connect to all devices configured in Adapter Instance\n\t\tlet amountConnected = 0;\n\t\tfor (const device in devices) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t//@ts-expect-error \n\t\t\tactiveDevices[devices[device].ip] = {};\n\t\t\tactiveDevices[devices[device].ip].basicInfo = devices[device];\n\t\t\tactiveDevices[devices[device].ip].initialised = false;\n\t\t\t// Start interval\n\t\t\tawait this.getDeviceData(devices[device].ip);\n\t\t\tif (activeDevices[devices[device].ip].initialised) {\n\t\t\t\tamountConnected = amountConnected + 1;\n\t\t\t}\n\t\t}\n\n\t\t// Adapter ready\n\t\tinitializing = false;\n\t\tthis.log.info(`WLANThermo ready, ${amountConnected} device(s) connected`);\n\t\tthis.setState('info.connection', true, true);\n\t}\n\n\tprivate async getDeviceData(deviceIP: string): Promise {\n\t\ttry {\n\t\t\tif (\n\t\t\t\tactiveDevices[deviceIP] == null ||\n\t\t\t\tactiveDevices[deviceIP].deviceURL == null ||\n\t\t\t\t!activeDevices[deviceIP].initialised\n\t\t\t) {\n\t\t\t\tthis.log.debug(`${deviceIP} not initialised, try to connect`);\n\t\t\t\tawait this.initialiseDevice(deviceIP);\n\t\t\t} else {\n\t\t\t\tthis.log.debug(`${deviceIP} initialised, update data`);\n\t\t\t\tconst response_deviceData = await axios(activeDevices[deviceIP].deviceURL + '/data', { timeout: 5000 });\n\t\t\t\tactiveDevices[deviceIP].data = response_deviceData.data;\n\t\t\t\tthis.log.debug(`${deviceIP} data | ${JSON.stringify(response_deviceData.data)}`);\n\t\t\t\tconst serial: string = activeDevices[deviceIP].settings.device.serial;\n\n\t\t\t\t// Write states for configuration channel\n\t\t\t\tfor (const [key, value] of Object.entries(activeDevices[deviceIP].data.system)) {\n\t\t\t\t\tthis.log.debug(`Create configuration state ${serial}.Configuration.${key} | ${value}`);\n\t\t\t\t\tawait this.setObjectAndState(`${serial}.Configuration`, `${key}`, value);\n\t\t\t\t}\n\n\t\t\t\t// Read all sensor related settings and write to states\n\t\t\t\tconst channel = activeDevices[deviceIP].data.channel;\n\t\t\t\tfor (let i = 0; i < channel.length; i++) {\n\t\t\t\t\tconst sensorRoot = `${serial}.Sensors.Sensor_${1 + +i}`;\n\t\t\t\t\tthis.log.debug(`Create sensor states ${sensorRoot}`);\n\t\t\t\t\tawait this.setObjectNotExistsAsync(sensorRoot, {\n\t\t\t\t\t\ttype: 'channel',\n\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\tname: channel[i].name,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnative: {},\n\t\t\t\t\t});\n\n\t\t\t\t\t// Load available sensor types\n\t\t\t\t\tconst sensorTypes: { [key: string]: string } = {};\n\t\t\t\t\tfor (const sensor in activeDevices[deviceIP].settings.sensors) {\n\t\t\t\t\t\tsensorTypes[sensor] = activeDevices[deviceIP].settings.sensors[sensor].name;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Write states for temperature sensors\n\t\t\t\t\tfor (const [key, value] of Object.entries(channel[i])) {\n\t\t\t\t\t\tswitch (key) {\n\t\t\t\t\t\t\tcase 'typ':\n\t\t\t\t\t\t\t\tawait this.setObjectAndState(`${sensorRoot}`, `${key}`, value, sensorTypes);\n\t\t\t\t\t\t\t\tthis.subscribeStates(`${sensorRoot}.${key}`);\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'alarm':\n\t\t\t\t\t\t\t\tawait this.setObjectAndState(`${sensorRoot}`, `${key}`, value, {\n\t\t\t\t\t\t\t\t\t'0': 'Disabled',\n\t\t\t\t\t\t\t\t\t'1': 'Push-Only',\n\t\t\t\t\t\t\t\t\t'2': 'Speaker-Only',\n\t\t\t\t\t\t\t\t\t'4': 'Push & Speaker',\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'temp':\n\t\t\t\t\t\t\t\tawait this.setObjectAndState(`${sensorRoot}`, `${key}`, null);\n\t\t\t\t\t\t\t\tif (channel[i][key] !== 999) {\n\t\t\t\t\t\t\t\t\tthis.setState(`${sensorRoot}.${key}`, {\n\t\t\t\t\t\t\t\t\t\tval: channel[i][key],\n\t\t\t\t\t\t\t\t\t\tack: true,\n\t\t\t\t\t\t\t\t\t\texpire: activeDevices[deviceIP].basicInfo.interval * 2000,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tthis.setState(`${sensorRoot}.${key}`, { val: null, ack: true });\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tawait this.setObjectAndState(`${sensorRoot}`, `${key}`, value);\n\t\t\t\t\t\t\t\tthis.subscribeStates(`${sensorRoot}.${key}`);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Write states for pitmaster\n\t\t\t\t\tconst pitmaster = activeDevices[deviceIP].data.pitmaster;\n\t\t\t\t\tfor (let i = 0; i < pitmaster.pm.length; i++) {\n\t\t\t\t\t\tconst stateRoot = `${serial}.Pitmaster.Pitmaster_${1 + i}`;\n\t\t\t\t\t\tthis.log.debug(`Create Pitmaster states ${stateRoot}`);\n\t\t\t\t\t\tawait this.setObjectNotExistsAsync(stateRoot, {\n\t\t\t\t\t\t\ttype: 'channel',\n\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\tname: 'Pitmaster',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tfor (const [key, value] of Object.entries(pitmaster.pm[i])) {\n\t\t\t\t\t\t\tif (key === 'typ') {\n\t\t\t\t\t\t\t\tawait this.setObjectAndState(`${stateRoot}`, `modus`, value);\n\t\t\t\t\t\t\t\t// Subscribe on state\n\t\t\t\t\t\t\t\t// this.subscribeStates(`${stateRoot}.modus`);\n\t\t\t\t\t\t\t} else if (key === 'pid') {\n\t\t\t\t\t\t\t\tawait this.setObjectAndState(`${stateRoot}`, `${key}`, value);\n\t\t\t\t\t\t\t\t// Subscribe on state\n\t\t\t\t\t\t\t\t// this.subscribeStates(`${stateRoot}.${y}`);\n\t\t\t\t\t\t\t} else if (key === 'id') {\n\t\t\t\t\t\t\t\tconst pidProfiles: { [key: string]: string } = {};\n\t\t\t\t\t\t\t\tfor (const profile in activeDevices[deviceIP].settings.pid) {\n\t\t\t\t\t\t\t\t\tpidProfiles[profile] = activeDevices[deviceIP].settings.pid[profile].name;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tawait this.setObjectAndState(`${stateRoot}`, `${key}`, value, pidProfiles);\n\t\t\t\t\t\t\t\t// ignore set_color\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tawait this.setObjectAndState(`${stateRoot}`, `${key}`, value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.setState(`${activeDevices[deviceIP].settings.device.serial}.Info.connected`, {\n\t\t\t\t\t\tval: true,\n\t\t\t\t\t\tack: true,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthis.errorHandler(`[getDeviceData]`, error, true);\n\t\t\tif (activeDevices[deviceIP].initialised) {\n\t\t\t\tthis.log.warn(`${deviceIP} Connection lost, will try to reconnect`);\n\t\t\t}\n\t\t\tactiveDevices[deviceIP].initialised = false;\n\t\t\ttry {\n\t\t\t\tthis.setState(`${activeDevices[deviceIP].settings.device.serial}.Info.connected`, {\n\t\t\t\t\tval: false,\n\t\t\t\t\tack: true,\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(error);\n\t\t\t}\n\t\t}\n\n\t\t// Clear running timer\n\t\tif (polling[deviceIP]) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t// @ts-ignore\n\t\t\tclearTimeout(polling[deviceIP]);\n\t\t\tpolling[deviceIP] = {};\n\t\t}\n\n\t\t// Timer to reload data\n\t\tthis.log.debug(`${deviceIP} Timer triggered`);\n\t\tpolling[deviceIP] = setTimeout(() => {\n\t\t\tthis.log.debug(`${deviceIP} Timer executed`);\n\t\t\tthis.getDeviceData(deviceIP);\n\t\t}, activeDevices[deviceIP].basicInfo.interval * 1000);\n\t}\n\n\tprivate async initialiseDevice(ip: string): Promise {\n\t\ttry {\n\t\t\tconst device: Device = activeDevices[ip].basicInfo;\n\t\t\tconst url = `http://${device.username}:${device.password}@${device.ip}`;\n\n\t\t\t// Get Device Settings\n\t\t\tconst response_settings = await axios(url + '/settings', { timeout: 5000 });\n\t\t\tif (response_settings == null || response_settings.data == null) return;\n\t\t\tthis.log.debug(`${ip} data | ${JSON.stringify(response_settings.data)}`);\n\t\t\tconst responseData: DeviceSettings = response_settings.data;\n\t\t\t// Store all data into memory\n\t\t\tactiveDevices[device.ip].deviceURL = url;\n\t\t\tactiveDevices[device.ip].settings = responseData;\n\t\t\tactiveDevices[device.ip].initialised = true;\n\t\t\tipSerialMapping[activeDevices[device.ip].settings.device.serial] = { ip: device.ip };\n\n\t\t\tthis.log.debug(`${ip} memory cache | ${JSON.stringify(activeDevices[device.ip])}`);\n\n\t\t\t// Create channels\n\t\t\tawait this.deviceStructures(activeDevices[device.ip].settings.device.serial, device.ip);\n\t\t\t// Create States for device settings\n\t\t\tfor (const i in response_settings.data.device) {\n\t\t\t\tthis.log.debug(\n\t\t\t\t\t`Create device settings state ${activeDevices[device.ip].settings.device.serial}.Info.${i} | ${\n\t\t\t\t\t\tresponse_settings.data.device[i]\n\t\t\t\t\t}`,\n\t\t\t\t);\n\t\t\t\tawait this.setObjectAndState(\n\t\t\t\t\t`${activeDevices[device.ip].settings.device.serial}.Info`,\n\t\t\t\t\t`${i}`,\n\t\t\t\t\t`${response_settings.data.device[i]}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Create states for features channel\n\t\t\tfor (const [key, value] of Object.entries(activeDevices[device.ip].settings.features)) {\n\t\t\t\tthis.log.debug(\n\t\t\t\t\t`Create feature state ${\n\t\t\t\t\t\tactiveDevices[device.ip].settings.device.serial\n\t\t\t\t\t}.features.${key} | ${value}`,\n\t\t\t\t);\n\t\t\t\tawait this.setObjectAndState(\n\t\t\t\t\t`${activeDevices[device.ip].settings.device.serial}.Features`,\n\t\t\t\t\t`${key}`,\n\t\t\t\t\tvalue,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Create states for PID Profile\n\t\t\tconst pidProfile = activeDevices[device.ip].settings.pid;\n\t\t\tfor (let i = 0; i < pidProfile.length; i++) {\n\t\t\t\tconst sensorRoot = `${activeDevices[device.ip].settings.device.serial}.Pitmaster.Profiles.Profile_${\n\t\t\t\t\t1 + +i\n\t\t\t\t}`;\n\t\t\t\tthis.log.debug(`Create profile states ${sensorRoot}`);\n\t\t\t\tawait this.setObjectNotExistsAsync(sensorRoot, {\n\t\t\t\t\ttype: 'channel',\n\t\t\t\t\tcommon: {\n\t\t\t\t\t\tname: pidProfile[i].name,\n\t\t\t\t\t},\n\t\t\t\t\tnative: {},\n\t\t\t\t});\n\n\t\t\t\t// Write states for PID profiles\n\t\t\t\tfor (const [key, value] of Object.entries(pidProfile[i])) {\n\t\t\t\t\tawait this.setObjectAndState(`${sensorRoot}`, `${key}`, value);\n\t\t\t\t\tthis.subscribeStates(`${sensorRoot}.${key}`);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.log.info(\n\t\t\t\t`${ip} Connected, refreshing data every ${activeDevices[device.ip].basicInfo.interval} seconds`,\n\t\t\t);\n\t\t\tthis.getDeviceData(ip);\n\t\t} catch (error) {\n\t\t\tthis.errorHandler(`[initialiseDevice]`, error, true);\n\t\t\tif (initializing) {\n\t\t\t\tthis.log.warn(`${ip} Connection failed, will try again later ${error}`);\n\t\t\t}\n\t\t\tactiveDevices[ip].initialised = false;\n\t\t}\n\t}\n\n\tprivate async deviceStructures(serial: string, ip: string): Promise {\n\t\ttry {\n\t\t\tthis.createDevice(serial, {\n\t\t\t\tname: activeDevices[ip].settings.system.host,\n\t\t\t});\n\n\t\t\tfor (const object in BasicStates) {\n\t\t\t\tthis.log.debug(`Create basic state ${serial}.${object}`);\n\t\t\t\tawait this.setObjectAndState(`${serial}`, `${object}`, null);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthis.errorHandler(`[deviceStructures]`, error);\n\t\t}\n\t}\n\n\tprivate async setObjectAndState(\n\t\trootDIR: string,\n\t\tstateName: string,\n\t\tvalue: any | null,\n\t\tstateDropDown?: { [key: string]: string },\n\t): Promise {\n\t\ttry {\n\t\t\tlet obj: MyObjectsDefinitions = BasicStates[stateName];\n\n\t\t\tif (!obj) {\n\t\t\t\tobj = buildCommon(stateName);\n\t\t\t}\n\n\t\t\tif (stateDropDown != null) {\n\t\t\t\tobj.common.states = stateDropDown;\n\t\t\t}\n\n\t\t\t// Check if the object must be created\n\t\t\tif (createdObjs.indexOf(`${rootDIR}.${stateName}`) === -1) {\n\t\t\t\tawait this.extendObjectAsync(`${rootDIR}.${stateName}`, {\n\t\t\t\t\ttype: obj.type,\n\t\t\t\t\tcommon: JSON.parse(JSON.stringify(obj.common)),\n\t\t\t\t\tnative: JSON.parse(JSON.stringify(obj.native)),\n\t\t\t\t});\n\t\t\t\t// Remember created object for this runtime\n\t\t\t\tcreatedObjs.push(`${rootDIR}.${stateName}`);\n\t\t\t}\n\n\t\t\tif (obj.common.write != null && obj.common.write) {\n\t\t\t\tthis.subscribeStates(`${rootDIR}.${stateName}`);\n\t\t\t}\n\n\t\t\tif (value != null) {\n\t\t\t\tawait this.setStateChangedAsync(`${rootDIR}.${stateName}`, {\n\t\t\t\t\tval: value,\n\t\t\t\t\tack: true,\n\t\t\t\t});\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthis.errorHandler(`[setObjectAndState]`, error);\n\t\t}\n\t}\n\n\t/**\n\t * Is called when adapter shuts down - callback has to be called under any circumstances!\n\t */\n\tprivate onUnload(callback: () => void): void {\n\t\ttry {\n\t\t\t// Clear running timer\n\t\t\tif (activeDevices != null) {\n\t\t\t\tfor (const device in activeDevices) {\n\t\t\t\t\tif (polling != null && polling[device] != null) {\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tclearTimeout(polling[device]);\n\t\t\t\t\t\tpolling[device] = {};\n\t\t\t\t\t}\n\t\t\t\t\tif (activeDevices[device] != null && activeDevices[device].settings != null) {\n\t\t\t\t\t\tthis.setState(`${activeDevices[device].settings.device.serial}.Info.connected`, {\n\t\t\t\t\t\t\tval: false,\n\t\t\t\t\t\t\tack: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcallback();\n\t\t} catch (error) {\n\t\t\tthis.errorHandler(`[onUnload]`, error);\n\t\t\tcallback();\n\t\t}\n\t}\n\n\tprivate errorHandler(source: string, error: unknown, debugMode?: boolean) {\n\t\tlet message = error;\n\t\tif (error instanceof Error && error.stack != null) message = error.stack;\n\t\tif (!debugMode) {\n\t\t\tthis.log.error(`${source} ${error}`);\n\t\t\tthis.sendSentry(`${source} ${message}`);\n\t\t} else {\n\t\t\tthis.log.debug(`${source} ${error}`);\n\t\t\tthis.log.debug(`${source} ${message}`);\n\t\t}\n\t}\n\n\t/**\n\t * Is called if a subscribed state changes\n\t */\n\tprivate async onStateChange(id: string, state: ioBroker.State | null | undefined): Promise {\n\t\ttry {\n\t\t\tif (state) {\n\t\t\t\t// The state was changed\n\t\t\t\tthis.log.debug(`state ${id} changed: ${state.val} (ack = ${state.ack})`);\n\t\t\t\t//Only fire when ack = false (set by admin or script)\n\t\t\t\tif (!state.ack && state.val != null) {\n\t\t\t\t\tthis.log.debug(`state ${id} changed: ${state.val} (ack = ${state.ack})`);\n\t\t\t\t\tconst deviceId = id.split('.');\n\n\t\t\t\t\tconst deviceIP = ipSerialMapping[deviceId[2]].ip;\n\t\t\t\t\tconst url = activeDevices[deviceIP].deviceURL;\n\t\t\t\t\tthis.log.debug('Triggered state : ' + deviceId[3]);\n\t\t\t\t\t// Handle Post command for configuration related settings\n\t\t\t\t\tif (deviceId[3] === 'Configuration') {\n\t\t\t\t\t\tif (deviceId[4] === 'restart') {\n\t\t\t\t\t\t\tconst post_url = `${url}/restart`;\n\t\t\t\t\t\t\tconst response = await axios.post(post_url);\n\t\t\t\t\t\t\tthis.setState(`${id}`, { val: false, ack: true });\n\t\t\t\t\t\t\tthis.log.info(`${deviceIP} Restart requested ${response.status}, reconnecting device`);\n\t\t\t\t\t\t\tactiveDevices[deviceIP].initialised = false;\n\t\t\t\t\t\t} else if (deviceId[4] === 'checkupdate') {\n\t\t\t\t\t\t\tconst post_url = `${url}/checkupdate`;\n\t\t\t\t\t\t\tconst response = await axios.post(post_url);\n\t\t\t\t\t\t\tthis.setState(`${id}`, { val: false, ack: true });\n\t\t\t\t\t\t\tthis.log.info(`${deviceIP} Check for updates ${response.status}`);\n\t\t\t\t\t\t} else if (deviceId[4] === 'update') {\n\t\t\t\t\t\t\tconst post_url = `${url}/update`;\n\t\t\t\t\t\t\tconst response = await axios.post(post_url);\n\t\t\t\t\t\t\tthis.setState(`${id}`, { val: false, ack: true });\n\t\t\t\t\t\t\tthis.log.info(`${deviceIP} Device update requested ${response.status}`);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.log.info(\n\t\t\t\t\t\t\t\t`${deviceIP} Device configuration changed ${deviceId[4]} ${deviceId[5]} | ${state.val}, reconnecting device`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tactiveDevices[deviceIP].settings.system[deviceId[5]] = state.val;\n\t\t\t\t\t\t\tconst array = {\n\t\t\t\t\t\t\t\tap: activeDevices[deviceIP].settings.system.ap,\n\t\t\t\t\t\t\t\thost: activeDevices[deviceIP].settings.system.host,\n\t\t\t\t\t\t\t\tlanguage: activeDevices[deviceIP].settings.system.language,\n\t\t\t\t\t\t\t\tunit: activeDevices[deviceIP].settings.system.unit,\n\t\t\t\t\t\t\t\tautoupd: activeDevices[deviceIP].settings.system.autoupd,\n\t\t\t\t\t\t\t\thwversion: activeDevices[deviceIP].settings.system.hwversion,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tthis.sendArray(url, array, '/setsystem');\n\t\t\t\t\t\t\t// Refresh states\n\t\t\t\t\t\t\tactiveDevices[deviceIP].initialised = false;\n\t\t\t\t\t\t\tawait this.getDeviceData(deviceIP);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Handle Post command for sensor related settings\n\t\t\t\t\t} else if (deviceId[3] === 'Sensors') {\n\t\t\t\t\t\t// Update value of state change to memory\n\t\t\t\t\t\tconst sensorID = parseInt(deviceId[4].replace('Sensor_', '')) - 1;\n\t\t\t\t\t\tconst currentSensor = activeDevices[deviceIP].data.channel[sensorID];\n\n\t\t\t\t\t\t(currentSensor as any)[deviceId[5]] = state.val;\n\n\t\t\t\t\t\tthis.log.info(\n\t\t\t\t\t\t\t`${deviceIP} Sensor configuration changed ${deviceId[4]} ${deviceId[5]} | ${state.val}`,\n\t\t\t\t\t\t);\n\t\t\t\t\t\t// Send changes\n\t\t\t\t\t\tawait this.sendArray(url, activeDevices[deviceIP].data.channel[sensorID], '/setchannels');\n\t\t\t\t\t\t// Refresh states\n\t\t\t\t\t\tawait this.getDeviceData(deviceIP);\n\t\t\t\t\t} else if (deviceId[3] === 'Pitmaster') {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif ([deviceId[4]].toString() === 'Profiles') {\n\t\t\t\t\t\t\t\t// Changing profile ID is not allowed\n\t\t\t\t\t\t\t\tif (deviceId[6].toString() === 'id') return;\n\t\t\t\t\t\t\t\tconst profileID = parseInt(deviceId[5].replace('Profile_', '')) - 1;\n\t\t\t\t\t\t\t\tconst currentProfiles = activeDevices[deviceIP].settings.pid;\n\t\t\t\t\t\t\t\t(currentProfiles as any)[profileID][deviceId[6]] = state.val;\n\n\t\t\t\t\t\t\t\tthis.sendArray(url, currentProfiles, '/setpid');\n\t\t\t\t\t\t\t\tthis.log.info(\n\t\t\t\t\t\t\t\t\t`${deviceIP} Pitmaster profile ${profileID} changed ${deviceId[6]} | ${state.val}, reconnecting device`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t// Refresh states\n\t\t\t\t\t\t\t\tactiveDevices[deviceIP].initialised = false;\n\t\t\t\t\t\t\t\tawait this.getDeviceData(deviceIP);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst pitmasterID = parseInt(deviceId[4].replace('Pitmaster_', '')) - 1;\n\t\t\t\t\t\t\t\tthis.log.info(\n\t\t\t\t\t\t\t\t\t`${deviceIP} Pitmaster ${pitmasterID} configuration changed ${deviceId[5]} | ${state.val}`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tconst currentPM = activeDevices[deviceIP].data.pitmaster.pm[pitmasterID];\n\n\t\t\t\t\t\t\t\tif ([deviceId[5]].toString() !== 'modus') {\n\t\t\t\t\t\t\t\t\t(currentPM as any)[deviceId[5]] = state.val;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tcurrentPM.typ = state.val.toString();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis.sendArray(url, activeDevices[deviceIP].data.pitmaster.pm, '/setpitmaster');\n\t\t\t\t\t\t\t\t// Refresh states\n\t\t\t\t\t\t\t\tawait this.getDeviceData(deviceIP);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\tthis.log.error('Error in handling pitmaster state change' + e);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// The state was deleted\n\t\t\t\tthis.log.debug(`state ${id} deleted`);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthis.errorHandler(`[onStateChange]`, error);\n\t\t}\n\t}\n\n\tprivate async sendArray(url: string | undefined, array: object, type: string): Promise {\n\t\ttry {\n\t\t\tthis.log.debug(`Send array ${type} ${JSON.stringify(array)}`);\n\t\t\tif (url == null) return;\n\t\t\tconst post_url = `${url}${type}`;\n\t\t\tconst respons = axios.post(post_url, array);\n\t\t\treturn respons;\n\t\t} catch (error) {\n\t\t\tthis.errorHandler(`[onStateChange]`, error);\n\t\t}\n\t}\n\n\tprivate sendSentry(error: string): void {\n\t\tif (this.supportsFeature && this.supportsFeature('PLUGINS')) {\n\t\t\tconst sentryInstance = this.getPluginInstance('sentry');\n\t\t\tif (sentryInstance) {\n\t\t\t\tsentryInstance.getSentryObject().captureException(error);\n\t\t\t}\n\t\t}\n\t}\n}\n\nif (require.main !== module) {\n\t// Export the constructor in compact mode\n\tmodule.exports = (options: Partial | undefined) => new WlanthermoNano(options);\n} else {\n\t// otherwise start the instance directly\n\t(() => new WlanthermoNano())();\n}\n"], - "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,YAAuB;AAIvB,mBAAkB;AAClB,8BAA+D;AAE/D,MAAM,gBAA+B,CAAC;AACtC,MAAM,UAAqC,CAAC;AAC5C,MAAM,kBAAqD,CAAC;AAC5D,MAAM,cAAwB,CAAC;AAC/B,IAAI,eAAe;AAEnB,MAAM,uBAAuB,MAAM,QAAQ;AAAA,EAC1C,AAAO,YAAY,UAAyC,CAAC,GAAG;AAC/D,UAAM,iCACF,UADE;AAAA,MAEL,MAAM;AAAA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AS,QAAQ;AAE5B,SAAO,UAAU,CAAC,YAAuD,IAAI,eAAe,OAAO;AACpG,OAAO;AAEN,EAAC,OAAM,IAAI,eAAe,GAAG;AAC9B;", + "sourcesContent": ["/*\n * Created with @iobroker/create-adapter v2.1.1\n */\n\n// The adapter-core module gives you access to the core ioBroker functions\n// you need to create an adapter\nimport * as utils from '@iobroker/adapter-core';\n\n// Load your modules here, e.g.:\n// import * as fs from \"fs\";\nimport axios from 'axios'; // Load Axios module to allow handle http get & post\nimport { MyObjectsDefinitions, BasicStates, buildCommon } from './lib/stateDefinitions';\n\nconst activeDevices: activeDevices = {};\nconst polling: { [key: string]: object } = {};\nconst ipSerialMapping: { [key: string]: { ip: string } } = {};\nconst createdObjs: string[] = [];\nlet initializing = true;\n\nclass WlanthermoNano extends utils.Adapter {\n\tpublic constructor(options: Partial = {}) {\n\t\tsuper({\n\t\t\t...options,\n\t\t\tname: 'wlanthermo-nano',\n\t\t});\n\t\tthis.on('ready', this.onReady.bind(this));\n\t\tthis.on('stateChange', this.onStateChange.bind(this));\n\t\tthis.on('unload', this.onUnload.bind(this));\n\t}\n\n\t/**\n\t * Is called when databases are connected and adapter received configuration.\n\t */\n\tprivate async onReady(): Promise {\n\t\tthis.setState('info.connection', false, true);\n\t\tconst devices: DeviceList = this.config.deviceList;\n\t\tthis.log.info(`WLANThermo startet, loading ${devices.length} devices`);\n\t\tthis.log.debug(`Configured devices ${devices}`);\n\n\t\t// Connect to all devices configured in Adapter Instance\n\t\tlet amountConnected = 0;\n\t\tfor (const device in devices) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t//@ts-expect-error \n\t\t\tactiveDevices[devices[device].ip] = {};\n\t\t\tactiveDevices[devices[device].ip].basicInfo = devices[device];\n\t\t\tactiveDevices[devices[device].ip].initialised = false;\n\t\t\t// Start interval\n\t\t\tawait this.getDeviceData(devices[device].ip);\n\t\t\tif (activeDevices[devices[device].ip].initialised) {\n\t\t\t\tamountConnected = amountConnected + 1;\n\t\t\t}\n\t\t}\n\n\t\t// Adapter ready\n\t\tinitializing = false;\n\t\tthis.log.info(`WLANThermo ready, ${amountConnected} device(s) connected`);\n\t\tthis.setState('info.connection', true, true);\n\t}\n\n\tprivate async getDeviceData(deviceIP: string): Promise {\n\t\ttry {\n\t\t\tif (\n\t\t\t\tactiveDevices[deviceIP] == null ||\n\t\t\t\tactiveDevices[deviceIP].deviceURL == null ||\n\t\t\t\t!activeDevices[deviceIP].initialised\n\t\t\t) {\n\t\t\t\tthis.log.debug(`${deviceIP} not initialised, try to connect`);\n\t\t\t\tawait this.initialiseDevice(deviceIP);\n\t\t\t} else {\n\t\t\t\tthis.log.debug(`${deviceIP} initialised, update data`);\n\t\t\t\tconst response_deviceData = await axios(activeDevices[deviceIP].deviceURL + '/data', { timeout: 5000 });\n\t\t\t\tactiveDevices[deviceIP].data = response_deviceData.data;\n\t\t\t\tthis.log.debug(`${deviceIP} data | ${JSON.stringify(response_deviceData.data)}`);\n\t\t\t\tconst serial: string = activeDevices[deviceIP].settings.device.serial;\n\n\t\t\t\t// Write states for configuration channel\n\t\t\t\tfor (const [key, value] of Object.entries(activeDevices[deviceIP].data.system)) {\n\t\t\t\t\tthis.log.debug(`Create configuration state ${serial}.Configuration.${key} | ${value}`);\n\t\t\t\t\tawait this.setObjectAndState(`${serial}.Configuration`, `${key}`, value);\n\t\t\t\t}\n\n\t\t\t\t// Read all sensor related settings and write to states\n\t\t\t\tconst channel = activeDevices[deviceIP].data.channel;\n\t\t\t\tfor (let i = 0; i < channel.length; i++) {\n\t\t\t\t\tconst sensorRoot = `${serial}.Sensors.Sensor_${1 + +i}`;\n\t\t\t\t\tthis.log.debug(`Create sensor states ${sensorRoot}`);\n\t\t\t\t\tawait this.setObjectNotExistsAsync(sensorRoot, {\n\t\t\t\t\t\ttype: 'channel',\n\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\tname: channel[i].name,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnative: {},\n\t\t\t\t\t});\n\n\t\t\t\t\t// Load available sensor types\n\t\t\t\t\tconst sensorTypes: { [key: string]: string } = {};\n\t\t\t\t\tfor (const sensor in activeDevices[deviceIP].settings.sensors) {\n\t\t\t\t\t\tsensorTypes[sensor] = activeDevices[deviceIP].settings.sensors[sensor].name;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Write states for temperature sensors\n\t\t\t\t\tfor (const [key, value] of Object.entries(channel[i])) {\n\t\t\t\t\t\tswitch (key) {\n\t\t\t\t\t\t\tcase 'typ':\n\t\t\t\t\t\t\t\tawait this.setObjectAndState(`${sensorRoot}`, `${key}`, value, sensorTypes);\n\t\t\t\t\t\t\t\tthis.subscribeStates(`${sensorRoot}.${key}`);\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'alarm':\n\t\t\t\t\t\t\t\tawait this.setObjectAndState(`${sensorRoot}`, `${key}`, value, {\n\t\t\t\t\t\t\t\t\t'0': 'Disabled',\n\t\t\t\t\t\t\t\t\t'1': 'Push-Only',\n\t\t\t\t\t\t\t\t\t'2': 'Speaker-Only',\n\t\t\t\t\t\t\t\t\t'4': 'Push & Speaker',\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'temp':\n\t\t\t\t\t\t\t\tawait this.setObjectAndState(`${sensorRoot}`, `${key}`, null);\n\t\t\t\t\t\t\t\tif (channel[i][key] !== 999) {\n\t\t\t\t\t\t\t\t\tthis.setState(`${sensorRoot}.${key}`, {\n\t\t\t\t\t\t\t\t\t\tval: channel[i][key],\n\t\t\t\t\t\t\t\t\t\tack: true,\n\t\t\t\t\t\t\t\t\t\texpire: activeDevices[deviceIP].basicInfo.interval * 2000,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tthis.setState(`${sensorRoot}.${key}`, { val: null, ack: true });\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tawait this.setObjectAndState(`${sensorRoot}`, `${key}`, value);\n\t\t\t\t\t\t\t\tthis.subscribeStates(`${sensorRoot}.${key}`);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Write states for pitmaster\n\t\t\t\t\tif (activeDevices[deviceIP].data.pitmaster != null) {\n\t\t\t\t\t\tconst pitmaster = activeDevices[deviceIP].data.pitmaster;\n\t\t\t\t\t\tfor (let i = 0; i < pitmaster.pm.length; i++) {\n\t\t\t\t\t\t\tconst stateRoot = `${serial}.Pitmaster.Pitmaster_${1 + i}`;\n\t\t\t\t\t\t\tthis.log.debug(`Create Pitmaster states ${stateRoot}`);\n\t\t\t\t\t\t\tawait this.setObjectNotExistsAsync(stateRoot, {\n\t\t\t\t\t\t\t\ttype: 'channel',\n\t\t\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\t\t\tname: 'Pitmaster',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tnative: {},\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tfor (const [key, value] of Object.entries(pitmaster.pm[i])) {\n\t\t\t\t\t\t\t\tif (key === 'typ') {\n\t\t\t\t\t\t\t\t\tawait this.setObjectAndState(`${stateRoot}`, `modus`, value);\n\t\t\t\t\t\t\t\t\t// Subscribe on state\n\t\t\t\t\t\t\t\t\t// this.subscribeStates(`${stateRoot}.modus`);\n\t\t\t\t\t\t\t\t} else if (key === 'pid') {\n\t\t\t\t\t\t\t\t\tawait this.setObjectAndState(`${stateRoot}`, `${key}`, value);\n\t\t\t\t\t\t\t\t\t// Subscribe on state\n\t\t\t\t\t\t\t\t\t// this.subscribeStates(`${stateRoot}.${y}`);\n\t\t\t\t\t\t\t\t} else if (key === 'id') {\n\t\t\t\t\t\t\t\t\tconst pidProfiles: { [key: string]: string } = {};\n\t\t\t\t\t\t\t\t\tfor (const profile in activeDevices[deviceIP].settings.pid) {\n\t\t\t\t\t\t\t\t\t\tpidProfiles[profile] = activeDevices[deviceIP].settings.pid[profile].name;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tawait this.setObjectAndState(`${stateRoot}`, `${key}`, value, pidProfiles);\n\t\t\t\t\t\t\t\t\t// ignore set_color\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tawait this.setObjectAndState(`${stateRoot}`, `${key}`, value);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.setState(`${activeDevices[deviceIP].settings.device.serial}.Info.connected`, {\n\t\t\t\t\t\t\tval: true,\n\t\t\t\t\t\t\tack: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthis.errorHandler(`[getDeviceData]`, error, true);\n\t\t\tif (activeDevices[deviceIP].initialised) {\n\t\t\t\tthis.log.warn(`${deviceIP} Connection lost, will try to reconnect`);\n\t\t\t}\n\t\t\tactiveDevices[deviceIP].initialised = false;\n\t\t\ttry {\n\t\t\t\tthis.setState(`${activeDevices[deviceIP].settings.device.serial}.Info.connected`, {\n\t\t\t\t\tval: false,\n\t\t\t\t\tack: true,\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(error);\n\t\t\t}\n\t\t}\n\n\t\t// Clear running timer\n\t\tif (polling[deviceIP]) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t// @ts-ignore\n\t\t\tclearTimeout(polling[deviceIP]);\n\t\t\tpolling[deviceIP] = {};\n\t\t}\n\n\t\t// Timer to reload data\n\t\tthis.log.debug(`${deviceIP} Timer triggered`);\n\t\tpolling[deviceIP] = setTimeout(() => {\n\t\t\tthis.log.debug(`${deviceIP} Timer executed`);\n\t\t\tthis.getDeviceData(deviceIP);\n\t\t}, activeDevices[deviceIP].basicInfo.interval * 1000);\n\t}\n\n\tprivate async initialiseDevice(ip: string): Promise {\n\t\ttry {\n\t\t\tconst device: Device = activeDevices[ip].basicInfo;\n\t\t\tconst url = `http://${device.username}:${device.password}@${device.ip}`;\n\n\t\t\t// Get Device Settings\n\t\t\tconst response_settings = await axios(url + '/settings', { timeout: 5000 });\n\t\t\tif (response_settings == null || response_settings.data == null) return;\n\t\t\tthis.log.debug(`${ip} data | ${JSON.stringify(response_settings.data)}`);\n\t\t\tconst responseData: DeviceSettings = response_settings.data;\n\t\t\t// Store all data into memory\n\t\t\tactiveDevices[device.ip].deviceURL = url;\n\t\t\tactiveDevices[device.ip].settings = responseData;\n\t\t\tactiveDevices[device.ip].initialised = true;\n\t\t\tipSerialMapping[activeDevices[device.ip].settings.device.serial] = { ip: device.ip };\n\n\t\t\tthis.log.debug(`${ip} memory cache | ${JSON.stringify(activeDevices[device.ip])}`);\n\n\t\t\t// Create channels\n\t\t\tawait this.deviceStructures(activeDevices[device.ip].settings.device.serial, device.ip);\n\t\t\t// Create States for device settings\n\t\t\tfor (const i in response_settings.data.device) {\n\t\t\t\tthis.log.debug(\n\t\t\t\t\t`Create device settings state ${activeDevices[device.ip].settings.device.serial}.Info.${i} | ${\n\t\t\t\t\t\tresponse_settings.data.device[i]\n\t\t\t\t\t}`,\n\t\t\t\t);\n\t\t\t\tawait this.setObjectAndState(\n\t\t\t\t\t`${activeDevices[device.ip].settings.device.serial}.Info`,\n\t\t\t\t\t`${i}`,\n\t\t\t\t\t`${response_settings.data.device[i]}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Create states for features channel\n\t\t\tif (activeDevices[device.ip].settings.features != null) {\n\t\t\t\tfor (const [key, value] of Object.entries(activeDevices[device.ip].settings.features)) {\n\t\t\t\t\tthis.log.debug(\n\t\t\t\t\t\t`Create feature state ${\n\t\t\t\t\t\t\tactiveDevices[device.ip].settings.device.serial\n\t\t\t\t\t\t}.features.${key} | ${value}`,\n\t\t\t\t\t);\n\t\t\t\t\tawait this.setObjectAndState(\n\t\t\t\t\t\t`${activeDevices[device.ip].settings.device.serial}.Features`,\n\t\t\t\t\t\t`${key}`,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Create states for PID Profile\n\t\t\tif (activeDevices[device.ip].settings.pid != null) {\n\t\t\t\tconst pidProfile = activeDevices[device.ip].settings.pid;\n\t\t\t\tfor (let i = 0; i < pidProfile.length; i++) {\n\t\t\t\t\tconst sensorRoot = `${activeDevices[device.ip].settings.device.serial}.Pitmaster.Profiles.Profile_${\n\t\t\t\t\t\t1 + +i\n\t\t\t\t\t}`;\n\t\t\t\t\tthis.log.debug(`Create profile states ${sensorRoot}`);\n\t\t\t\t\tawait this.setObjectNotExistsAsync(sensorRoot, {\n\t\t\t\t\t\ttype: 'channel',\n\t\t\t\t\t\tcommon: {\n\t\t\t\t\t\t\tname: pidProfile[i].name,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnative: {},\n\t\t\t\t\t});\n\n\t\t\t\t\t// Write states for PID profiles\n\t\t\t\t\tfor (const [key, value] of Object.entries(pidProfile[i])) {\n\t\t\t\t\t\tawait this.setObjectAndState(`${sensorRoot}`, `${key}`, value);\n\t\t\t\t\t\tthis.subscribeStates(`${sensorRoot}.${key}`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.log.info(\n\t\t\t\t`${ip} Connected, refreshing data every ${activeDevices[device.ip].basicInfo.interval} seconds`,\n\t\t\t);\n\t\t\tthis.getDeviceData(ip);\n\t\t} catch (error) {\n\t\t\tthis.errorHandler(`[initialiseDevice]`, error, true);\n\t\t\tif (initializing) {\n\t\t\t\tthis.log.warn(`${ip} Connection failed, will try again later ${error}`);\n\t\t\t}\n\t\t\tactiveDevices[ip].initialised = false;\n\t\t}\n\t}\n\n\tprivate async deviceStructures(serial: string, ip: string): Promise {\n\t\ttry {\n\t\t\tthis.createDevice(serial, {\n\t\t\t\tname: activeDevices[ip].settings.system.host,\n\t\t\t});\n\n\t\t\tfor (const object in BasicStates) {\n\t\t\t\tthis.log.debug(`Create basic state ${serial}.${object}`);\n\t\t\t\tawait this.setObjectAndState(`${serial}`, `${object}`, null);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthis.errorHandler(`[deviceStructures]`, error);\n\t\t}\n\t}\n\n\tprivate async setObjectAndState(\n\t\trootDIR: string,\n\t\tstateName: string,\n\t\tvalue: any | null,\n\t\tstateDropDown?: { [key: string]: string },\n\t): Promise {\n\t\ttry {\n\t\t\tlet obj: MyObjectsDefinitions = BasicStates[stateName];\n\n\t\t\tif (!obj) {\n\t\t\t\tobj = buildCommon(stateName);\n\t\t\t}\n\n\t\t\tif (stateDropDown != null) {\n\t\t\t\tobj.common.states = stateDropDown;\n\t\t\t}\n\n\t\t\t// Check if the object must be created\n\t\t\tif (createdObjs.indexOf(`${rootDIR}.${stateName}`) === -1) {\n\t\t\t\tawait this.extendObjectAsync(`${rootDIR}.${stateName}`, {\n\t\t\t\t\ttype: obj.type,\n\t\t\t\t\tcommon: JSON.parse(JSON.stringify(obj.common)),\n\t\t\t\t\tnative: JSON.parse(JSON.stringify(obj.native)),\n\t\t\t\t});\n\t\t\t\t// Remember created object for this runtime\n\t\t\t\tcreatedObjs.push(`${rootDIR}.${stateName}`);\n\t\t\t}\n\n\t\t\tif (obj.common.write != null && obj.common.write) {\n\t\t\t\tthis.subscribeStates(`${rootDIR}.${stateName}`);\n\t\t\t}\n\n\t\t\tif (value != null) {\n\t\t\t\tawait this.setStateChangedAsync(`${rootDIR}.${stateName}`, {\n\t\t\t\t\tval: value,\n\t\t\t\t\tack: true,\n\t\t\t\t});\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthis.errorHandler(`[setObjectAndState]`, error);\n\t\t}\n\t}\n\n\t/**\n\t * Is called when adapter shuts down - callback has to be called under any circumstances!\n\t */\n\tprivate onUnload(callback: () => void): void {\n\t\ttry {\n\t\t\t// Clear running timer\n\t\t\tif (activeDevices != null) {\n\t\t\t\tfor (const device in activeDevices) {\n\t\t\t\t\tif (polling != null && polling[device] != null) {\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tclearTimeout(polling[device]);\n\t\t\t\t\t\tpolling[device] = {};\n\t\t\t\t\t}\n\t\t\t\t\tif (activeDevices[device] != null && activeDevices[device].settings != null) {\n\t\t\t\t\t\tthis.setState(`${activeDevices[device].settings.device.serial}.Info.connected`, {\n\t\t\t\t\t\t\tval: false,\n\t\t\t\t\t\t\tack: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcallback();\n\t\t} catch (error) {\n\t\t\tthis.errorHandler(`[onUnload]`, error);\n\t\t\tcallback();\n\t\t}\n\t}\n\n\tprivate errorHandler(source: string, error: unknown, debugMode?: boolean): void {\n\t\tlet message = error;\n\t\tif (error instanceof Error && error.stack != null) message = error.stack;\n\t\tif (!debugMode) {\n\t\t\tthis.log.error(`${source} ${error}`);\n\t\t\tthis.sendSentry(`${source} ${message}`);\n\t\t} else {\n\t\t\tthis.log.debug(`${source} ${error}`);\n\t\t\tthis.log.debug(`${source} ${message}`);\n\t\t}\n\t}\n\n\t/**\n\t * Is called if a subscribed state changes\n\t */\n\tprivate async onStateChange(id: string, state: ioBroker.State | null | undefined): Promise {\n\t\ttry {\n\t\t\tif (state) {\n\t\t\t\t// The state was changed\n\t\t\t\tthis.log.debug(`state ${id} changed: ${state.val} (ack = ${state.ack})`);\n\t\t\t\t//Only fire when ack = false (set by admin or script)\n\t\t\t\tif (!state.ack && state.val != null) {\n\t\t\t\t\tthis.log.debug(`state ${id} changed: ${state.val} (ack = ${state.ack})`);\n\t\t\t\t\tconst deviceId = id.split('.');\n\n\t\t\t\t\tconst deviceIP = ipSerialMapping[deviceId[2]].ip;\n\t\t\t\t\tconst url = activeDevices[deviceIP].deviceURL;\n\t\t\t\t\tthis.log.debug('Triggered state : ' + deviceId[3]);\n\t\t\t\t\t// Handle Post command for configuration related settings\n\t\t\t\t\tif (deviceId[3] === 'Configuration') {\n\t\t\t\t\t\tif (deviceId[4] === 'restart') {\n\t\t\t\t\t\t\tconst post_url = `${url}/restart`;\n\t\t\t\t\t\t\tconst response = await axios.post(post_url);\n\t\t\t\t\t\t\tthis.setState(`${id}`, { val: false, ack: true });\n\t\t\t\t\t\t\tthis.log.info(`${deviceIP} Restart requested ${response.status}, reconnecting device`);\n\t\t\t\t\t\t\tactiveDevices[deviceIP].initialised = false;\n\t\t\t\t\t\t} else if (deviceId[4] === 'checkupdate') {\n\t\t\t\t\t\t\tconst post_url = `${url}/checkupdate`;\n\t\t\t\t\t\t\tconst response = await axios.post(post_url);\n\t\t\t\t\t\t\tthis.setState(`${id}`, { val: false, ack: true });\n\t\t\t\t\t\t\tthis.log.info(`${deviceIP} Check for updates ${response.status}`);\n\t\t\t\t\t\t} else if (deviceId[4] === 'update') {\n\t\t\t\t\t\t\tconst post_url = `${url}/update`;\n\t\t\t\t\t\t\tconst response = await axios.post(post_url);\n\t\t\t\t\t\t\tthis.setState(`${id}`, { val: false, ack: true });\n\t\t\t\t\t\t\tthis.log.info(`${deviceIP} Device update requested ${response.status}`);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.log.info(\n\t\t\t\t\t\t\t\t`${deviceIP} Device configuration changed ${deviceId[4]} ${deviceId[5]} | ${state.val}, reconnecting device`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tactiveDevices[deviceIP].settings.system[deviceId[5]] = state.val;\n\t\t\t\t\t\t\tconst array = {\n\t\t\t\t\t\t\t\tap: activeDevices[deviceIP].settings.system.ap,\n\t\t\t\t\t\t\t\thost: activeDevices[deviceIP].settings.system.host,\n\t\t\t\t\t\t\t\tlanguage: activeDevices[deviceIP].settings.system.language,\n\t\t\t\t\t\t\t\tunit: activeDevices[deviceIP].settings.system.unit,\n\t\t\t\t\t\t\t\tautoupd: activeDevices[deviceIP].settings.system.autoupd,\n\t\t\t\t\t\t\t\thwversion: activeDevices[deviceIP].settings.system.hwversion,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tthis.sendArray(url, array, '/setsystem');\n\t\t\t\t\t\t\t// Refresh states\n\t\t\t\t\t\t\tactiveDevices[deviceIP].initialised = false;\n\t\t\t\t\t\t\tawait this.getDeviceData(deviceIP);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Handle Post command for sensor related settings\n\t\t\t\t\t} else if (deviceId[3] === 'Sensors') {\n\t\t\t\t\t\t// Update value of state change to memory\n\t\t\t\t\t\tconst sensorID = parseInt(deviceId[4].replace('Sensor_', '')) - 1;\n\t\t\t\t\t\tconst currentSensor = activeDevices[deviceIP].data.channel[sensorID];\n\n\t\t\t\t\t\t(currentSensor as any)[deviceId[5]] = state.val;\n\n\t\t\t\t\t\tthis.log.info(\n\t\t\t\t\t\t\t`${deviceIP} Sensor configuration changed ${deviceId[4]} ${deviceId[5]} | ${state.val}`,\n\t\t\t\t\t\t);\n\t\t\t\t\t\t// Send changes\n\t\t\t\t\t\tawait this.sendArray(url, activeDevices[deviceIP].data.channel[sensorID], '/setchannels');\n\t\t\t\t\t\t// Refresh states\n\t\t\t\t\t\tawait this.getDeviceData(deviceIP);\n\t\t\t\t\t} else if (deviceId[3] === 'Pitmaster') {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif ([deviceId[4]].toString() === 'Profiles') {\n\t\t\t\t\t\t\t\t// Changing profile ID is not allowed\n\t\t\t\t\t\t\t\tif (deviceId[6].toString() === 'id') return;\n\t\t\t\t\t\t\t\tconst profileID = parseInt(deviceId[5].replace('Profile_', '')) - 1;\n\t\t\t\t\t\t\t\tconst currentProfiles = activeDevices[deviceIP].settings.pid;\n\t\t\t\t\t\t\t\t(currentProfiles as any)[profileID][deviceId[6]] = state.val;\n\n\t\t\t\t\t\t\t\tthis.sendArray(url, currentProfiles, '/setpid');\n\t\t\t\t\t\t\t\tthis.log.info(\n\t\t\t\t\t\t\t\t\t`${deviceIP} Pitmaster profile ${profileID} changed ${deviceId[6]} | ${state.val}, reconnecting device`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t// Refresh states\n\t\t\t\t\t\t\t\tactiveDevices[deviceIP].initialised = false;\n\t\t\t\t\t\t\t\tawait this.getDeviceData(deviceIP);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst pitmasterID = parseInt(deviceId[4].replace('Pitmaster_', '')) - 1;\n\t\t\t\t\t\t\t\tthis.log.info(\n\t\t\t\t\t\t\t\t\t`${deviceIP} Pitmaster ${pitmasterID} configuration changed ${deviceId[5]} | ${state.val}`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tconst currentPM = activeDevices[deviceIP].data.pitmaster.pm[pitmasterID];\n\n\t\t\t\t\t\t\t\tif ([deviceId[5]].toString() !== 'modus') {\n\t\t\t\t\t\t\t\t\t(currentPM as any)[deviceId[5]] = state.val;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tcurrentPM.typ = state.val.toString();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis.sendArray(url, activeDevices[deviceIP].data.pitmaster.pm, '/setpitmaster');\n\t\t\t\t\t\t\t\t// Refresh states\n\t\t\t\t\t\t\t\tawait this.getDeviceData(deviceIP);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\tthis.log.error('Error in handling pitmaster state change' + e);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// The state was deleted\n\t\t\t\tthis.log.debug(`state ${id} deleted`);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthis.errorHandler(`[onStateChange]`, error);\n\t\t}\n\t}\n\n\tprivate async sendArray(url: string | undefined, array: object, type: string): Promise {\n\t\ttry {\n\t\t\tthis.log.debug(`Send array ${type} ${JSON.stringify(array)}`);\n\t\t\tif (url == null) return;\n\t\t\tconst post_url = `${url}${type}`;\n\t\t\tconst respons = axios.post(post_url, array);\n\t\t\treturn respons;\n\t\t} catch (error) {\n\t\t\tthis.errorHandler(`[onStateChange]`, error);\n\t\t}\n\t}\n\n\tprivate sendSentry(error: string): void {\n\t\tif (this.supportsFeature && this.supportsFeature('PLUGINS')) {\n\t\t\tconst sentryInstance = this.getPluginInstance('sentry');\n\t\t\tif (sentryInstance) {\n\t\t\t\tsentryInstance.getSentryObject().captureException(error);\n\t\t\t}\n\t\t}\n\t}\n}\n\nif (require.main !== module) {\n\t// Export the constructor in compact mode\n\tmodule.exports = (options: Partial | undefined) => new WlanthermoNano(options);\n} else {\n\t// otherwise start the instance directly\n\t(() => new WlanthermoNano())();\n}\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,YAAuB;AAIvB,mBAAkB;AAClB,8BAA+D;AAE/D,MAAM,gBAA+B,CAAC;AACtC,MAAM,UAAqC,CAAC;AAC5C,MAAM,kBAAqD,CAAC;AAC5D,MAAM,cAAwB,CAAC;AAC/B,IAAI,eAAe;AAEnB,MAAM,uBAAuB,MAAM,QAAQ;AAAA,EAC1C,AAAO,YAAY,UAAyC,CAAC,GAAG;AAC/D,UAAM,iCACF,UADE;AAAA,MAEL,MAAM;AAAA,IACP,EAAC;AACD,SAAK,GAAG,SAAS,KAAK,QAAQ,KAAK,IAAI,CAAC;AACxC,SAAK,GAAG,eAAe,KAAK,cAAc,KAAK,IAAI,CAAC;AACpD,SAAK,GAAG,UAAU,KAAK,SAAS,KAAK,IAAI,CAAC;AAAA,EAC3C;AAAA,EAKA,MAAc,UAAyB;AACtC,SAAK,SAAS,mBAAmB,OAAO,IAAI;AAC5C,UAAM,UAAsB,KAAK,OAAO;AACxC,SAAK,IAAI,KAAK,+BAA+B,QAAQ,gBAAgB;AACrE,SAAK,IAAI,MAAM,uBAAuB,SAAS;AAG/C,QAAI,kBAA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,SAAS,MAAM,SAAS;AACzC,kBAAC,UAAkB,SAAS,MAAM,MAAM;AAAA,gBACzC,OAAO;AACN,4BAAU,MAAM,MAAM,IAAI,SAAS;AAAA,gBACpC;AACA,qBAAK,UAAU,KAAK,cAAc,UAAU,KAAK,UAAU,IAAI,eAAe;AAE9E,sBAAM,KAAK,cAAc,QAAQ;AAAA,cAClC;AAAA,YACD,SAAS,GAAP;AACD,mBAAK,IAAI,MAAM,6CAA6C,CAAC;AAAA,YAC9D;AAAA,UACD;AAAA,QACD;AAAA,MACD,OAAO;AAEN,aAAK,IAAI,MAAM,SAAS,YAAY;AAAA,MACrC;AAAA,IACD,SAAS,OAAP;AACD,WAAK,aAAa,mBAAmB,KAAK;AAAA,IAC3C;AAAA,EACD;AAAA,EAEA,MAAc,UAAU,KAAyB,OAAe,MAA4B;AAC3F,QAAI;AACH,WAAK,IAAI,MAAM,cAAc,QAAQ,KAAK,UAAU,KAAK,GAAG;AAC5D,UAAI,OAAO;AAAM;AACjB,YAAM,WAAW,GAAG,MAAM;AAC1B,YAAM,UAAU,qBAAM,KAAK,UAAU,KAAK;AAC1C,aAAO;AAAA,IACR,SAAS,OAAP;AACD,WAAK,aAAa,mBAAmB,KAAK;AAAA,IAC3C;AAAA,EACD;AAAA,EAEA,AAAQ,WAAW,OAAqB;AACvC,QAAI,KAAK,mBAAmB,KAAK,gBAAgB,SAAS,GAAG;AAC5D,YAAM,iBAAiB,KAAK,kBAAkB,QAAQ;AACtD,UAAI,gBAAgB;AACnB,uBAAe,gBAAgB,EAAE,iBAAiB,KAAK;AAAA,MACxD;AAAA,IACD;AAAA,EACD;AACD;AAEA,IAAI,QAAQ,SAAS,QAAQ;AAE5B,SAAO,UAAU,CAAC,YAAuD,IAAI,eAAe,OAAO;AACpG,OAAO;AAEN,EAAC,OAAM,IAAI,eAAe,GAAG;AAC9B;", "names": [] } diff --git a/io-package.json b/io-package.json index 765f645..32225e2 100644 --- a/io-package.json +++ b/io-package.json @@ -1,20 +1,8 @@ { "common": { "name": "wlanthermo-nano", - "version": "0.2.1-alpha.0", + "version": "0.2.1-alpha.1", "news": { - "0.2.1-alpha.0": { - "en": "Error logging and reporting improved", - "de": "Fehlerprotokollierung und -berichterstattung verbessert", - "ru": "Улучшено ведение журнала ошибок и создание отчетов.", - "pt": "Registo de erros e relatórios melhorados", - "nl": "Foutregistratie en rapportage verbeterd", - "fr": "Amélioration de la journalisation et des rapports d'erreurs", - "it": "Registrazione e segnalazione degli errori migliorati", - "es": "Registro de errores e informes mejorados", - "pl": "Poprawiono rejestrowanie błędów i raportowanie", - "zh-cn": "错误记录和报告改进" - }, "0.1.2": { "en": "Support multiple devices", "de": "Unterstützt mehrere Geräte", @@ -120,7 +108,7 @@ }, "plugins": { "sentry": { - "dsn": "https://7c3dff9381a44d32b1b94e5bc827b09d@sentry.drozmotix.eu/3" + "dsn": "https://d71b421bfac44586a4abde74a44db5fd@sentry.drozmotix.eu/2" } }, "eraseOnUpload": true, diff --git a/package-lock.json b/package-lock.json index 8797044..9c6c8ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "iobroker.wlanthermo-nano", - "version": "0.2.1-alpha.0", + "version": "0.2.1-alpha.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 8b4036c..0456240 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iobroker.wlanthermo-nano", - "version": "0.2.1-alpha.0", + "version": "0.2.1-alpha.1", "description": "WLANThermo Nano, the digital advantage for your barbecue sport", "author": { "name": "DutchmanNL",