diff --git a/README.md b/README.md index 7e248cb..5ca2ec8 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ # homebridge-nibe -![](./docs/nibe-logo-small.png) +![](./docs/nibe-myuplink-logo-small.png) [![NPM version](https://img.shields.io/npm/v/homebridge-nibe.svg)](https://www.npmjs.com/package/homebridge-nibe) ![Release](https://img.shields.io/github/release/hp-net/homebridge-nibe.svg?logo=github) @@ -22,13 +22,15 @@ [!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/hpruszyn) -## Nibeuplink plugin for homebridge +## Nibe myUplink plugin for homebridge -This homebridge plugin retrieves data from a Nibe heat pump from Nibe Uplink. +This Homebridge plugin retrieves data from a Nibe heat pump using Nibe myUplink. + +**⚠️ Notice:** Version 2 of this plugin supports only myUplink! To access data from Nibe Uplink, please use version 1 of the plugin. The old API is no longer compatible with this plugin. ### Plugin configuration -Whole setup instruction is available on plugin configuration page in homebridge. There is step by step description how to get required parameters. +Complete setup instructions are available on the plugin configuration page in Homebridge, providing a step-by-step guide to obtaining the required parameters. ### Supported accessories @@ -49,7 +51,7 @@ Whole setup instruction is available on plugin configuration page in homebridge. BT1 average outdoor temperature (40067). - hot-water + hot-water (Soon) Hot water temperature (40014,40008). Active (on/off) is responsible for temporary lux (48132). @@ -73,15 +75,15 @@ Whole setup instruction is available on plugin configuration page in homebridge. ERS outdoor temperature (40183). - ers-fan + ers-fan (Soon) ERS fan speed (40311, 40312) with change rotation speed (47260) and active state when rotation is grater than 0. - ventilation-fan + ventilation-fan (Soon) Ventilation fan speed (10001) with change rotation speed (47260) and active state when rotation is grater than 0. - thermostat + thermostat (Soon) Thermostat (40008,43437) for heating and cooling (if available). Active state is calculated. Changing desired temperature will affect heating/cooling offset (47011/48739). @@ -89,13 +91,13 @@ Whole setup instruction is available on plugin configuration page in homebridge. ## Roadmap -https://github.com/hp-net/homebridge-nibe/projects/1 +Check the project roadmap at https://github.com/hp-net/homebridge-nibe/projects/1 ## Configuration -Whole configuration can be done via homebridge ui and this is **recommended** way to do it. +Configuration can be done via the Homebridge UI, which is the **recommended** method. -However, you can also make all changes directly in homebridge config.json file. Below you can find description of all options. +However, you can also make changes directly in the Homebridge config.json file. Below is a description of all options: @@ -117,61 +119,43 @@ However, you can also make all changes directly in homebridge config.json file. - + - - - - - - - - - - - - - - - - - - - + - + - + - + - + - +
identifier Yes Api app identifier from Nibe Uplink account. Read instructions from plugin configuration to know how to get it.Api client identifier from Nibe myUplink account. Follow plugin configuration instructions to obtain it.
secret Yes Api app secret from Nibe Uplink account. Read instructions from plugin configuration to know how to get it.
authCodeYesAuthorization code for the app from Nibe Uplink. Read instructions from plugin configuration to know how to get it.
systemIdentifierYesSystem identifier for installed Nibe devices.
callbackUrlYeshttps://hp-net.github.io/homebridge-nibe/nibe.htmlUrl that will handle callback with authCode parameter. Default page is safe, it does not have any tracking scrips or additional logic to do weird stuff with the code. What is more authCode is not enough to da anything with api. Default page will only show you the code and give you a nice button to copy it to clipboard.Api client secret from Nibe myUplink account. Follow plugin configuration instructions to obtain it.
language No enLanguage to call Nibe Uplink Api and to set accessories labels. Possible values: 'en', 'pl'.Language for accessory labels. Possible values: 'en', 'pl', 'sv'.
pollingPeriod No 60Period (in seconds) for fetching device changes from api.Period (in seconds) for fetching device updates from api.
disabledAccessories No List of accessories to disable. Format 'id(name)' or 'id'.List of accessories to disable. Format 'id'.
showApiResponse No If set to `true` response from Nibe Uplink API will be displayed in logs.If set to `true` response from Nibe myUplink API will be displayed in logs.
hotwaterHeatingTemp No 40Min heating temperature for hot water. Used to decide if hot water is active.Min heating temperature for hot water. Used to determine if hot water is active.
diff --git a/archive/AccessoryHandler.ts b/archive/AccessoryHandler.ts new file mode 100644 index 0000000..818bba9 --- /dev/null +++ b/archive/AccessoryHandler.ts @@ -0,0 +1,225 @@ +// export class AccessoryHandler { +// private updateAccessory(platformAccessory: Accessory, services: ConfigurationService[], parameters: Map, refreshOnly = false): boolean { +// let result = false; +// +// services.forEach(service => { +// const serviceType = this.platform.getServiceType(service.type); +// const platformService = service.name ? +// platformAccessory.getService(service.name) || platformAccessory.addService(serviceType, service.name, 'Sub'+service.type + service.name): +// platformAccessory.getService(serviceType) || platformAccessory.addService(serviceType); +// +// service.characteristics +// .filter(characteristic => refreshOnly ? (characteristic.refresh || platformService.getCharacteristic(this.platform.getCharacteristicType(characteristic.type)) === null) : true) +// .forEach(characteristic => { +// +// if (characteristic.condition) { +// if (!this.checkConditions(characteristic.condition, parameters)) { +// this.platform.getLogger().debug(`Conditions not meet for characteristic: [${characteristic.id}] for product[${this.product}], removing characteristic`); +// const characteristicType = this.platform.getCharacteristicType(characteristic.type); +// const platformCharacteristic = platformService.getCharacteristic(characteristicType); +// platformService.removeCharacteristic(platformCharacteristic); +// return; +// } +// } +// +// let value; +// +// if (characteristic.value !== undefined) { +// value = characteristic.value; +// } else if(characteristic.id !== undefined) { +// const parameter = parameters.get(characteristic.id); +// if (parameter) { +// value = parameter[characteristic.attribute || 'value']; +// } +// } else if(characteristic.config !== undefined) { +// const configValue = this.platform.getConfig(characteristic.config.key); +// value = configValue === undefined ? characteristic.config.default : configValue; +// } else if(characteristic.provider !== undefined) { +// value = ProviderManager.get(characteristic.provider.name).provide(parameters, characteristic.provider.params, this.platform); +// } +// +// if (characteristic.parser) { +// value = this.transformWithParser(characteristic.parser, value); +// } +// +// if (value !== undefined && characteristic.mapper) { +// value = this.transformWithMapper(characteristic.mapper, value); +// } +// +// if (value !== undefined && characteristic.translate) { +// value = this.transformWithTranslate(platformAccessory.context.accessoryName, value); +// } +// +// if(value !== undefined) { +// const characteristicType = this.platform.getCharacteristicType(characteristic.type); +// const platformCharacteristic = platformService.getCharacteristic(characteristicType); +// +// if (characteristic.props) { +// const {provider: _, ...propsToSet} = characteristic.props; +// if (characteristic.props.provider) { +// const providerProps = ProviderManager.get(characteristic.props.provider.name).provide(parameters, characteristic.props.provider.params, this.platform); +// platformCharacteristic.setProps({...propsToSet, ...providerProps}); +// } else { +// platformCharacteristic.setProps(propsToSet); +// } +// } +// +// if (platformCharacteristic) { +// if (platformCharacteristic.value !== value) { +// this.platform.getLogger().debug(`[${platformAccessory.context.accessoryId}: ${service.type}.${characteristic.type}]: [${platformCharacteristic.value}] -> [${value}]`); +// platformService.updateCharacteristic(characteristicType, value); +// result = true; +// } +// } else { +// this.platform.getLogger().debug(`[${platformAccessory.context.accessoryId}: ${service.type}.${characteristic.type}]: [${value}]`); +// platformService.updateCharacteristic(characteristicType, value); +// result = true; +// } +// } +// if (characteristic.manage) { +// const characteristicType = this.platform.getCharacteristicType(characteristic.type); +// const platformCharacteristic = platformService.getCharacteristic(characteristicType); +// const manageId = characteristic.manage.id; +// platformCharacteristic.onSet(manageValue => { +// if (characteristic.manage) { +// if (characteristic.manage.provider !== undefined) { +// const params = {newValue: manageValue}; +// manageValue = ProviderManager.get(characteristic.manage.provider.name).provide(parameters, {...params, ...characteristic.manage.provider.params}, this.platform); +// } +// +// if (manageValue !== undefined && characteristic.manage.mapper) { +// manageValue = this.transformWithMapper(characteristic.manage.mapper, manageValue); +// } +// +// if (manageValue !== undefined) { +// if (typeof manageValue === 'object') { +// this.platform.getFetcher().setParams(platformAccessory.context.systemUnitId, manageValue); +// } else { +// const manageParameters = {}; +// manageParameters[manageId] = manageValue; +// this.platform.getFetcher().setParams(platformAccessory.context.systemUnitId, manageParameters); +// } +// } +// } +// }); +// } else { +// const characteristicType = this.platform.getCharacteristicType(characteristic.type); +// const platformCharacteristic = platformService.getCharacteristic(characteristicType); +// platformCharacteristic.onSet(manageValue => { +// this.platform.getLogger().debug(`Set on ${characteristic.type} with value: ${manageValue}, previous value ${platformCharacteristic.value}`); +// }); +// } +// }); +// }); +// +// platformAccessory.context.lastUpdate = new Date(); +// +// return result; +// } +// +// private transformWithParser(parser, value) { +// if (parser === 'notEmpty') { +// return value !== null && value !== ''; +// } +// if (parser === 'graterThan0') { +// return value !== null && value > 0; +// } +// return value; +// } +// +// private transformWithMapper(mapper:Map, value) { +// const filtered = [...mapper.values()].filter(v => { +// return Object.keys(v)[0].toString() === value.toString(); +// }); +// const defaultValue = [...mapper.values()].filter(v => { +// return Object.keys(v)[0].toString() === 'default'; +// }); +// +// if (filtered.length > 0) { +// return Object.values(filtered[0])[0]; +// } else if (defaultValue.length === 1) { +// return Object.values(defaultValue[0])[0]; +// } else { +// return undefined; +// } +// } +// +// private transformWithTranslate(accessoryName, value) { +// const originalValue = value; +// value = this.locale.text(accessoryName + '.' + originalValue, undefined); +// if(value === undefined) { +// value = this.locale.text(originalValue, undefined); +// } +// return value; +// } +// +// private checkConditions(condition: ConfigurationCondition, parameters: Map) { +// if (condition.parameterIds && condition.parameterIds.filter(p => parameters.get(p) === undefined).length > 0) { +// return false; +// } +// +// if (condition.provider !== undefined && !ProviderManager.get(condition.provider.name).provide(parameters, condition.provider.params, this.platform)){ +// return false; +// } +// +// return true; +// } +// +// private flatten(data: Data): Map { +// const result = new Map(); +// +// for (const systemUnit of data.unitData) { +// // if (systemUnit.systemUnitId !== this.unitId) { +// // continue; +// // } +// // +// // if (systemUnit.categories) { +// // for (const category of systemUnit.categories) { +// // for (const parameter of category.parameters) { +// // if (parameter) { +// // let parameterId = parameter.parameterId; +// // if (parameterId === 0) { +// // if (parameter.key === 'VERSION') { +// // parameterId = 3; +// // } else if (parameter.key === 'SERIAL_NUMBER') { +// // parameterId = 2; +// // } else if (parameter.key === 'PRODUCT') { +// // parameterId = 1; +// // } +// // } +// // +// // result.set(parameterId, { +// // title: parameter.title, +// // value: parameter.value, +// // unit: parameter.unit, +// // displayValue: parameter.displayValue, +// // rawValue: parameter.rawValue, +// // systemUnitId: systemUnit.systemUnitId, +// // }); +// // } +// // } +// // } +// // } +// // break; // handle only first for product +// } +// +// if (data.manageData) { +// for (const managedData of data.manageData) { +// for (const parameter of managedData.parameters) { +// if (parameter) { +// result.set(parameter.parameterId, { +// title: parameter.title, +// value: parameter.value, +// unit: parameter.unit, +// displayValue: parameter.displayValue, +// rawValue: parameter.rawValue, +// managed: true, +// }); +// } +// } +// } +// } +// +// return result; +// } +// } \ No newline at end of file diff --git a/archive/Provider.ts b/archive/Provider.ts new file mode 100644 index 0000000..f050cde --- /dev/null +++ b/archive/Provider.ts @@ -0,0 +1,229 @@ +// import {Parameter} from '../DataModel'; +// import {PlatformAdapter} from './PlatformAdapter'; +// +// function getVentilationStepConfig(parameters: Map, providerParameters: any) { +// return [ +// parameters.get(providerParameters.steps[0]), +// parameters.get(providerParameters.steps[1]), +// parameters.get(providerParameters.steps[2]), +// parameters.get(providerParameters.steps[3]), +// parameters.get(providerParameters.steps[4]), +// ].map(p => p ? p.rawValue : 0); +// } +// +// function getHotWaterHeatingTempConfig(platform: PlatformAdapter) { +// return platform.getConfig('hotwaterHeatingTemp') || 40; +// } +// +// abstract class Provider { +// public abstract provide(parameters: Map, providerParameters: any, platform: PlatformAdapter): any; +// } +// +// class MaxValue extends Provider { +// public provide(parameters: Map, providerParameters: any, platform: PlatformAdapter) { +// let max; +// for (const id of providerParameters.ids) { +// const param = parameters.get(id); +// if (param && param.value && (max === undefined || param.value > max)) { +// max = param.value; +// } +// } +// return max; +// } +// } +// +// class VentilationRotationSpeedStepSetter extends MaxValue { +// public provide(parameters: Map, providerParameters: any, platform: PlatformAdapter) { +// const value = super.provide(parameters, providerParameters, platform); +// const newValue = providerParameters.newValue; +// +// const config = getVentilationStepConfig(parameters, providerParameters); +// +// const reverse = value < newValue; +// const steps = reverse ? [...config].sort((n1,n2) => n1 - n2) : [...config].sort((n1,n2) => n2 - n1); +// +// let out = value; +// let check = false; +// for (const step of steps) { +// if (step === value) { +// check = true; +// continue; +// } +// if (check) { +// if (reverse && step > newValue) { +// const index = steps.indexOf(step); +// if (index > 0 && (steps[index] - steps[index-1])/2<(newValue-steps[index-1])) { +// out = step; +// } +// break; +// } +// if (!reverse && step < newValue) { +// const index = steps.indexOf(step); +// if (index > 0 && (steps[index-1] - steps[index])/2>(newValue-steps[index])) { +// out = step; +// } +// break; +// } +// out = step; +// } +// } +// const result = config.indexOf(out); +// return result > 0 ? config.indexOf(out) : 0; +// } +// } +// +// class VentilationRotationSpeedSetter extends Provider { +// public provide(parameters: Map, providerParameters: any, platform: PlatformAdapter) { +// const newValue = providerParameters.newValue; +// const config = getVentilationStepConfig(parameters, providerParameters); +// +// if (newValue === 0) { +// // find 0% rotation speed +// const min = Math.min(...config); +// const index = config.indexOf(min); +// return min === 0 ? index : undefined; +// } +// +// return 0; //normal rotation speed +// } +// } +// +// class HeatMediumFlowMapper extends Provider { +// public provide(parameters: Map, providerParameters: any, platform: PlatformAdapter): any { +// +// const heatPomp = parameters.get(providerParameters.heatPompParamId); +// if (!heatPomp || heatPomp.rawValue <= 0) { +// return 0; //OFF +// } +// +// const temp = parameters.get(providerParameters.temperatureParamId); +// if (providerParameters.type === 'hotwater') { +// if (temp && temp.value && temp.value > getHotWaterHeatingTempConfig(platform)) { +// return 1; //HEATING +// } +// } else { +// const coolingTemp = parameters.get(providerParameters.calculatedCoolingTemperatureParamId); +// if (temp && temp.value && temp.value <= getHotWaterHeatingTempConfig(platform)) { +// return coolingTemp && temp.rawValue < coolingTemp.rawValue ? 2 : 1; +// } +// } +// +// return 0; //OFF +// } +// } +// +// class HeatMediumFlowTemperature extends HeatMediumFlowMapper { +// public provide(parameters: Map, providerParameters: any, platform: PlatformAdapter) { +// const value = super.provide(parameters, providerParameters, platform); +// +// if (value === 2 || value === 3) { // HEATING OR COOLING +// const temp = parameters.get(providerParameters.temperatureParamId); +// if (temp) { +// return temp.value; +// } +// } +// +// // IDLE +// const outdoorTemp = parameters.get(providerParameters.outdoorTemperatureParamId); +// const coolingStartTemp = parameters.get(providerParameters.coolingStartTemperatureParamId); +// const isCooling = outdoorTemp && coolingStartTemp && outdoorTemp.rawValue > coolingStartTemp.rawValue; +// +// const temp = parameters.get(isCooling ? providerParameters.calculatedCoolingTemperatureParamId : providerParameters.calculatedHeatingTemperatureParamId); +// if (temp) { +// return temp.value; +// } +// +// return 0; +// } +// } +// +// class TargetTemperature extends HeatMediumFlowMapper { +// public provide(parameters: Map, providerParameters: any, platform: PlatformAdapter) { +// const value = super.provide(parameters, providerParameters, platform); +// +// const outdoorTemp = parameters.get(providerParameters.outdoorTemperatureParamId); +// const coolingStartTemp = parameters.get(providerParameters.coolingStartTemperatureParamId); +// const isCooling = value === 2 || (outdoorTemp && coolingStartTemp && outdoorTemp.rawValue > coolingStartTemp.rawValue); +// +// const temp = parameters.get(isCooling ? providerParameters.calculatedCoolingTemperatureParamId : providerParameters.calculatedHeatingTemperatureParamId); +// if (temp) { +// return temp.value; +// } +// +// return 0; +// } +// } +// +// class ThermostatProps extends HeatMediumFlowMapper { +// +// thermostatPropsOption = true; +// +// public provide(parameters: Map, providerParameters: any, platform: PlatformAdapter): any { +// const value = super.provide(parameters, providerParameters, platform); +// +// const outdoorTemp = parameters.get(providerParameters.outdoorTemperatureParamId); +// const coolingStartTemp = parameters.get(providerParameters.coolingStartTemperatureParamId); +// const isCooling = value === 2 || (outdoorTemp && coolingStartTemp && outdoorTemp.rawValue > coolingStartTemp.rawValue); +// const offset = parameters.get(isCooling ? providerParameters.coolOffsetParamId : providerParameters.heatOffsetParamId); +// const temp = parameters.get(isCooling ? providerParameters.calculatedCoolingTemperatureParamId : providerParameters.calculatedHeatingTemperatureParamId); +// +// if (temp && temp.value !== undefined && offset && offset.value !== undefined) { +// const x = Math.round(temp.value - offset.value); +// this.thermostatPropsOption = !this.thermostatPropsOption; // workaround for refresh props +// return this.thermostatPropsOption ? +// { +// maxValue: x + 10, +// minValue: x - 10, +// } : +// { +// validValueRanges: [x - 10, x + 10], +// }; +// } +// return {}; +// } +// } +// +// class ThermostatOffset extends HeatMediumFlowMapper { +// +// public provide(parameters: Map, providerParameters: any, platform: PlatformAdapter): any { +// const value = super.provide(parameters, providerParameters, platform); +// +// const outdoorTemp = parameters.get(providerParameters.outdoorTemperatureParamId); +// const coolingStartTemp = parameters.get(providerParameters.coolingStartTemperatureParamId); +// const isCooling = value === 2 || (outdoorTemp && coolingStartTemp && outdoorTemp.rawValue > coolingStartTemp.rawValue); +// const temp = parameters.get(isCooling ? providerParameters.calculatedCoolingTemperatureParamId : providerParameters.calculatedHeatingTemperatureParamId); +// const offsetParamId = isCooling ? providerParameters.coolOffsetParamId : providerParameters.heatOffsetParamId; +// +// const manageParameters = {}; +// +// if (temp && temp.value !== undefined) { +// manageParameters[offsetParamId] = providerParameters.newValue - Math.round(temp.value); +// } +// +// return manageParameters; +// } +// } +// +// export abstract class ProviderManager { +// private static providers; +// +// public static get(name: string): Provider { +// if (!ProviderManager.providers) { +// ProviderManager.providers = {}; +// ProviderManager.providers.MaxValue = new MaxValue(); +// ProviderManager.providers.VentilationRotationSpeedStepSetter = new VentilationRotationSpeedStepSetter(); +// ProviderManager.providers.VentilationRotationSpeedSetter = new VentilationRotationSpeedSetter(); +// ProviderManager.providers.HeatMediumFlowMapper = new HeatMediumFlowMapper(); +// ProviderManager.providers.HeatMediumFlowTemperature = new HeatMediumFlowTemperature(); +// ProviderManager.providers.TargetTemperature = new TargetTemperature(); +// ProviderManager.providers.ThermostatProps = new ThermostatProps(); +// ProviderManager.providers.ThermostatOffset = new ThermostatOffset(); +// } +// +// if(ProviderManager.providers[name] === undefined){ +// throw new ReferenceError(`No provider with name ${name}`); +// } +// +// return ProviderManager.providers[name]; +// } +// } \ No newline at end of file diff --git a/config/accessories.yaml b/archive/accessories.yaml similarity index 69% rename from config/accessories.yaml rename to archive/accessories.yaml index 5f3e2ed..a8a63f1 100644 --- a/config/accessories.yaml +++ b/archive/accessories.yaml @@ -1,73 +1,4 @@ -accessory: - id: nibe- - services: - - type: AccessoryInformation - characteristics: - - type: Manufacturer - value: Nibe - - type: Model - id: 1 - attribute: displayValue - - type: SerialNumber - id: 2 - attribute: displayValue accessoriesConfiguration: - - id: average-outdoor-temperature - name: average-outdoor-temperature - condition: - parameterIds: [ 40067 ] - services: - - type: TemperatureSensor - characteristics: - - type: CurrentTemperature - id: 40067 - refresh: true - - type: Name - value: temperature.average.name - translate: true - - id: outdoor-temperature-40004 - name: outdoor-temperature - condition: - parameterIds: [ 40004 ] - services: - - type: TemperatureSensor - characteristics: - - type: CurrentTemperature - id: 40004 - refresh: true - - type: Name - value: temperature.current.name - translate: true - - id: outdoor-temperature-44362 - name: outdoor-temperature - condition: - parameterIds: [ 44362 ] - services: - - type: TemperatureSensor - characteristics: - - type: CurrentTemperature - id: 44362 - refresh: true - - type: Name - value: temperature.current.name - translate: true - - type: AccessoryInformation - characteristics: - - type: SerialNumber - value: "00000000" - - id: hot-water-top - name: hot-water-top - condition: - parameterIds: [ 40013 ] - services: - - type: TemperatureSensor - characteristics: - - type: CurrentTemperature - id: 40013 - refresh: true - - type: Name - value: temperature.top.name - translate: true - id: hot-water name: hot-water condition: @@ -132,58 +63,6 @@ accessoriesConfiguration: props: maxValue: 70 perms: [ "pr", "ev" ] - - id: ventilation-exhaust-air - name: ventilation-exhaust-air - condition: - parameterIds: [ 40025 ] - services: - - type: TemperatureSensor - characteristics: - - type: CurrentTemperature - id: 40025 - refresh: true - - type: Name - value: temperature.name - translate: true - - id: ventilation-extract-air - name: ventilation-extract-air - condition: - parameterIds: [ 40026 ] - services: - - type: TemperatureSensor - characteristics: - - type: CurrentTemperature - id: 40026 - refresh: true - - type: Name - value: temperature.name - translate: true - - id: ventilation-supply-air - name: ventilation-supply-air - condition: - parameterIds: [ 40075 ] - services: - - type: TemperatureSensor - characteristics: - - type: CurrentTemperature - id: 40075 - refresh: true - - type: Name - value: temperature.name - translate: true - - id: ventilation-outdoor - name: ventilation-outdoor - condition: - parameterIds: [ 40183 ] - services: - - type: TemperatureSensor - characteristics: - - type: CurrentTemperature - id: 40183 - refresh: true - - type: Name - value: temperature.name - translate: true - id: ers-fan name: ers-fan condition: diff --git a/archive/devices.oldtest.ts b/archive/devices.oldtest.ts new file mode 100644 index 0000000..f904695 --- /dev/null +++ b/archive/devices.oldtest.ts @@ -0,0 +1,603 @@ +// import * as fs from 'fs'; +// import * as path from 'path'; +// import axios from 'axios'; +// import MockAdapter from 'axios-mock-adapter'; +// import {Parameter} from '../src/platform/myuplink/MyUplinkApiModel'; +// +// const loadData = function (product) { +// return JSON.parse(fs.readFileSync(path.resolve(__dirname, `./data/nibe-myuplink/${product.replace(/ /g, '-')}.json`), 'utf8')); +// }; +// +// const outdoorTemperature = function (currentTemp, serialNumber, index = 0) { +// return { +// id: `nibe-outdoor-temperature-${index === 0 ? 40004 : 44362}-${index}`, tests: [ +// { service: 'TemperatureSensor', characteristic: 'Name', value: 'Nibe outdoor temperature' }, +// { service: 'TemperatureSensor', characteristic: 'CurrentTemperature', value: currentTemp }, +// { service: 'AccessoryInformation', characteristic: 'SerialNumber', value: serialNumber }, +// ], +// }; +// }; +// +// const averageOutdoorTemperature = function (avgTemp, serialNumber, index = 0) { +// return { +// id: `nibe-average-outdoor-temperature-${index}`, tests: [ +// { service: 'TemperatureSensor', characteristic: 'Name', value: 'Nibe average outdoor temperature' }, +// { service: 'TemperatureSensor', characteristic: 'CurrentTemperature', value: avgTemp }, +// { service: 'AccessoryInformation', characteristic: 'SerialNumber', value: serialNumber }, +// ], +// }; +// }; +// +// const hotWater = function (currentTemp, active, currentHeaterCoolerState, heatingThresholdTemperature, serialNumber, index = 0) { +// return { +// id: `nibe-hot-water-${index}`, tests: [ +// { service: 'HeaterCooler', characteristic: 'Name', value: 'Nibe hot water temperature' }, +// { service: 'HeaterCooler', characteristic: 'CurrentTemperature', value: currentTemp }, +// { service: 'HeaterCooler', characteristic: 'Active', value: active }, +// { service: 'HeaterCooler', characteristic: 'CurrentHeaterCoolerState', value: currentHeaterCoolerState }, +// { service: 'HeaterCooler', characteristic: 'TargetHeaterCoolerState', value: 0 }, +// { service: 'HeaterCooler', characteristic: 'TemperatureDisplayUnits', value: 0 }, +// { service: 'HeaterCooler', characteristic: 'HeatingThresholdTemperature', value: heatingThresholdTemperature }, +// { service: 'AccessoryInformation', characteristic: 'SerialNumber', value: serialNumber }, +// ], +// }; +// }; +// +// const hotWaterTop = function (temp, serialNumber, index = 0) { +// return { +// id: `nibe-hot-water-top-${index}`, tests: [ +// { service: 'TemperatureSensor', characteristic: 'Name', value: 'Nibe top hot water temperature' }, +// { service: 'TemperatureSensor', characteristic: 'CurrentTemperature', value: temp }, +// { service: 'AccessoryInformation', characteristic: 'SerialNumber', value: serialNumber }, +// ], +// }; +// }; +// +// const ventilationExhaustAir = function (temp, serialNumber, index = 0) { +// return { +// id: `nibe-ventilation-exhaust-air-${index}`, tests: [ +// { service: 'TemperatureSensor', characteristic: 'Name', value: 'Nibe exhaust air temperature' }, +// { service: 'TemperatureSensor', characteristic: 'CurrentTemperature', value: temp }, +// { service: 'AccessoryInformation', characteristic: 'SerialNumber', value: serialNumber }, +// ], +// }; +// }; +// +// const ventilationExtractAir = function (temp, serialNumber, index = 0) { +// return { +// id: `nibe-ventilation-extract-air-${index}`, tests: [ +// { service: 'TemperatureSensor', characteristic: 'Name', value: 'Nibe extract air temperature' }, +// { service: 'TemperatureSensor', characteristic: 'CurrentTemperature', value: temp }, +// { service: 'AccessoryInformation', characteristic: 'SerialNumber', value: serialNumber }, +// ], +// }; +// }; +// +// const ventilationSupplyAir = function (temp, serialNumber, index = 0) { +// return { +// id: `nibe-ventilation-supply-air-${index}`, tests: [ +// { service: 'TemperatureSensor', characteristic: 'Name', value: 'Nibe supply air temperature' }, +// { service: 'TemperatureSensor', characteristic: 'CurrentTemperature', value: temp }, +// { service: 'AccessoryInformation', characteristic: 'SerialNumber', value: serialNumber }, +// ], +// }; +// }; +// +// const ventilationOutdoor = function (temp, serialNumber, index = 0) { +// return { +// id: `nibe-ventilation-outdoor-${index}`, tests: [ +// { service: 'TemperatureSensor', characteristic: 'Name', value: 'Nibe ventilation outdoor temperature' }, +// { service: 'TemperatureSensor', characteristic: 'CurrentTemperature', value: temp }, +// { service: 'AccessoryInformation', characteristic: 'SerialNumber', value: serialNumber }, +// ], +// }; +// }; +// +// const ersFan = function (active, state, speed, serialNumber, index = 0) { +// return { +// id: `nibe-ers-fan-${index}`, tests: [ +// { service: 'Fanv2', characteristic: 'Active', value: active }, +// { service: 'Fanv2', characteristic: 'CurrentFanState', value: state }, +// { service: 'Fanv2', characteristic: 'RotationSpeed', value: speed }, +// { service: 'Fanv2', characteristic: 'Name', value: 'Nibe ERS' }, +// { service: 'AccessoryInformation', characteristic: 'SerialNumber', value: serialNumber }, +// ], +// }; +// }; +// +// const ventilationFan = function (active, state, speed, serialNumber, index = 0) { +// return { +// id: `nibe-ventilation-fan-${index}`, tests: [ +// { service: 'Fanv2', characteristic: 'Active', value: active }, +// { service: 'Fanv2', characteristic: 'CurrentFanState', value: state }, +// { service: 'Fanv2', characteristic: 'RotationSpeed', value: speed }, +// { service: 'Fanv2', characteristic: 'Name', value: 'Nibe ventilation' }, +// { service: 'AccessoryInformation', characteristic: 'SerialNumber', value: serialNumber }, +// ], +// }; +// }; +// +// const thermostat = function (currentTemp, active, currentHeaterCoolerState, targetTemperature, serialNumber, index = 0) { +// return { +// id: `nibe-thermostat-${index}`, tests: [ +// { service: 'Thermostat', characteristic: 'Name', value: 'Nibe heating/cooling' }, +// { service: 'Thermostat', characteristic: 'CurrentTemperature', value: currentTemp }, +// { service: 'Thermostat', characteristic: 'CurrentHeatingCoolingState', value: currentHeaterCoolerState }, +// { service: 'Thermostat', characteristic: 'TargetHeatingCoolingState', value: 3 }, +// { service: 'Thermostat', characteristic: 'TemperatureDisplayUnits', value: 0 }, +// { service: 'Thermostat', characteristic: 'TargetTemperature', value: targetTemperature }, +// { service: 'AccessoryInformation', characteristic: 'SerialNumber', value: serialNumber }, +// ], +// }; +// }; +// +// const notDefined = function (ids:string[], index:number|undefined = undefined) { +// return ids.map(id => { +// if(index !== undefined) { +// return `nibe-${id}-${index}`; +// } +// return [`nibe-${id}-0`, `nibe-${id}-1`]; +// }).flatMap(id => id); +// }; +// +// const devices = [ +// { +// name: 'F370 CU 3x400V', +// accessories: [ +// outdoorTemperature(11.3, '06605520349022'), +// averageOutdoorTemperature(4, '06605520349022'), +// hotWater(52.5, false, 1, 52.5, '06605520349022'), +// hotWaterTop(53.9, '06605520349022'), +// ventilationExhaustAir(23.7, '06605520349022'), +// ventilationExtractAir(25.2, '06605520349022'), +// ventilationFan(1, 2, 54, '06605520349022'), +// thermostat(30, 0, 0, 30, '06605520349022'), +// ], +// notDefined: +// notDefined([ +// 'ventilation-supply-air', +// 'ventilation-outdoor', +// 'ers-fan', +// ]), +// }, +// { +// name: 'F470 CU 3x400V', +// accessories: [ +// outdoorTemperature(30.7, '06606419043009'), +// averageOutdoorTemperature(30.7, '06606419043009'), +// hotWater(51.3, false, 1, 51.3, '06606419043009'), +// hotWaterTop(50.9, '06606419043009'), +// ventilationSupplyAir(30.7, '06606419043009'), +// ventilationExhaustAir(26.6, '06606419043009'), +// ventilationExtractAir(25.2, '06606419043009'), +// ventilationFan(1, 2, 65, '06606419043009'), +// thermostat(20, 0, 0, 20, '06606419043009'), +// ], +// notDefined: +// notDefined([ +// 'ventilation-outdoor', +// 'ers-fan', +// ]), +// }, +// { +// name: 'F730 CU 3x400V', +// accessories: [ +// outdoorTemperature(19.8, '06615519029027'), +// averageOutdoorTemperature(14.5, '06615519029027'), +// hotWater(42, false, 2, 45.8, '06615519029027'), +// hotWaterTop(47.3, '06615519029027'), +// ventilationExhaustAir(22.1, '06615519029027'), +// ventilationExtractAir(7.5, '06615519029027'), +// ventilationFan(1, 2, 63, '06615519029027'), +// thermostat(20.4, 0, 0, 20.4, '06615519029027'), +// ], +// notDefined: +// notDefined([ +// 'ventilation-supply-air', +// 'ventilation-outdoor', +// 'ers-fan', +// ]), +// }, +// { +// name: 'F750 CU 3x400V', +// accessories: [ +// outdoorTemperature(8.5, '06603615321011'), +// averageOutdoorTemperature(4, '06603615321011'), +// hotWater(47.7, false, 1, 47.7, '06603615321011'), +// hotWaterTop(49.5, '06603615321011'), +// ventilationExhaustAir(24.1, '06603615321011'), +// ventilationExtractAir(23.6, '06603615321011'), +// ventilationFan(1, 2, 50, '06603615321011'), +// thermostat(26.8, 0, 0, 26.8, '06603615321011'), +// ], +// notDefined: +// notDefined([ +// 'ventilation-supply-air', +// 'ventilation-outdoor', +// 'ers-fan', +// ]), +// }, +// { +// name: 'F750 E EM 3x400V', +// accessories: [ +// outdoorTemperature(28.6, '06615220128003'), +// averageOutdoorTemperature(28.6, '06615220128003'), +// hotWater(50.4, false, 1, 50.8, '06615220128003'), +// hotWaterTop(51.5, '06615220128003'), +// ventilationExhaustAir(27.1, '06615220128003'), +// ventilationExtractAir(19, '06615220128003'), +// ventilationFan(1, 2, 30, '06615220128003'), +// thermostat(20, 0, 0, 20, '06615220128003'), +// ], +// notDefined: +// notDefined([ +// 'ventilation-supply-air', +// 'ventilation-outdoor', +// 'ers-fan', +// ]), +// }, +// { +// name: 'F750 R EM 3x400V', +// accessories: [ +// outdoorTemperature(10.2, '06615421330008'), +// averageOutdoorTemperature(12, '06615421330008'), +// hotWater(43.9, false, 1, 43.9, '06615421330008'), +// hotWaterTop(47.4, '06615421330008'), +// ventilationExhaustAir(27.9, '06615421330008'), +// ventilationExtractAir(28.1, '06615421330008'), +// ventilationFan(1, 2, 62, '06615421330008'), +// thermostat(21, 0, 0, 21, '06615421330008'), +// ], +// notDefined: +// notDefined([ +// 'ventilation-supply-air', +// 'ventilation-outdoor', +// 'ers-fan', +// ]), +// }, +// { +// name: 'F1145-10 PC', +// accessories: [ +// outdoorTemperature(15.7, '06513518228002'), +// averageOutdoorTemperature(12.2, '06513518228002'), +// hotWater(49.3, true, 1, 49.3, '06513518228002'), +// ventilationExhaustAir(21.9, '06513518228002'), +// ventilationExtractAir(22.5, '06513518228002'), +// ventilationSupplyAir(24.1, '06513518228002'), +// ventilationOutdoor(18.5, '06513518228002'), +// ersFan(1, 2, 50, '06513518228002'), +// thermostat(21, 1, 1, 21, '06513518228002'), +// ], +// notDefined: +// notDefined([ +// 'ventilation-fan', +// ]), +// }, +// { +// name: 'F1245-6 R', +// accessories: [ +// outdoorTemperature(22.1, '06508018330004'), +// averageOutdoorTemperature(22, '06508018330004'), +// hotWater(41.7, false, 1, 41.7, '06508018330004'), +// hotWaterTop(46.5, '06508018330004'), +// thermostat(20.4, 0, 0, 20.4, '06508018330004'), +// ], +// notDefined: +// notDefined([ +// 'ventilation-exhaust-air', +// 'ventilation-extract-air', +// 'ventilation-supply-air', +// 'ventilation-outdoor', +// 'ers-fan', +// 'ventilation-fan', +// ]), +// }, +// { +// name: 'F1245-6 E PC EM', +// accessories: [ +// outdoorTemperature(9.4, '06512120028002'), +// averageOutdoorTemperature(6.6, '06512120028002'), +// hotWater(49.7, false, 1, 49.7, '06512120028002'), +// hotWaterTop(54, '06512120028002'), +// thermostat(32.3, 0, 0, 32.3, '06512120028002'), +// ], +// notDefined: +// notDefined([ +// 'ventilation-exhaust-air', +// 'ventilation-extract-air', +// 'ventilation-supply-air', +// 'ventilation-outdoor', +// 'ers-fan', +// 'ventilation-fan', +// ]), +// }, +// { +// name: 'F1245-8 R', +// accessories: [ +// outdoorTemperature(21.8, '06508115245001'), +// averageOutdoorTemperature(23.6, '06508115245001'), +// hotWater(48.4, false, 1, 52.6, '06508115245001'), +// hotWaterTop(54, '06508115245001'), +// thermostat(23, 0, 0, 23, '06508115245001'), +// ], +// notDefined: +// notDefined([ +// 'ventilation-exhaust-air', +// 'ventilation-extract-air', +// 'ventilation-supply-air', +// 'ventilation-outdoor', +// 'ers-fan', +// 'ventilation-fan', +// ]), +// }, +// { +// name: 'F1255-6 E EM', +// accessories: [ +// outdoorTemperature(16.8, '06527019179011'), +// averageOutdoorTemperature(22.3, '06527019179011'), +// hotWater(45.8, false, 1, 45.8, '06527019179011'), +// hotWaterTop(51.5, '06527019179011'), +// ventilationExhaustAir(24.8, '06527019179011'), +// ventilationExtractAir(23.9, '06527019179011'), +// ventilationSupplyAir(18.7, '06527019179011'), +// ventilationOutdoor(18.9, '06527019179011'), +// ersFan(1, 2, 35, '06527019179011'), +// thermostat(22, 0, 0, 22, '06527019179011'), +// ], +// notDefined: +// notDefined([ +// 'ventilation-fan', +// ]), +// }, +// { +// name: 'F1255-6 R PC', +// accessories: [ +// outdoorTemperature(21.1, '06527220042029'), +// averageOutdoorTemperature(24.1, '06527220042029'), +// hotWater(43.1, false, 2, 48.2, '06527220042029'), +// hotWaterTop(48.7, '06527220042029'), +// thermostat(20, 0, 0, 20, '06527220042029'), +// ], +// notDefined: +// notDefined([ +// 'ventilation-exhaust-air', +// 'ventilation-extract-air', +// 'ventilation-supply-air', +// 'ventilation-outdoor', +// 'ers-fan', +// 'ventilation-fan', +// ]), +// }, +// { +// name: 'F1255-6 R PC EM 3x400V', +// accessories: [ +// outdoorTemperature(18, '06549021042001'), +// averageOutdoorTemperature(19.4, '06549021042001'), +// hotWater(53.3, false, 1, 53.3, '06549021042001'), +// hotWaterTop(55.3, '06549021042001'), +// thermostat(19.5, 1, 2, 20, '06549021042001'), +// ], +// notDefined: +// notDefined([ +// 'ventilation-exhaust-air', +// 'ventilation-extract-air', +// 'ventilation-supply-air', +// 'ventilation-outdoor', +// 'ers-fan', +// 'ventilation-fan', +// ]), +// }, +// { +// name: 'F2030-9', +// data: 'VVM-310&F2030', +// accessories: [ +// outdoorTemperature(18.8, '00000000', 1), +// ], +// notDefined: +// notDefined([ +// 'hot-water-top', +// 'hot-water', +// 'ventilation-exhaust-air', +// 'ventilation-extract-air', +// 'ventilation-supply-air', +// 'ventilation-outdoor', +// 'ers-fan', +// 'ventilation-fan', +// 'thermostat', +// ], 1), +// }, +// { +// name: 'F2040-6', +// data: 'SMO-40&F2040-6', +// accessories: [ +// outdoorTemperature(26.8, '00000000', 1), +// ], +// notDefined: +// notDefined([ +// 'hot-water-top', +// 'hot-water', +// 'ventilation-exhaust-air', +// 'ventilation-extract-air', +// 'ventilation-supply-air', +// 'ventilation-outdoor', +// 'ers-fan', +// 'ventilation-fan', +// 'thermostat', +// ], 1), +// }, +// { +// name: 'F2040-12', +// data: 'VVM-320-E&F2040-12', +// accessories: [ +// outdoorTemperature(17.9, '00000000', 1), +// ], +// notDefined: +// notDefined([ +// 'hot-water-top', +// 'hot-water', +// 'ventilation-exhaust-air', +// 'ventilation-extract-air', +// 'ventilation-supply-air', +// 'ventilation-outdoor', +// 'ers-fan', +// 'ventilation-fan', +// 'thermostat', +// ], 1), +// }, +// { +// name: 'F2120-12', +// data: 'VVM-500&F2120-12', +// accessories: [ +// outdoorTemperature(13.7, '00000000', 1), +// ], +// notDefined: +// notDefined([ +// 'hot-water-top', +// 'hot-water', +// 'ventilation-exhaust-air', +// 'ventilation-extract-air', +// 'ventilation-supply-air', +// 'ventilation-outdoor', +// 'ers-fan', +// 'ventilation-fan', +// 'thermostat', +// ], 1), +// }, +// { +// name: 'SMO 40', +// data: 'SMO-40&F2040-6', +// accessories: [ +// outdoorTemperature(18, '06722519232754'), +// averageOutdoorTemperature(13.3, '06722519232754'), +// hotWaterTop(52.6, '06722519232754'), +// ventilationExhaustAir(23.9, '06722519232754'), +// ventilationExtractAir(23.9, '06722519232754'), +// ventilationSupplyAir(24.1, '06722519232754'), +// ventilationOutdoor(23.7, '06722519232754'), +// ersFan(1, 2, 35, '06722519232754'), +// ], +// notDefined: +// notDefined([ +// 'hot-water', +// 'ventilation-fan', +// 'thermostat', +// ]), +// }, +// { +// name: 'VVM 310, 3x400V', +// data: 'VVM-310&F2030', +// accessories: [ +// outdoorTemperature(18, '06908413241009'), +// averageOutdoorTemperature(14.2, '06908413241009'), +// hotWater(49, false, 1, 49, '06908413241009'), +// hotWaterTop(49.8, '06908413241009'), +// thermostat(24.1, 0, 0, 24.1, '06908413241009'), +// ], +// notDefined: +// notDefined([ +// 'ventilation-exhaust-air', +// 'ventilation-extract-air', +// 'ventilation-supply-air', +// 'ventilation-outdoor', +// 'ers-fan', +// 'ventilation-fan', +// ]), +// }, +// { +// name: 'VVM 320 E', +// data: 'VVM-320-E&F2040-12', +// accessories: [ +// outdoorTemperature(14.7, '06911015040005'), +// averageOutdoorTemperature(9.6, '06911015040005'), +// hotWater(49.3, false, 1, 49.3, '06911015040005'), +// hotWaterTop(49.8, '06911015040005'), +// thermostat(24.7, 0, 0, 24.7, '06911015040005'), +// ], +// notDefined: +// notDefined([ +// 'ventilation-exhaust-air', +// 'ventilation-extract-air', +// 'ventilation-supply-air', +// 'ventilation-outdoor', +// 'ers-fan', +// 'ventilation-fan', +// ]), +// }, +// { +// name: 'VVM 500', +// data: 'VVM-500&F2120-12', +// accessories: [ +// outdoorTemperature(15.1, '06940017328003'), +// averageOutdoorTemperature(15.9, '06940017328003'), +// hotWater(47.9, false, 1, 47.9, '06940017328003'), +// hotWaterTop(48.3, '06940017328003'), +// thermostat(20.7, 0, 0, 20.7, '06940017328003'), +// ], +// notDefined: +// notDefined([ +// 'ventilation-exhaust-air', +// 'ventilation-extract-air', +// 'ventilation-supply-air', +// 'ventilation-outdoor', +// 'ers-fan', +// 'ventilation-fan', +// ]), +// }, +// ]; +// +// describe('Test devices', () => { +// +// let mock; +// +// beforeAll(() => { +// mock = new MockAdapter(axios); +// }); +// +// afterEach(() => { +// mock.reset(); +// }); +// +// devices.forEach(device => { +// describe(`Tests for ${device.name}`, () => { +// const product = device.data || device.name; +// const data = loadData(product) as Parameter[]; +// +// mock.onGet(`https://api.myuplink.com/v2/devices/${product}/points`).reply(200, data); +// +// const platform = new MockPlatform(); +// platform.handleData(data); +// +// device.accessories.forEach(accessory => { +// const mockAccessory = platform.getAccessoryById(accessory.id) as MockAccessory; +// test(`${accessory.id}: should be defined`, () => { +// expect(mockAccessory).toBeDefined(); +// }); +// test(`${accessory.id}: AccessoryInformation.Manufacturer should be Nibe`, () => { +// expect(mockAccessory.get('AccessoryInformation', 'Manufacturer')).toBe('Nibe'); +// }); +// test(`${accessory.id}: AccessoryInformation.Model should be ${device.name}`, () => { +// expect(mockAccessory.get('AccessoryInformation', 'Model')).toBe(device.name); +// }); +// accessory.tests.forEach(t => { +// if (t.value === undefined) { +// test(`${accessory.id}: ${t.service}.${t.characteristic} shouldn't be defined`, () => { +// expect(mockAccessory.get(t.service, t.characteristic)).not.toBeDefined(); +// }); +// } else { +// test(`${accessory.id}: ${t.service}.${t.characteristic} should be ${t.value}`, () => { +// expect(mockAccessory.get(t.service, t.characteristic)).toBe(t.value); +// }); +// } +// }); +// }); +// +// device.notDefined && device.notDefined.forEach(id => { +// test(`${id}: should not be defined`, () => { +// const mockAccessory = platform.getAccessoryById(id) as MockAccessory; +// expect(mockAccessory).not.toBeDefined(); +// }); +// }); +// }); +// }); +// +// }); \ No newline at end of file diff --git a/tests/data/F1145-10-PC.json b/archive/nibe-uplink/F1145-10-PC.json similarity index 100% rename from tests/data/F1145-10-PC.json rename to archive/nibe-uplink/F1145-10-PC.json diff --git a/tests/data/F1245-6-E-PC-EM.json b/archive/nibe-uplink/F1245-6-E-PC-EM.json similarity index 100% rename from tests/data/F1245-6-E-PC-EM.json rename to archive/nibe-uplink/F1245-6-E-PC-EM.json diff --git a/tests/data/F1245-6-R.json b/archive/nibe-uplink/F1245-6-R.json similarity index 100% rename from tests/data/F1245-6-R.json rename to archive/nibe-uplink/F1245-6-R.json diff --git a/tests/data/F1245-8-R.json b/archive/nibe-uplink/F1245-8-R.json similarity index 100% rename from tests/data/F1245-8-R.json rename to archive/nibe-uplink/F1245-8-R.json diff --git a/tests/data/F1255-6-E-EM.json b/archive/nibe-uplink/F1255-6-E-EM.json similarity index 100% rename from tests/data/F1255-6-E-EM.json rename to archive/nibe-uplink/F1255-6-E-EM.json diff --git a/tests/data/F1255-6-R-PC-EM-3x400V.json b/archive/nibe-uplink/F1255-6-R-PC-EM-3x400V.json similarity index 100% rename from tests/data/F1255-6-R-PC-EM-3x400V.json rename to archive/nibe-uplink/F1255-6-R-PC-EM-3x400V.json diff --git a/tests/data/F1255-6-R-PC.json b/archive/nibe-uplink/F1255-6-R-PC.json similarity index 100% rename from tests/data/F1255-6-R-PC.json rename to archive/nibe-uplink/F1255-6-R-PC.json diff --git a/tests/data/F370-CU-3x400V.json b/archive/nibe-uplink/F370-CU-3x400V.json similarity index 100% rename from tests/data/F370-CU-3x400V.json rename to archive/nibe-uplink/F370-CU-3x400V.json diff --git a/tests/data/F470-CU-3x400V.json b/archive/nibe-uplink/F470-CU-3x400V.json similarity index 100% rename from tests/data/F470-CU-3x400V.json rename to archive/nibe-uplink/F470-CU-3x400V.json diff --git a/tests/data/F730-CU-3x400V.json b/archive/nibe-uplink/F730-CU-3x400V.json similarity index 100% rename from tests/data/F730-CU-3x400V.json rename to archive/nibe-uplink/F730-CU-3x400V.json diff --git a/tests/data/F750-CU-3x400V.json b/archive/nibe-uplink/F750-CU-3x400V.json similarity index 100% rename from tests/data/F750-CU-3x400V.json rename to archive/nibe-uplink/F750-CU-3x400V.json diff --git a/tests/data/F750-E-EM-3x400V.json b/archive/nibe-uplink/F750-E-EM-3x400V.json similarity index 100% rename from tests/data/F750-E-EM-3x400V.json rename to archive/nibe-uplink/F750-E-EM-3x400V.json diff --git a/tests/data/F750-R-EM-3x400V.json b/archive/nibe-uplink/F750-R-EM-3x400V.json similarity index 100% rename from tests/data/F750-R-EM-3x400V.json rename to archive/nibe-uplink/F750-R-EM-3x400V.json diff --git a/tests/data/SMO-40&F2040-6.json b/archive/nibe-uplink/SMO-40&F2040-6.json similarity index 100% rename from tests/data/SMO-40&F2040-6.json rename to archive/nibe-uplink/SMO-40&F2040-6.json diff --git a/tests/data/VVM-310&F2030.json b/archive/nibe-uplink/VVM-310&F2030.json similarity index 100% rename from tests/data/VVM-310&F2030.json rename to archive/nibe-uplink/VVM-310&F2030.json diff --git a/tests/data/VVM-320-E&F2040-12.json b/archive/nibe-uplink/VVM-320-E&F2040-12.json similarity index 100% rename from tests/data/VVM-320-E&F2040-12.json rename to archive/nibe-uplink/VVM-320-E&F2040-12.json diff --git a/tests/data/VVM-500&F2120-12.json b/archive/nibe-uplink/VVM-500&F2120-12.json similarity index 100% rename from tests/data/VVM-500&F2120-12.json rename to archive/nibe-uplink/VVM-500&F2120-12.json diff --git a/tests/data/XXX.json b/archive/nibe-uplink/XXX.json similarity index 100% rename from tests/data/XXX.json rename to archive/nibe-uplink/XXX.json diff --git a/config.schema.json b/config.schema.json index bd15afb..2c50fd3 100644 --- a/config.schema.json +++ b/config.schema.json @@ -8,23 +8,12 @@ "type": "object", "properties": { "identifier": { - "title": "Identifier", + "title": "Client Identifier", "type": "string", "required": true }, "secret": { - "title": "Secret", - "type": "string", - "required": true - }, - "callbackUrl": { - "title": "Callback URL", - "type": "string", - "required": true, - "default": "https://hp-net.github.io/homebridge-nibe/nibe.html" - }, - "systemIdentifier": { - "title": "System identifier", + "title": "Client Secret", "type": "string", "required": true }, @@ -54,15 +43,10 @@ ], "required": true }, - "authCode": { - "title": "Auth Code", - "type": "string", - "required": true - }, "pollingPeriod": { "title": "Polling period", "type": "number", - "minimum": 10, + "minimum": 60, "placeholder": 60, "description": "Period (in seconds) for fetching device changes from api" }, @@ -83,7 +67,7 @@ } }, "showApiResponse": { - "title": "Show Nibe Uplink API response", + "title": "Show Nibe MyUplink API response", "type": "boolean" }, "hotwaterHeatingTemp": { @@ -98,14 +82,11 @@ "layout": [ { "type": "fieldset", - "title": "Nibe API", + "title": "Nibe API Credentials", "expandable": false, "items": [ - "systemIdentifier", - "callbackUrl", "identifier", - "secret", - "authCode" + "secret" ] }, { diff --git a/docs/nibe-myuplink-logo-small.png b/docs/nibe-myuplink-logo-small.png new file mode 100644 index 0000000..7674598 Binary files /dev/null and b/docs/nibe-myuplink-logo-small.png differ diff --git a/homebridge-ui/public/index.html b/homebridge-ui/public/index.html index b6453e2..2be42e9 100644 --- a/homebridge-ui/public/index.html +++ b/homebridge-ui/public/index.html @@ -3,7 +3,7 @@ .fa-external-link:before {content: "\f08e" !important;} legend {font-weight: bold;} #links {margin-bottom: 2rem;} - #links img {width: 4rem;} + #links img {width: 6rem;} #instruction {margin: -5px;} #instruction ol {padding-inline-start: 25px;} #instruction ol li {margin-bottom: 0.5rem; color:#9e9e9e;line-height: 200%;} @@ -13,20 +13,21 @@ #accessories {margin: -5px;margin-top: 20px;} #accessories-list {list-style: none; padding: 0; margin: 0;} .hidden {display: none;} + .bmc-button {background-color: rgb(255,221,0); float: right} + #instruction img {height: 1rem;} + #instruction a {margin-right: 5px !important; padding: 1px 5px 1px;}
@@ -37,40 +38,21 @@