diff --git a/README.md b/README.md index f119eb5..66bccb0 100644 --- a/README.md +++ b/README.md @@ -51,8 +51,7 @@ You can read other values but I think you can't write other values. Other values https://github.com/sebilm/ioBroker.nibeuplink/blob/master/nibe-fetcher.js#L41 ## Changelog - -### **WORK IN PROGRESS** +### 1.3.2 (2024-11-10) - The nibeuplink API has been officially discontinued! For this reason, this ioBroker adapter will not be developed any further! Please use the myUplink adapter! - Dependencies have been updated diff --git a/build/lib/tools.js b/build/lib/tools.js index e38dbb5..4543530 100644 --- a/build/lib/tools.js +++ b/build/lib/tools.js @@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => { return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); diff --git a/build/lib/tools.js.map b/build/lib/tools.js.map index 6c90887..d47cd32 100644 --- a/build/lib/tools.js.map +++ b/build/lib/tools.js.map @@ -2,6 +2,6 @@ "version": 3, "sources": ["../../src/lib/tools.ts"], "sourcesContent": ["import axios from 'axios';\n\n/**\n * Tests whether the given variable is a real object and not an Array\n * @param it The variable to test\n */\nexport function isObject(it: unknown): it is Record {\n // This is necessary because:\n // typeof null === 'object'\n // typeof [] === 'object'\n // [] instanceof Object === true\n return Object.prototype.toString.call(it) === '[object Object]';\n}\n\n/**\n * Tests whether the given variable is really an Array\n * @param it The variable to test\n */\nexport function isArray(it: unknown): it is any[] {\n if (Array.isArray != null) return Array.isArray(it);\n return Object.prototype.toString.call(it) === '[object Array]';\n}\n\n/**\n * Translates text using the Google Translate API\n * @param text The text to translate\n * @param targetLang The target languate\n * @param yandexApiKey The yandex API key. You can create one for free at https://translate.yandex.com/developers\n */\nexport async function translateText(text: string, targetLang: string, yandexApiKey?: string): Promise {\n if (targetLang === 'en') {\n return text;\n } else if (!text) {\n return '';\n }\n if (yandexApiKey) {\n return translateYandex(text, targetLang, yandexApiKey);\n } else {\n return translateGoogle(text, targetLang);\n }\n}\n\n/**\n * Translates text with Yandex API\n * @param text The text to translate\n * @param targetLang The target languate\n * @param apiKey The yandex API key. You can create one for free at https://translate.yandex.com/developers\n */\nasync function translateYandex(text: string, targetLang: string, apiKey: string): Promise {\n if (targetLang === 'zh-cn') {\n targetLang = 'zh';\n }\n try {\n const url = `https://translate.yandex.net/api/v1.5/tr.json/translate?key=${apiKey}&text=${encodeURIComponent(text)}&lang=en-${targetLang}`;\n const response = await axios({ url, timeout: 15000 });\n if (isArray(response.data?.text)) {\n return response.data.text[0];\n }\n throw new Error('Invalid response for translate request');\n } catch (e: any) {\n throw new Error(`Could not translate to \"${targetLang}\": ${e}`);\n }\n}\n\n/**\n * Translates text with Google API\n * @param text The text to translate\n * @param targetLang The target languate\n */\nasync function translateGoogle(text: string, targetLang: string): Promise {\n try {\n const url = `http://translate.googleapis.com/translate_a/single?client=gtx&sl=en&tl=${targetLang}&dt=t&q=${encodeURIComponent(\n text,\n )}&ie=UTF-8&oe=UTF-8`;\n const response = await axios({ url, timeout: 15000 });\n if (isArray(response.data)) {\n // we got a valid response\n return response.data[0][0][0];\n }\n throw new Error('Invalid response for translate request');\n } catch (e: any) {\n if (e.response?.status === 429) {\n throw new Error(`Could not translate to \"${targetLang}\": Rate-limited by Google Translate`);\n } else {\n throw new Error(`Could not translate to \"${targetLang}\": ${e}`);\n }\n }\n}\n"], - "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAMX,SAAS,SAAS,IAAwC;AAK7D,SAAO,OAAO,UAAU,SAAS,KAAK,EAAE,MAAM;AAClD;AAMO,SAAS,QAAQ,IAA0B;AAC9C,MAAI,MAAM,WAAW;AAAM,WAAO,MAAM,QAAQ,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E,KAAK,SAAS,KAAM,CAAC;AACpD,QAAI,QAAQ,SAAS,IAAI,GAAG;AAExB,aAAO,SAAS,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;AAAA,IAChC;AACA,UAAM,IAAI,MAAM,wCAAwC;AAAA,EAC5D,SAAS,GAAQ;AACb,UAAI,OAAE,aAAF,mBAAY,YAAW,KAAK;AAC5B,YAAM,IAAI,MAAM,2BAA2B,UAAU,qCAAqC;AAAA,IAC9F,OAAO;AACH,YAAM,IAAI,MAAM,2BAA2B,UAAU,MAAM,CAAC,EAAE;AAAA,IAClE;AAAA,EACJ;AACJ;", "names": ["axios"] } diff --git a/build/main.js b/build/main.js index a2310ff..632f7a1 100644 --- a/build/main.js +++ b/build/main.js @@ -14,6 +14,10 @@ var __copyProps = (to, from, except, desc) => { return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); @@ -60,6 +64,9 @@ class NibeUplink extends utils.Adapter { this.on("stateChange", this.onStateChange.bind(this)); this.on("unload", this.onUnload.bind(this)); } + /** + * Is called when databases are connected and adapter received configuration. + */ async onReady() { this.log.info("Starting adapter."); let refreshInterval = this.config.Interval * 60; @@ -132,7 +139,7 @@ class NibeUplink extends utils.Adapter { this.log.debug("Data received."); this.log.silly(JSON.stringify(data, null, " ")); this.setState("info.connection", { val: true, expire: refreshInterval + 30, ack: true }); - const newDate = new Date(); + const newDate = /* @__PURE__ */ new Date(); const datetime = newDate.today() + " " + newDate.timeNow(); this.setState("info.updateTime", { val: datetime, ack: true }); this.setState("info.currentError", { val: "", ack: true }); @@ -257,7 +264,7 @@ class NibeUplink extends utils.Adapter { this.fetcher.on("error", (data) => { this.log.error("" + data); this.setState("info.connection", { val: false, ack: true }); - const newDate = new Date(); + const newDate = /* @__PURE__ */ new Date(); const datetime = newDate.today() + " " + newDate.timeNow(); this.setState("info.lastErrorTime", { val: datetime, ack: true }); this.setState("info.lastError", { val: "" + data, ack: true }); @@ -268,6 +275,9 @@ class NibeUplink extends utils.Adapter { } this.log.info("Adapter started."); } + /** + * Is called when adapter shuts down - callback has to be called under any circumstances! + */ onUnload(callback) { try { if (this.fetcher != null) { @@ -281,6 +291,23 @@ class NibeUplink extends utils.Adapter { callback(); } } + // If you need to react to object changes, uncomment the following block and the corresponding line in the constructor. + // You also need to subscribe to the objects with `this.subscribeObjects`, similar to `this.subscribeStates`. + // /** + // * Is called if a subscribed object changes + // */ + // private onObjectChange(id: string, obj: ioBroker.Object | null | undefined): void { + // if (obj) { + // // The object was changed + // this.log.info(`object ${id} changed: ${JSON.stringify(obj)}`); + // } else { + // // The object was deleted + // this.log.info(`object ${id} deleted`); + // } + // } + /** + * Is called if a subscribed state changes + */ async onStateChange(id, state) { if (state != null && state.ack === false && state.val != null && this.fetcher != null) { this.log.debug(`state ${id} changed: ${state.val} (ack = ${state.ack})`); @@ -311,6 +338,21 @@ class NibeUplink extends utils.Adapter { } } } + // If you need to accept messages in your adapter, uncomment the following block and the corresponding line in the constructor. + // /** + // * Some message was sent to this instance over message box. Used by email, pushover, text2speech, ... + // * Using this method requires "common.messagebox" property to be set to true in io-package.json + // */ + // private onMessage(obj: ioBroker.Message): void { + // if (typeof obj === 'object' && obj.message) { + // if (obj.command === 'send') { + // // e.g. send email or pushover or whatever + // this.log.info('send command'); + // // Send response in callback if required + // if (obj.callback) this.sendTo(obj.from, obj.command, 'Message received', obj.callback); + // } + // } + // } } if (require.main !== module) { module.exports = (options) => new NibeUplink(options); diff --git a/build/main.js.map b/build/main.js.map index 1c41c10..837436e 100644 --- a/build/main.js.map +++ b/build/main.js.map @@ -2,6 +2,6 @@ "version": 3, "sources": ["../src/main.ts"], "sourcesContent": ["/*\n * nibeuplink adapter\n */\n\nimport * as utils from '@iobroker/adapter-core';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport * as fetcher from './nibe-fetcher';\n\n// Helper functions:\n\n// For todays date;\ndeclare global {\n interface Date {\n today(): string;\n }\n}\nDate.prototype.today = function (): string {\n return (\n this.getFullYear() +\n '-' +\n (this.getMonth() + 1 < 10 ? '0' : '') +\n (this.getMonth() + 1) +\n '-' +\n (this.getDate() < 10 ? '0' : '') +\n this.getDate()\n );\n};\n\n// For the time now\ndeclare global {\n interface Date {\n timeNow(): string;\n }\n}\nDate.prototype.timeNow = function (): string {\n return (\n (this.getHours() < 10 ? '0' : '') +\n this.getHours() +\n ':' +\n (this.getMinutes() < 10 ? '0' : '') +\n this.getMinutes() +\n ':' +\n (this.getSeconds() < 10 ? '0' : '') +\n this.getSeconds()\n );\n};\n\nasync function createDeviceAsync(adapter: NibeUplink, path: string, name: string): Promise {\n await adapter.setObjectNotExistsAsync(path, {\n type: 'device',\n common: {\n name: name,\n role: 'text',\n },\n native: {},\n });\n}\n\nasync function createChannelAsync(adapter: NibeUplink, path: string, name: string): Promise {\n await adapter.setObjectNotExistsAsync(path, {\n type: 'channel',\n common: {\n name: name,\n role: 'text',\n },\n native: {},\n });\n}\n\nfunction setProperty(obj: any, propertyName: K, value: any): void {\n obj[propertyName] = value;\n}\n\nclass NibeUplink extends utils.Adapter {\n public constructor(options: Partial = {}) {\n super({\n ...options,\n name: 'nibeuplink',\n });\n this.on('ready', this.onReady.bind(this));\n this.on('stateChange', this.onStateChange.bind(this));\n // this.on('objectChange', this.onObjectChange.bind(this));\n // this.on('message', this.onMessage.bind(this));\n this.on('unload', this.onUnload.bind(this));\n }\n\n private fetcher: fetcher.Fetcher | undefined;\n\n /**\n * Is called when databases are connected and adapter received configuration.\n */\n private async onReady(): Promise {\n // Initialize your adapter here\n\n this.log.info('Starting adapter.');\n\n let refreshInterval: number = this.config.Interval * 60;\n if (refreshInterval < 60) {\n refreshInterval = 60;\n }\n\n const identifier: string = this.config.Identifier.trim();\n const secret: string = this.config.Secret.trim();\n const callbackURL: string = this.config.CallbackURL.trim();\n const configured: boolean = this.config.Configured;\n\n let error = false;\n if (identifier == '' || identifier == null) {\n if (configured != false) {\n this.log.error('Missing Identifier in the settings!');\n }\n error = true;\n }\n if (secret == '' || secret == null) {\n if (configured != false) {\n this.log.error('Missing Secret in the settings!');\n }\n error = true;\n }\n if (callbackURL == '' || callbackURL == null) {\n if (configured != false) {\n this.log.error('Missing Callback URL in the settings!');\n }\n error = true;\n }\n if (this.config.SystemId == '' || this.config.SystemId == null) {\n if (configured != false) {\n this.log.error('Missing System ID in the settings!');\n }\n error = true;\n }\n if (error) {\n this.setState('info.connection', { val: false, ack: true });\n this.setState('info.currentError', { val: 'Missing settings!', ack: true });\n return;\n }\n\n const dataDir: string = utils.getAbsoluteDefaultDataDir();\n let storeDir: string = path.join(dataDir, 'nibeuplink');\n try {\n // create directory\n if (!fs.existsSync(storeDir)) {\n fs.mkdirSync(storeDir);\n }\n } catch (err) {\n this.log.error('Could not create storage directory (' + storeDir + '): ' + err);\n storeDir = __dirname;\n }\n const storeFile = path.join(storeDir, 'session.' + this.instance + '.json');\n const manageId = !this.config.ManageId ? 'MANAGE' : this.config.ManageId;\n\n this.fetcher = new fetcher.Fetcher(\n {\n clientId: identifier,\n clientSecret: secret,\n redirectUri: callbackURL,\n interval: refreshInterval,\n authCode: this.config.AuthCode.trim(),\n systemId: this.config.SystemId,\n language: this.config.Language,\n enableManage: this.config.EnableManageSupport,\n managedParameters: this.config.ManagedParameters,\n sessionStore: storeFile,\n },\n this,\n );\n\n this.fetcher.on('data', async (d) => {\n const data = d as fetcher.Data;\n this.log.debug('Data received.');\n this.log.silly(JSON.stringify(data, null, ' '));\n\n this.setState('info.connection', { val: true, expire: refreshInterval + 30, ack: true });\n\n const newDate = new Date();\n const datetime = newDate.today() + ' ' + newDate.timeNow();\n this.setState('info.updateTime', { val: datetime, ack: true });\n this.setState('info.currentError', { val: '', ack: true });\n\n data.unitData.forEach(async (unit) => {\n const unitPath = `UNIT_${unit.systemUnitId}`;\n await createDeviceAsync(this, unitPath, `${unit.name} (${unit.product})`);\n unit.categories?.forEach(async (category) => {\n const categoryPath = `${unitPath}.${category.categoryId}`;\n await createChannelAsync(this, categoryPath, category.name);\n category.parameters.forEach(async (parameter) => {\n const key = parameter['key'];\n let title = parameter['title'];\n const designation = parameter['designation'];\n if (designation != null && designation != '') {\n title = `${title} (${designation})`;\n }\n const valuePath = `${categoryPath}.${key}`;\n\n await this.setObjectNotExistsAsync(valuePath, {\n type: 'state',\n common: {\n name: title,\n type: 'number',\n role: 'value',\n unit: parameter['unit'],\n read: true,\n write: false,\n },\n native: {},\n });\n await this.setStateAsync(valuePath, { val: parameter['value'], ack: true });\n\n const displayPath = `${categoryPath}.${key}_DISPLAY`;\n await this.setObjectNotExistsAsync(displayPath, {\n type: 'state',\n common: {\n name: `${title} [Display]`,\n type: 'string',\n role: 'text',\n read: true,\n write: false,\n },\n native: {},\n });\n await this.setStateAsync(displayPath, { val: parameter['displayValue'], ack: true });\n\n if (unit.systemUnitId == 0) {\n // update deprecated subpath values if present (pre 0.4.0):\n const oldValuePath = `${category.categoryId}.${key}`;\n this.getObject(oldValuePath, (err, obj) => {\n if (obj != null) {\n this.setState(oldValuePath, { val: parameter['value'], ack: true });\n }\n });\n const oldDisplayPath = `${category.categoryId}.${key}_DISPLAY`;\n this.getObject(oldDisplayPath, (err, obj) => {\n if (obj != null) {\n this.setState(oldDisplayPath, { val: parameter['displayValue'], ack: true });\n }\n });\n }\n });\n });\n });\n if (data.manageData != null) {\n const manageName = !this.config.ManageName ? 'Manage' : this.config.ManageName;\n await createDeviceAsync(this, manageId, manageName);\n data.manageData.forEach(async (manageData) => {\n const unit = manageData.unit;\n manageData.parameters.forEach(async (parameter) => {\n const parameterId = parameter.name.toString(); // name => number or string name\n const conf = this.config.ManagedParameters.find((x) => x.unit == unit && x.parameter == parameterId);\n let key;\n if (conf != null && conf.id) {\n key = conf.id;\n } else {\n key = `${unit}_${parameterId}_${parameter.key}`;\n }\n let title;\n if (conf != null && conf.name) {\n title = conf.name;\n } else {\n title = parameter.title;\n const designation = parameter.designation;\n if (designation != null && designation != '') {\n title = `${title} (${designation})`;\n }\n }\n const valuePath = `${manageId}.${key}`;\n\n await this.setObjectNotExistsAsync(valuePath, {\n type: 'state',\n common: {\n name: title,\n type: 'number',\n role: 'value',\n unit: parameter['unit'],\n read: true,\n write: true,\n },\n native: {\n deviceUnit: unit,\n parameterId: parameter.parameterId,\n divideBy: parameter.divideBy,\n },\n });\n await this.setStateAsync(valuePath, { val: parameter['value'], ack: true });\n\n const displayPath = `${manageId}.${key}_DISPLAY`;\n await this.setObjectNotExistsAsync(displayPath, {\n type: 'state',\n common: {\n name: `${title} [Display]`,\n type: 'string',\n role: 'text',\n read: true,\n write: false,\n },\n native: {},\n });\n await this.setStateAsync(displayPath, { val: parameter['displayValue'], ack: true });\n });\n });\n }\n this.log.debug('Data processed.');\n });\n\n this.fetcher.on('error', (data) => {\n this.log.error('' + data);\n\n this.setState('info.connection', { val: false, ack: true });\n\n const newDate = new Date();\n const datetime = newDate.today() + ' ' + newDate.timeNow();\n this.setState('info.lastErrorTime', { val: datetime, ack: true });\n this.setState('info.lastError', { val: '' + data, ack: true });\n this.setState('info.currentError', { val: '' + data, ack: true });\n });\n\n if (this.config.EnableManageSupport === true) {\n this.subscribeStates(`${manageId}.*`);\n }\n\n this.log.info('Adapter started.');\n }\n\n /**\n * Is called when adapter shuts down - callback has to be called under any circumstances!\n */\n private onUnload(callback: () => void): void {\n try {\n if (this.fetcher != null) {\n this.fetcher.stop();\n }\n this.fetcher = undefined;\n this.setState('info.connection', { val: false, ack: true });\n this.log.info('Cleaned everything up...');\n callback();\n } catch (e) {\n callback();\n }\n }\n\n // If you need to react to object changes, uncomment the following block and the corresponding line in the constructor.\n // You also need to subscribe to the objects with `this.subscribeObjects`, similar to `this.subscribeStates`.\n // /**\n // * Is called if a subscribed object changes\n // */\n // private onObjectChange(id: string, obj: ioBroker.Object | null | undefined): void {\n // if (obj) {\n // // The object was changed\n // this.log.info(`object ${id} changed: ${JSON.stringify(obj)}`);\n // } else {\n // // The object was deleted\n // this.log.info(`object ${id} deleted`);\n // }\n // }\n\n /**\n * Is called if a subscribed state changes\n */\n private async onStateChange(id: string, state: ioBroker.State | null | undefined): Promise {\n if (state != null && state.ack === false && state.val != null && this.fetcher != null) {\n this.log.debug(`state ${id} changed: ${state.val} (ack = ${state.ack})`);\n const obj = await this.getObjectAsync(id);\n if (\n obj != null &&\n obj.native != null &&\n obj.native.parameterId != null &&\n obj.native.parameterId != '' &&\n obj.native.deviceUnit != null &&\n obj.native.deviceUnit != ''\n ) {\n const params = {};\n const parameterId = obj.native.parameterId as number;\n setProperty(params, parameterId.toString(), state.val.toString());\n try {\n await this.fetcher.setParams(obj.native.deviceUnit, params);\n } catch (error) {\n const errorPath = `${id}_ERROR`;\n await this.setObjectNotExistsAsync(errorPath, {\n type: 'state',\n common: {\n name: `${obj.common.name} [Error]`,\n type: 'string',\n role: 'text',\n read: true,\n write: false,\n },\n native: {},\n });\n const errorMessage = error instanceof Error ? error.message : String(error);\n await this.setStateAsync(errorPath, { val: errorMessage, ack: true });\n }\n await this.fetcher.getParams(obj.native.deviceUnit, [obj.native.parameterId]);\n }\n }\n }\n\n // If you need to accept messages in your adapter, uncomment the following block and the corresponding line in the constructor.\n // /**\n // * Some message was sent to this instance over message box. Used by email, pushover, text2speech, ...\n // * Using this method requires \"common.messagebox\" property to be set to true in io-package.json\n // */\n // private onMessage(obj: ioBroker.Message): void {\n // if (typeof obj === 'object' && obj.message) {\n // if (obj.command === 'send') {\n // // e.g. send email or pushover or whatever\n // this.log.info('send command');\n\n // // Send response in callback if required\n // if (obj.callback) this.sendTo(obj.from, obj.command, 'Message received', obj.callback);\n // }\n // }\n // }\n}\n\nif (require.main !== module) {\n // Export the constructor in compact mode\n module.exports = (options: Partial | undefined) => new NibeUplink(options);\n} else {\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Q,YAAY,SAAS,GAAG,MAAM,IAAI,SAAS,CAAC;AAChE,YAAI;AACA,gBAAM,KAAK,QAAQ,UAAU,IAAI,OAAO,YAAY,MAAM;AAAA,QAC9D,SAAS,OAAO;AACZ,gBAAM,YAAY,GAAG,EAAE;AACvB,gBAAM,KAAK,wBAAwB,WAAW;AAAA,YAC1C,MAAM;AAAA,YACN,QAAQ;AAAA,cACJ,MAAM,GAAG,IAAI,OAAO,IAAI;AAAA,cACxB,MAAM;AAAA,cACN,MAAM;AAAA,cACN,MAAM;AAAA,cACN,OAAO;AAAA,YACX;AAAA,YACA,QAAQ,CAAC;AAAA,UACb,CAAC;AACD,gBAAM,eAAe,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC1E,gBAAM,KAAK,cAAc,WAAW,EAAE,KAAK,cAAc,KAAK,KAAK,CAAC;AAAA,QACxE;AACA,cAAM,KAAK,QAAQ,UAAU,IAAI,OAAO,YAAY,CAAC,IAAI,OAAO,WAAW,CAAC;AAAA,MAChF;AAAA,IACJ;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBJ;AAEA,IAAI,QAAQ,SAAS,QAAQ;AAEzB,SAAO,UAAU,CAAC,YAAuD,IAAI,WAAW,OAAO;AACnG,OAAO;AAEH,GAAC,MAAM,IAAI,WAAW,GAAG;AAC7B;", "names": ["path"] } diff --git a/build/nibe-fetcher.js b/build/nibe-fetcher.js index e7ccf26..31403fb 100644 --- a/build/nibe-fetcher.js +++ b/build/nibe-fetcher.js @@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => { return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); @@ -418,6 +422,29 @@ class Fetcher extends eventEmitter.EventEmitter { _onError(error) { this.emit("error", error); } + // async _getAndWriteAllParameters() { + // let par = {}; + // for (let i = 40000; i < 50000; i = i + 15) { + // let url = `parameters?parameterIds=${i}`; + // for (let j = 1; j < 15; j++) { + // url = url + `¶meterIds=${i + j}`; + // } + // let raw = await this.getFromNibeuplink(url, 'en'); + // this.adapter.log.info(`${i}: ${raw.length}`); + // this.processParams(raw, true); + // raw.forEach((item) => { + // if (item.key != '') { + // if (item.divideBy != null) { + // par[`${item.parameterId}`] = { key: item.key, divideBy: item.divideBy }; + // } else { + // par[`${item.parameterId}`] = { key: item.key }; + // } + // } + // }); + // } + // jsonfile.writeFileSync(path.join(__dirname, './parameters40.json'), par, { spaces: 2 }); + // this.stop(); + // } } // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { diff --git a/build/nibe-fetcher.js.map b/build/nibe-fetcher.js.map index 490c470..7f7e236 100644 --- a/build/nibe-fetcher.js.map +++ b/build/nibe-fetcher.js.map @@ -2,6 +2,6 @@ "version": 3, "sources": ["../src/nibe-fetcher.ts"], "sourcesContent": ["//\n// nibe-fetcher\n//\n// original author: Timo Behrmann (timo.behrmann@gmail.com)\n// changed by Sebastian Haesselbarth (seb@sebmail.de)\n//\n// original sources: https://github.com/z0mt3c/nibe-fetcher\n//\n// license: MIT\n//\n// this version is based on original nibe-fetcher version 1.1.0\n//\n\nimport * as utils from '@iobroker/adapter-core';\nimport axios, { AxiosError } from 'axios';\nimport * as eventEmitter from 'events';\nimport * as fs from 'fs';\nimport jsonfile from 'jsonfile';\nimport * as nibeDto from './nibeDto';\nimport * as parameters from './parameters';\n\nexport default interface Options {\n authCode: string;\n clientId: string;\n clientSecret: string;\n systemId: string;\n redirectUri: string;\n enableManage: boolean;\n managedParameters: ioBroker.Parameter[];\n interval: number;\n language: string;\n sessionStore: string;\n}\n\nexport interface Data {\n unitData: nibeDto.SystemUnit[];\n manageData?: ManageData[];\n}\n\nexport interface ManageData {\n unit: string;\n parameters: nibeDto.Parameter[];\n}\n\ninterface Session extends nibeDto.Session {\n expires_at?: number;\n expires_in?: number;\n authCode?: string;\n access_token?: string;\n refresh_token?: string;\n token_type?: string;\n scope?: string;\n}\n\nconst consts = {\n baseUrl: 'https://api.nibeuplink.com',\n scope: 'READSYSTEM WRITESYSTEM',\n timeout: 45000,\n userAgent: 'iobroker.nibeuplink',\n renewBeforeExpiry: 5 * 60 * 1000,\n parameters: parameters.NibeParameters,\n};\n\nconst versionKeys = ['VERSIO', 'VERSIE', 'VARIANTA', 'WERSJA', 'VERSJON'];\nconst serialNumberKeys = ['SERIENNUMMER', 'SERIENUMMER', 'NUMER_SERYJNY', 'NUM_RO_DE_S_RIE', 'SARJANUMERO', 'S_RIOV_SLO'];\nconst productKeys = ['PRODUKT', 'PRODUIT', 'TUOTE', 'V_ROBEK'];\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n interface Array {\n inPartsOf(number: number): T[][];\n }\n}\nArray.prototype.inPartsOf = function (number: number) {\n const parts: number = Math.floor(this.length / number); // number of parts - 1\n const lastLength: number = this.length % number;\n const result: T[][] = [];\n for (let i = 0; i < parts; i++) {\n const start: number = i * number;\n const part: T[] = this.slice(start, start + number);\n result.push(part);\n }\n if (lastLength > 0) {\n const lastPart = this.slice(parts * number);\n result.push(lastPart);\n }\n return result;\n};\n\nfunction groupBy(list: T[], getKey: (item: T) => K): Record {\n return list.reduce(\n (previous, currentItem) => {\n const group = getKey(currentItem);\n if (!previous[group]) {\n previous[group] = [];\n }\n previous[group].push(currentItem);\n return previous;\n },\n {} as Record,\n );\n}\n\nexport class Fetcher extends eventEmitter.EventEmitter {\n constructor(options: Options, adapter: utils.AdapterInstance) {\n super();\n\n this.adapter = adapter;\n this.options = options;\n\n axios.defaults.baseURL = consts.baseUrl;\n axios.defaults.headers.common['user-agent'] = consts.userAgent;\n axios.defaults.timeout = consts.timeout;\n\n this.start();\n }\n\n private adapter: utils.AdapterInstance;\n private options: Options;\n private interval: NodeJS.Timeout | null | undefined;\n private active: boolean | undefined;\n private units: nibeDto.SystemUnit[] | null | undefined;\n private auth: Session | null | undefined;\n\n start(): void {\n if (this.interval != null) {\n return;\n }\n\n this.active = false;\n\n const exec = (): void => {\n if (this.active) {\n return;\n }\n this.active = true;\n this.fetch().then(() => {\n this.active = false;\n });\n };\n this.interval = setInterval(exec, this.options.interval * 1000);\n\n exec();\n }\n\n stop(): void {\n if (this.interval == null) {\n return;\n }\n clearInterval(this.interval);\n this.interval = null;\n }\n\n async fetch(): Promise {\n this.adapter.log.debug('Fetch data.');\n try {\n if (this.hasNewAuthCode()) {\n this.clearSesssion();\n }\n if (!this.hasRefreshToken()) {\n if (this.options.authCode) {\n const token = await this.getToken(this.options.authCode);\n this.setSesssion(token);\n } else {\n this.adapter.log.error('You need to get and set a new Auth-Code. You can do this in the adapter setting.');\n this.stop();\n return;\n }\n }\n if (this.isTokenExpired()) {\n this.adapter.log.debug('Token is expired / expires soon - refreshing');\n const token = await this.getRefreshToken();\n this.setSesssion(token);\n }\n\n // await this._getAndWriteAllParameters();\n\n if (this.units == null) {\n this.units = await this.fetchUnits();\n }\n const unitData = await Promise.all(\n this.units.map(async (unit) => {\n const categories = await this.fetchCategories(unit);\n const newUnit: nibeDto.SystemUnit = {\n systemUnitId: unit.systemUnitId,\n name: unit.name,\n shortName: unit.shortName,\n product: unit.product,\n softwareVersion: unit.softwareVersion,\n categories: categories,\n };\n return newUnit;\n }),\n );\n const allData: Data = {\n unitData: unitData,\n };\n if (this.options.enableManage == true && this.options.managedParameters != null && this.options.managedParameters.length > 0) {\n const parametersByUnit = groupBy(this.options.managedParameters, (x) => x.unit);\n const parametersGroups = Object.values(parametersByUnit);\n const allManageData = await Promise.all(\n parametersGroups.map(async (group) => {\n const unit = group[0].unit;\n const parameters = group.map((x) => x.parameter);\n const result = await this.fetchParams(unit, parameters);\n this.processParams(result);\n const manageData: ManageData = {\n unit: unit,\n parameters: result,\n };\n return manageData;\n }),\n );\n allData.manageData = allManageData;\n }\n this.adapter.log.debug('All data fetched.');\n this._onData(allData);\n } catch (error) {\n this._onError(error);\n }\n }\n\n private async getToken(authCode: string): Promise {\n this.adapter.log.debug('token()');\n const data = {\n grant_type: 'authorization_code',\n client_id: this.options.clientId,\n client_secret: this.options.clientSecret,\n code: authCode,\n redirect_uri: this.options.redirectUri,\n scope: consts.scope,\n };\n return await this.postTokenRequest(data);\n }\n\n private async getRefreshToken(): Promise {\n this.adapter.log.debug('Refresh token.');\n const data = {\n grant_type: 'refresh_token',\n refresh_token: this.getSessionRefreshToken(),\n client_id: this.options.clientId,\n client_secret: this.options.clientSecret,\n };\n return await this.postTokenRequest(data);\n }\n\n private async postTokenRequest(body: any): Promise {\n const stringBody = new URLSearchParams(body).toString();\n const url = '/oauth/token';\n try {\n const { data } = await axios.post(url, stringBody, {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n });\n const expiresIn = data.expires_in ?? 1800;\n data.expires_at = Date.now() + expiresIn * 1000;\n return data;\n } catch (error) {\n throw this.checkError(url, error);\n }\n }\n\n private async fetchUnits(): Promise {\n this.adapter.log.debug('Fetch units.');\n const units = await this.getFromNibeuplink('units');\n this.adapter.log.debug(`${units.length} units fetched.`);\n return units;\n }\n\n private async fetchCategories(unit: nibeDto.SystemUnit): Promise {\n this.adapter.log.debug('Fetch categories.');\n const url = `serviceinfo/categories?parameters=true&systemUnitId=${unit.systemUnitId}`;\n const categories = await this.getFromNibeuplink(url);\n categories.forEach((category) => this.processParams(category.parameters));\n this.adapter.log.debug(`${categories.length} categories fetched.`);\n return categories;\n }\n\n private async fetchParams(unit: string, parameters: string[]): Promise {\n this.adapter.log.debug(`Fetch params ${parameters} of unit ${unit}.`);\n const result = await Promise.all(\n parameters.inPartsOf(15).map(async (p) => {\n const paramStr = p.join('¶meterIds=');\n const url = `parameters?parameterIds=${paramStr}&systemUnitId=${unit}`;\n return await this.getFromNibeuplink(url);\n }),\n );\n return result.flat();\n }\n\n async getParams(unit: string, parameters: string[]): Promise {\n const result = await this.fetchParams(unit, parameters);\n this.processParams(result);\n const manageData: ManageData = {\n unit: unit,\n parameters: result,\n };\n const data: Data = {\n unitData: [],\n manageData: [manageData],\n };\n this.adapter.log.debug('New data fetched.');\n this._onData(data);\n }\n\n async setParams(unit: string, parameters: any): Promise {\n const url = `parameters?systemUnitId=${unit}`;\n await this.putToNibeuplink(url, { settings: parameters });\n }\n\n private async getFromNibeuplink(suburl: string, lang = ''): Promise {\n if (lang == '') {\n lang = this.options.language;\n }\n const systemId = this.options.systemId;\n const url = `/api/v1/systems/${systemId}/${suburl}`;\n this.adapter.log.debug(`GET ${url} (lang: ${lang})`);\n try {\n const { data } = await axios.get(url, {\n headers: {\n Authorization: 'Bearer ' + this.getSessionAccessToken(),\n 'Accept-Language': lang,\n },\n });\n return data;\n } catch (error) {\n throw this.checkError(suburl, error);\n }\n }\n\n private async putToNibeuplink(suburl: string, body: any, lang = ''): Promise {\n if (lang == '') {\n lang = this.options.language;\n }\n const systemId = this.options.systemId;\n const url = `/api/v1/systems/${systemId}/${suburl}`;\n this.adapter.log.debug(`PUT ${url} (lang: ${lang})`);\n this.adapter.log.silly(`PUT body: ${JSON.stringify(body, null, ' ')}`);\n try {\n await axios.put(url, body, {\n headers: {\n Authorization: 'Bearer ' + this.getSessionAccessToken(),\n 'Accept-Language': lang,\n },\n });\n } catch (error) {\n throw this.checkError(suburl, error);\n }\n }\n\n private checkError(suburl: string, error: unknown): unknown {\n this.adapter.log.error(`error from ${suburl}`);\n if (axios.isAxiosError(error)) {\n const axiosError = error as AxiosError;\n if (axiosError.response != null) {\n if (axiosError.response.status == 401) {\n this.clearSesssion();\n }\n if (axiosError.response.data != null) {\n const responseText = JSON.stringify(axiosError.response.data, null, ' ');\n const errorMessage = `${axiosError.response.statusText}: ${responseText}`;\n return new Error(errorMessage);\n } else {\n return new Error(axiosError.response.statusText);\n }\n }\n }\n return error;\n }\n\n private processParams(params: nibeDto.Parameter[], collect = false): void {\n params.forEach((item) => {\n const parameters = consts.parameters.get(item.parameterId);\n if (parameters == null) {\n let key = item.title;\n if (!collect && item.parameterId > 0) {\n key = item.parameterId + '_' + key;\n }\n if (item.designation != null && item.designation != '') {\n key = key + '_' + item.designation;\n }\n key = key\n .toUpperCase()\n .replace(/[^A-Z0-9_]+/gm, '_')\n .replace(/_{2,}/gm, '_')\n .replace(/_+$/gm, '');\n if (item.parameterId == 0) {\n if (versionKeys.includes(key)) {\n key = 'VERSION';\n } else if (serialNumberKeys.includes(key)) {\n key = 'SERIAL_NUMBER';\n } else if (productKeys.includes(key)) {\n key = 'PRODUCT';\n }\n }\n Object.assign(item, { key: key });\n } else {\n Object.assign(item, parameters);\n }\n\n if (item.divideBy == null) {\n if (item.unit == '\u00B0C' || item.unit == 'kW' || item.unit == 'kWh' || item.unit == 'l/m') {\n Object.assign(item, { divideBy: 10 });\n }\n }\n\n if (item.divideBy != null && item.divideBy > 0) {\n item.value = item.rawValue / item.divideBy;\n } else {\n item.value = item.rawValue;\n }\n });\n }\n\n private readSession(): void {\n this.adapter.log.debug('Read session.');\n if (!this.options.sessionStore || !fs.existsSync(this.options.sessionStore)) {\n return;\n }\n this.auth = jsonfile.readFileSync(this.options.sessionStore, { throws: false });\n }\n\n private getSessionAuthCode(): string | undefined | null {\n this.adapter.log.silly('Get session authCode.');\n if (this.auth == null) {\n this.readSession();\n }\n return this.auth ? this.auth.authCode : null;\n }\n\n private getSessionAccessToken(): string | undefined | null {\n this.adapter.log.silly('Get session access_token.');\n if (this.auth == null) {\n this.readSession();\n }\n return this.auth ? this.auth.access_token : null;\n }\n\n private getSessionRefreshToken(): string | undefined | null {\n this.adapter.log.silly('Get session refresh_token.');\n if (this.auth == null) {\n this.readSession();\n }\n return this.auth ? this.auth.refresh_token : null;\n }\n\n private getSessionExpires(): number | undefined | null {\n this.adapter.log.silly('Get session expires.');\n if (this.auth == null) {\n this.readSession();\n }\n return this.auth ? this.auth.expires_at : null;\n }\n\n private setSesssion(auth: Session): void {\n this.adapter.log.debug('Set session.');\n if (auth.authCode == null) {\n auth.authCode = this.options.authCode;\n }\n this.auth = auth;\n if (!this.options.sessionStore) {\n return;\n }\n jsonfile.writeFileSync(this.options.sessionStore, this.auth, { spaces: 2 });\n }\n\n private clearSesssion(): void {\n this.adapter.log.debug('Clear session.');\n this.setSesssion({});\n }\n\n private hasNewAuthCode(): boolean {\n const authCode = this.getSessionAuthCode();\n const hasNewAuthCode = authCode != null && authCode != this.options.authCode;\n this.adapter.log.debug('Has new auth code: ' + hasNewAuthCode);\n return hasNewAuthCode;\n }\n\n private isTokenExpired(): boolean {\n const expired = (this.getSessionExpires() || 0) < Date.now() + consts.renewBeforeExpiry;\n this.adapter.log.debug('Is token expired: ' + expired);\n return expired;\n }\n\n private hasRefreshToken(): boolean {\n const hasToken = !!this.getSessionRefreshToken();\n this.adapter.log.debug('Has refresh token: ' + hasToken);\n return hasToken;\n }\n\n private _onData(data: Data): void {\n this.emit('data', data);\n }\n\n private _onError(error: unknown): void {\n this.emit('error', error);\n }\n\n // async _getAndWriteAllParameters() {\n // let par = {};\n // for (let i = 40000; i < 50000; i = i + 15) {\n // let url = `parameters?parameterIds=${i}`;\n // for (let j = 1; j < 15; j++) {\n // url = url + `¶meterIds=${i + j}`;\n // }\n // let raw = await this.getFromNibeuplink(url, 'en');\n // this.adapter.log.info(`${i}: ${raw.length}`);\n // this.processParams(raw, true);\n // raw.forEach((item) => {\n // if (item.key != '') {\n // if (item.divideBy != null) {\n // par[`${item.parameterId}`] = { key: item.key, divideBy: item.divideBy };\n // } else {\n // par[`${item.parameterId}`] = { key: item.key };\n // }\n // }\n // });\n // }\n // jsonfile.writeFileSync(path.join(__dirname, './parameters40.json'), par, { spaces: 2 });\n // this.stop();\n // }\n}\n"], - "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;A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,EACX;AAAA,EAEQ,kBAA2B;AAC/B,UAAM,WAAW,CAAC,CAAC,KAAK,uBAAuB;AAC/C,SAAK,QAAQ,IAAI,MAAM,wBAAwB,QAAQ;AACvD,WAAO;AAAA,EACX;AAAA,EAEQ,QAAQ,MAAkB;AAC9B,SAAK,KAAK,QAAQ,IAAI;AAAA,EAC1B;AAAA,EAEQ,SAAS,OAAsB;AACnC,SAAK,KAAK,SAAS,KAAK;AAAA,EAC5B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBJ;", "names": ["axios", "parameters", "jsonfile"] } diff --git a/io-package.json b/io-package.json index d1f92e8..a9e47f4 100644 --- a/io-package.json +++ b/io-package.json @@ -1,8 +1,21 @@ { "common": { "name": "nibeuplink", - "version": "1.3.1", + "version": "1.3.2", "news": { + "1.3.2": { + "en": "The nibeuplink API has been officially discontinued! For this reason, this ioBroker adapter will not be developed any further! Please use the myUplink adapter!\nDependencies have been updated", + "de": "Die Nibeuplink API wurde offiziell eingestellt! Aus diesem Grund wird dieser ioBroker Adapter nicht weiter entwickelt! Bitte nutzen Sie den myUplink Adapter!\nAbhängigkeiten wurden aktualisiert", + "ru": "Nibeuplink API был официально прекращен! По этой причине этот адаптер ioBroker больше не будет разработан! Пожалуйста, используйте адаптер myUplink!\nЗависимость обновлена", + "pt": "A API de nibeuplink foi oficialmente descontinuada! Por esta razão, este adaptador ioBroker não será desenvolvido mais! Por favor, use o adaptador myUplink!\nAs dependências foram atualizadas", + "nl": "De nibeuplink API is officieel stopgezet! Om deze reden zal deze ioBroker adapter niet verder ontwikkeld worden! Gebruik de myUplink adapter!\nAfhankelijkheden zijn bijgewerkt", + "fr": "L'API de nibeuplink a été officiellement abandonnée ! Pour cette raison, cet adaptateur ioBroker ne sera pas développé plus loin! Veuillez utiliser l'adaptateur myUplink!\nLes dépendances ont été actualisées", + "it": "L'API nibeuplink è stata ufficialmente interrotta! Per questo motivo, questo adattatore ioBroker non sarà ulteriormente sviluppato! Si prega di utilizzare l'adattatore myUplink!\nLe dipendenze sono state aggiornate", + "es": "¡La API de nibeuplink ha sido suspendida oficialmente! Por esta razón, este adaptador de ioBroker no se desarrollará más! ¡Por favor, usa el adaptador myUplink!\nSe han actualizado las dependencias", + "pl": "API Nibeuplink zostało oficjalnie przerwane! Z tego powodu ten adapter joBroker nie będzie dalej rozwijany! Proszę użyć adaptera myUplink!\nZaktualizowano zależności", + "uk": "Неперевершено API nibeuplink! З цієї причини цей адаптер ioBroker не буде розвиватися далі! Будь ласка, використовуйте адаптер myUplink!\nЗалежність було оновлено", + "zh-cn": "Nibeuplink API正式停办! 由于这个原因,这个ioBroker适配器不会再被开发了! 请使用 MyUplink 适配器!\n依赖关系已更新" + }, "1.3.1": { "en": "Bump dependencies" }, @@ -30,9 +43,6 @@ }, "1.1.1": { "en": "Fix write support (does not send zero) #6 #128\nBump dependencies" - }, - "1.1.0": { - "en": "Switch to TypeSctipt\nuse axios instead of wreck" } }, "title": "Nibe Uplink", diff --git a/package-lock.json b/package-lock.json index 0eebaf3..aac6e17 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "iobroker.nibeuplink", - "version": "1.3.1", + "version": "1.3.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "iobroker.nibeuplink", - "version": "1.3.1", + "version": "1.3.2", "license": "MIT", "dependencies": { "@iobroker/adapter-core": "^3.1.4", diff --git a/package.json b/package.json index a4b3c20..f584706 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iobroker.nibeuplink", - "version": "1.3.1", + "version": "1.3.2", "description": "With this adapter data of a Nibe heat pump can be read from Nibe Uplink.", "author": { "name": "Sebastian Haesselbarth",