From aca4fb0982e17fc85d119eca69b9986126bb34e2 Mon Sep 17 00:00:00 2001 From: Tellicious Date: Fri, 17 Nov 2023 15:07:44 +0100 Subject: [PATCH 01/12] Added fakegato logging to humidity sensor --- .../humiditySensorPlatformAccessory.ts | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/sensors/humiditySensorPlatformAccessory.ts b/src/sensors/humiditySensorPlatformAccessory.ts index 16ade69..73ac84c 100644 --- a/src/sensors/humiditySensorPlatformAccessory.ts +++ b/src/sensors/humiditySensorPlatformAccessory.ts @@ -13,6 +13,9 @@ export class HumiditySensorPlatformAccessory implements AccessoryPlugin { private service: Service; private information: Service; + private fakegatoService: any; + public services: Service[]; + private platform: any; private device: any; private logging: number; @@ -34,6 +37,9 @@ export class HumiditySensorPlatformAccessory implements AccessoryPlugin { this.device = device; this.logging = this.device.logging || 0; + this.fakegatoService = []; + this.services = []; + this.errorCheck(); this.service = new this.api.hap.Service.HumiditySensor(this.device.name); @@ -41,12 +47,15 @@ export class HumiditySensorPlatformAccessory implements AccessoryPlugin { this.service.getCharacteristic(this.api.hap.Characteristic.CurrentRelativeHumidity) .onGet(this.getCurrentRelativeHumidity.bind(this)); + this.information = new this.api.hap.Service.AccessoryInformation() .setCharacteristic(this.api.hap.Characteristic.Manufacturer, this.platform.manufacturer) .setCharacteristic(this.api.hap.Characteristic.Model, this.model + ' @ ' + this.platform.model) .setCharacteristic(this.api.hap.Characteristic.SerialNumber, md5(this.device.name + this.model)) .setCharacteristic(this.api.hap.Characteristic.FirmwareRevision, this.platform.firmwareRevision); + this.services.push(this.service, this.information); + this.updateCurrentRelativeHumidityQueued = false; if (this.platform.config.updateInterval) { @@ -56,11 +65,16 @@ export class HumiditySensorPlatformAccessory implements AccessoryPlugin { } if (this.logging) { + + if (this.platform.loggerType == LoggerType.Fakegato) { + this.fakegatoService = new this.platform.FakeGatoHistoryService("custom", this, {storage: 'fs'}); + this.services.push(this.fakegatoService); + } + setInterval(() => { this.logAccessory(); }, this.platform.loggerInterval); } - } @@ -71,7 +85,7 @@ export class HumiditySensorPlatformAccessory implements AccessoryPlugin { } getServices(): Service[] { - return [ this.information, this.service ]; + return this.services; } async getCurrentRelativeHumidity(): Promise { @@ -128,7 +142,7 @@ export class HumiditySensorPlatformAccessory implements AccessoryPlugin { if (this.platform.loggerType == LoggerType.Fakegato) { - // this.fakegatoService.addEntry({time: Math.round(new Date().valueOf() / 1000), temp: this.sensStates.CurrentTemperature}); + this.fakegatoService.addEntry({time: Math.round(new Date().valueOf() / 1000), humidity: this.sensStates.CurrentRelativeHumidity}); } From 734c15bd1a75030ff8ea171f2c01b6d015e034cb Mon Sep 17 00:00:00 2001 From: Tellicious Date: Fri, 17 Nov 2023 15:11:37 +0100 Subject: [PATCH 02/12] Added fakegato logging to CO2 sensor --- .../carbonDioxideSensorPlatformAccessory.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/sensors/carbonDioxideSensorPlatformAccessory.ts b/src/sensors/carbonDioxideSensorPlatformAccessory.ts index cd88859..243210d 100644 --- a/src/sensors/carbonDioxideSensorPlatformAccessory.ts +++ b/src/sensors/carbonDioxideSensorPlatformAccessory.ts @@ -13,6 +13,9 @@ export class CarbonDioxideSensorPlatformAccessory implements AccessoryPlugin { private service: Service; private information: Service; + private fakegatoService: any; + public services: Service[]; + private platform: any; private device: any; private logging: number; @@ -36,6 +39,9 @@ export class CarbonDioxideSensorPlatformAccessory implements AccessoryPlugin { this.device = device; this.logging = this.device.logging || 0; + this.fakegatoService = []; + this.services = []; + this.errorCheck(); this.service = new this.api.hap.Service.CarbonDioxideSensor(this.device.name); @@ -59,6 +65,8 @@ export class CarbonDioxideSensorPlatformAccessory implements AccessoryPlugin { .setCharacteristic(this.api.hap.Characteristic.SerialNumber, md5(this.device.name + this.model)) .setCharacteristic(this.api.hap.Characteristic.FirmwareRevision, this.platform.firmwareRevision); + this.services.push(this.service, this.information); + this.updateCarbonDioxideDetectedQueued = false; this.updateCarbonDioxideLevelQueued = false; this.updateCarbonDioxidePeakLevelQueued = false; @@ -72,6 +80,12 @@ export class CarbonDioxideSensorPlatformAccessory implements AccessoryPlugin { } if (this.logging) { + + if (this.platform.loggerType == LoggerType.Fakegato) { + this.fakegatoService = new this.platform.FakeGatoHistoryService("custom", this, {storage: 'fs'}); + this.services.push(this.fakegatoService); + } + setInterval(() => { this.logAccessory(); }, this.platform.loggerInterval); @@ -87,7 +101,7 @@ export class CarbonDioxideSensorPlatformAccessory implements AccessoryPlugin { } getServices(): Service[] { - return [ this.information, this.service ]; + return this.services; } async getCarbonDioxideDetected(): Promise { @@ -217,7 +231,7 @@ export class CarbonDioxideSensorPlatformAccessory implements AccessoryPlugin { if (this.platform.loggerType == LoggerType.Fakegato) { - // this.fakegatoService.addEntry({time: Math.round(new Date().valueOf() / 1000), temp: this.sensStates.CurrentTemperature}); + this.fakegatoService.addEntry({time: Math.round(new Date().valueOf() / 1000), ppm: this.sensStates.CarbonDioxideLevel}); } From 61f31cf4dd19a7c2743a29bb2d910c30826741d9 Mon Sep 17 00:00:00 2001 From: Tellicious Date: Fri, 17 Nov 2023 15:14:52 +0100 Subject: [PATCH 03/12] Added fakegato logging to contact sensor --- src/sensors/contactSensorPlatformAccessory.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/sensors/contactSensorPlatformAccessory.ts b/src/sensors/contactSensorPlatformAccessory.ts index 72f70a8..05cdf51 100644 --- a/src/sensors/contactSensorPlatformAccessory.ts +++ b/src/sensors/contactSensorPlatformAccessory.ts @@ -13,6 +13,9 @@ export class ContactSensorPlatformAccessory implements AccessoryPlugin { private service: Service; private information: Service; + private fakegatoService: any; + public services: Service[]; + private platform: any; private device: any; private logging: number; @@ -32,6 +35,9 @@ export class ContactSensorPlatformAccessory implements AccessoryPlugin { this.device = device; this.logging = this.device.logging || 0; + this.fakegatoService = []; + this.services = []; + this.errorCheck(); this.service = new this.api.hap.Service.ContactSensor(this.device.name); @@ -45,6 +51,8 @@ export class ContactSensorPlatformAccessory implements AccessoryPlugin { .setCharacteristic(this.api.hap.Characteristic.SerialNumber, md5(this.device.name + this.model)) .setCharacteristic(this.api.hap.Characteristic.FirmwareRevision, this.platform.firmwareRevision); + this.services.push(this.service, this.information); + this.updateContactSensorStateQueued = false; if (this.platform.config.updateInterval) { @@ -54,6 +62,12 @@ export class ContactSensorPlatformAccessory implements AccessoryPlugin { } if (this.logging) { + + if (this.platform.loggerType == LoggerType.Fakegato) { + this.fakegatoService = new this.platform.FakeGatoHistoryService("custom", this, {storage: 'fs'}); + this.services.push(this.fakegatoService); + } + setInterval(() => { this.logAccessory(); }, this.platform.loggerInterval); @@ -69,7 +83,7 @@ export class ContactSensorPlatformAccessory implements AccessoryPlugin { } getServices(): Service[] { - return [ this.information, this.service ]; + return this.services; } async getContactSensorState(): Promise { @@ -117,7 +131,7 @@ export class ContactSensorPlatformAccessory implements AccessoryPlugin { if (this.platform.loggerType == LoggerType.Fakegato) { - // this.fakegatoService.addEntry({time: Math.round(new Date().valueOf() / 1000), temp: this.sensStates.CurrentTemperature}); + this.fakegatoService.addEntry({time: Math.round(new Date().valueOf() / 1000), contact: this.sensStates.ContactSensorState}); } From 2fbb7fd45d5ef80a9bcbb3b070d7b9f7a64346e8 Mon Sep 17 00:00:00 2001 From: Tellicious Date: Fri, 17 Nov 2023 15:16:52 +0100 Subject: [PATCH 04/12] Added fakegato logging to motion sensor --- src/sensors/motionSensorPlatformAccessory.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/sensors/motionSensorPlatformAccessory.ts b/src/sensors/motionSensorPlatformAccessory.ts index c6664ad..31b87dd 100644 --- a/src/sensors/motionSensorPlatformAccessory.ts +++ b/src/sensors/motionSensorPlatformAccessory.ts @@ -13,6 +13,9 @@ export class MotionSensorPlatformAccessory implements AccessoryPlugin { private service: Service; private information: Service; + private fakegatoService: any; + public services: Service[]; + private platform: any; private device: any; private logging: number; @@ -32,6 +35,9 @@ export class MotionSensorPlatformAccessory implements AccessoryPlugin { this.device = device; this.logging = this.device.logging || 0; + this.fakegatoService = []; + this.services = []; + this.errorCheck(); this.service = new this.api.hap.Service.MotionSensor(this.device.name); @@ -45,6 +51,8 @@ export class MotionSensorPlatformAccessory implements AccessoryPlugin { .setCharacteristic(this.api.hap.Characteristic.SerialNumber, md5(this.device.name + this.model)) .setCharacteristic(this.api.hap.Characteristic.FirmwareRevision, this.platform.firmwareRevision); + this.services.push(this.service, this.information); + this.updateMotionDetectedQueued = false; if (this.platform.config.updateInterval) { @@ -54,6 +62,12 @@ export class MotionSensorPlatformAccessory implements AccessoryPlugin { } if (this.logging) { + + if (this.platform.loggerType == LoggerType.Fakegato) { + this.fakegatoService = new this.platform.FakeGatoHistoryService("custom", this, {storage: 'fs'}); + this.services.push(this.fakegatoService); + } + setInterval(() => { this.logAccessory(); }, this.platform.loggerInterval); @@ -69,7 +83,7 @@ export class MotionSensorPlatformAccessory implements AccessoryPlugin { } getServices(): Service[] { - return [ this.information, this.service ]; + return this.services; } async getMotionDetected(): Promise { @@ -117,7 +131,7 @@ export class MotionSensorPlatformAccessory implements AccessoryPlugin { if (this.platform.loggerType == LoggerType.Fakegato) { - // this.fakegatoService.addEntry({time: Math.round(new Date().valueOf() / 1000), temp: this.sensStates.CurrentTemperature}); + this.fakegatoService.addEntry({time: Math.round(new Date().valueOf() / 1000), motion: this.sensStates.MotionDetected}); } From 0e3aef1a48a6792506e3188e3fe7cf2415630ee4 Mon Sep 17 00:00:00 2001 From: Tellicious Date: Fri, 17 Nov 2023 15:19:14 +0100 Subject: [PATCH 05/12] Added fakegato logging to light sensor --- src/sensors/lightSensorPlatformAccessory.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/sensors/lightSensorPlatformAccessory.ts b/src/sensors/lightSensorPlatformAccessory.ts index 0217b9d..e389a6d 100644 --- a/src/sensors/lightSensorPlatformAccessory.ts +++ b/src/sensors/lightSensorPlatformAccessory.ts @@ -13,6 +13,9 @@ export class LightSensorPlatformAccessory implements AccessoryPlugin { private service: Service; private information: Service; + private fakegatoService: any; + public services: Service[]; + private platform: any; private device: any; private logging: number; @@ -34,6 +37,9 @@ export class LightSensorPlatformAccessory implements AccessoryPlugin { this.device = device; this.logging = this.device.logging || 0; + this.fakegatoService = []; + this.services = []; + this.errorCheck(); this.service = new this.api.hap.Service.LightSensor(this.device.name); @@ -47,6 +53,8 @@ export class LightSensorPlatformAccessory implements AccessoryPlugin { .setCharacteristic(this.api.hap.Characteristic.SerialNumber, md5(this.device.name + this.model)) .setCharacteristic(this.api.hap.Characteristic.FirmwareRevision, this.platform.firmwareRevision); + this.services.push(this.service, this.information); + this.updateCurrentAmbientLightLevelQueued = false; if (this.platform.config.updateInterval) { @@ -56,6 +64,12 @@ export class LightSensorPlatformAccessory implements AccessoryPlugin { } if (this.logging) { + + if (this.platform.loggerType == LoggerType.Fakegato) { + this.fakegatoService = new this.platform.FakeGatoHistoryService("custom", this, {storage: 'fs'}); + this.services.push(this.fakegatoService); + } + setInterval(() => { this.logAccessory(); }, this.platform.loggerInterval); @@ -71,7 +85,7 @@ export class LightSensorPlatformAccessory implements AccessoryPlugin { } getServices(): Service[] { - return [ this.information, this.service ]; + return this.services; } async getCurrentAmbientLightLevel(): Promise { @@ -125,7 +139,7 @@ export class LightSensorPlatformAccessory implements AccessoryPlugin { if (this.platform.loggerType == LoggerType.Fakegato) { - // this.fakegatoService.addEntry({time: Math.round(new Date().valueOf() / 1000), temp: this.sensStates.CurrentTemperature}); + this.fakegatoService.addEntry({time: Math.round(new Date().valueOf() / 1000), lux: this.sensStates.CurrentAmbientLightLevel}); } From 36254ce43eef2185a72f51a6593de9a9b4e5a04d Mon Sep 17 00:00:00 2001 From: Tellicious Date: Fri, 17 Nov 2023 15:28:06 +0100 Subject: [PATCH 06/12] Added fakegato logging to switch accessory --- src/accessories/switchPlatformAccessory.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/accessories/switchPlatformAccessory.ts b/src/accessories/switchPlatformAccessory.ts index 0db2dd3..9c55ffb 100644 --- a/src/accessories/switchPlatformAccessory.ts +++ b/src/accessories/switchPlatformAccessory.ts @@ -16,6 +16,9 @@ export class SwitchPlatformAccessory implements AccessoryPlugin { private service: Service; private information: Service; + private fakegatoService: any; + public services: Service[]; + private platform: any; private device: any; private pushButton: number; @@ -37,6 +40,9 @@ export class SwitchPlatformAccessory implements AccessoryPlugin { this.pushButton = this.device.pushButton || this.platform.pushButton; this.logging = this.device.logging || 0; + this.fakegatoService = []; + this.services = []; + this.errorCheck(); this.service = new this.api.hap.Service.Switch(this.device.name); @@ -51,6 +57,8 @@ export class SwitchPlatformAccessory implements AccessoryPlugin { .setCharacteristic(this.api.hap.Characteristic.SerialNumber, md5(this.device.name + this.model)) .setCharacteristic(this.api.hap.Characteristic.FirmwareRevision, this.platform.firmwareRevision); + this.services.push(this.service, this.information); + this.updateOnQueued = false; if (this.platform.config.updateInterval) { @@ -68,13 +76,19 @@ export class SwitchPlatformAccessory implements AccessoryPlugin { } errorCheck() { + + if (this.platform.loggerType == LoggerType.Fakegato) { + this.fakegatoService = new this.platform.FakeGatoHistoryService("switch", this, {storage: 'fs'}); + this.services.push(this.fakegatoService); + } + if (!this.device.switchGet || !this.device.switchSetOn || !this.device.switchSetOff) { this.platform.log.error('[%s] One or more LOGO! Addresses are not correct!', this.device.name); } } getServices(): Service[] { - return [ this.information, this.service ]; + return this.services; } async setOn(value: CharacteristicValue) { @@ -141,7 +155,7 @@ export class SwitchPlatformAccessory implements AccessoryPlugin { if (this.platform.loggerType == LoggerType.Fakegato) { - // this.fakegatoService.addEntry({time: Math.round(new Date().valueOf() / 1000), temp: this.sensStates.CurrentTemperature}); + this.fakegatoService.addEntry({time: Math.round(new Date().valueOf() / 1000), status: this.accStates.On}); } From c4b88fab7a365a9a0c3a53e55be520f1dcef5fcb Mon Sep 17 00:00:00 2001 From: Tellicious Date: Fri, 17 Nov 2023 16:53:39 +0100 Subject: [PATCH 07/12] Added fakegato logging to lightbulb accessory --- src/accessories/lightbulbPlatformAccessory.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/accessories/lightbulbPlatformAccessory.ts b/src/accessories/lightbulbPlatformAccessory.ts index 1057ec0..458ab89 100644 --- a/src/accessories/lightbulbPlatformAccessory.ts +++ b/src/accessories/lightbulbPlatformAccessory.ts @@ -13,6 +13,9 @@ export class LightbulbPlatformAccessory implements AccessoryPlugin { private service: Service; private information: Service; + private fakegatoService: any; + public services: Service[]; + private platform: any; private device: any; private pushButton: number; @@ -36,6 +39,9 @@ export class LightbulbPlatformAccessory implements AccessoryPlugin { this.pushButton = this.device.pushButton || this.platform.pushButton; this.logging = this.device.logging || 0; + this.fakegatoService = []; + this.services = []; + this.errorCheck(); this.service = new this.api.hap.Service.Lightbulb(this.device.name); @@ -54,6 +60,8 @@ export class LightbulbPlatformAccessory implements AccessoryPlugin { .setCharacteristic(this.api.hap.Characteristic.SerialNumber, md5(this.device.name + this.model)) .setCharacteristic(this.api.hap.Characteristic.FirmwareRevision, this.platform.firmwareRevision); + this.services.push(this.service, this.information); + this.updateBrightnessQueued = false; this.updateOnQueued = false; @@ -65,6 +73,12 @@ export class LightbulbPlatformAccessory implements AccessoryPlugin { } if (this.logging) { + + if (this.platform.loggerType == LoggerType.Fakegato) { + this.fakegatoService = new this.platform.FakeGatoHistoryService("custom", this, {storage: 'fs'}); + this.services.push(this.fakegatoService); + } + setInterval(() => { this.logAccessory(); }, this.platform.loggerInterval); @@ -80,7 +94,7 @@ export class LightbulbPlatformAccessory implements AccessoryPlugin { } getServices(): Service[] { - return [ this.information, this.service ]; + return this.services; } async setOn(value: CharacteristicValue) { @@ -198,7 +212,7 @@ export class LightbulbPlatformAccessory implements AccessoryPlugin { if (this.platform.loggerType == LoggerType.Fakegato) { - // this.fakegatoService.addEntry({time: Math.round(new Date().valueOf() / 1000), temp: this.sensStates.CurrentTemperature}); + this.fakegatoService.addEntry({time: Math.round(new Date().valueOf() / 1000), status: this.accStates.On}); } From c5907c7ad7e472abd0311326e1bba79b8bbd6503 Mon Sep 17 00:00:00 2001 From: Tellicious Date: Fri, 17 Nov 2023 16:53:52 +0100 Subject: [PATCH 08/12] Added fakegato logging to outlet accessory --- src/accessories/outletPlatformAccessory.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/accessories/outletPlatformAccessory.ts b/src/accessories/outletPlatformAccessory.ts index 91362b2..7b3a422 100644 --- a/src/accessories/outletPlatformAccessory.ts +++ b/src/accessories/outletPlatformAccessory.ts @@ -16,6 +16,9 @@ export class OutletPlatformAccessory implements AccessoryPlugin { private service: Service; private information: Service; + private fakegatoService: any; + public services: Service[]; + private platform: any; private device: any; private pushButton: number; @@ -41,6 +44,9 @@ export class OutletPlatformAccessory implements AccessoryPlugin { this.logging = this.device.logging || 0; this.inUseIsSet = false; + this.fakegatoService = []; + this.services = []; + this.errorCheck(); this.service = new this.api.hap.Service.Outlet(this.device.name); @@ -58,6 +64,8 @@ export class OutletPlatformAccessory implements AccessoryPlugin { .setCharacteristic(this.api.hap.Characteristic.SerialNumber, md5(this.device.name + this.model)) .setCharacteristic(this.api.hap.Characteristic.FirmwareRevision, this.platform.firmwareRevision); + this.services.push(this.service, this.information); + this.updateOnQueued = false; this.updateInUseQueued = false; @@ -71,6 +79,12 @@ export class OutletPlatformAccessory implements AccessoryPlugin { } if (this.logging) { + + if (this.platform.loggerType == LoggerType.Fakegato) { + this.fakegatoService = new this.platform.FakeGatoHistoryService("custom", this, {storage: 'fs'}); + this.services.push(this.fakegatoService); + } + setInterval(() => { this.logAccessory(); }, this.platform.loggerInterval); @@ -89,7 +103,7 @@ export class OutletPlatformAccessory implements AccessoryPlugin { } getServices(): Service[] { - return [ this.information, this.service ]; + return this.services; } async setOn(value: CharacteristicValue) { @@ -198,7 +212,7 @@ export class OutletPlatformAccessory implements AccessoryPlugin { if (this.platform.loggerType == LoggerType.Fakegato) { - // this.fakegatoService.addEntry({time: Math.round(new Date().valueOf() / 1000), temp: this.sensStates.CurrentTemperature}); + this.fakegatoService.addEntry({time: Math.round(new Date().valueOf() / 1000), status: this.accStates.On}); } From 4593724366f28d216ca18cd0f51af8bf97747dd2 Mon Sep 17 00:00:00 2001 From: Tellicious Date: Fri, 17 Nov 2023 16:54:09 +0100 Subject: [PATCH 09/12] Added fakegato logging to thermostat accessory --- src/accessories/thermostatPlatformAccessory.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/accessories/thermostatPlatformAccessory.ts b/src/accessories/thermostatPlatformAccessory.ts index 83dbe71..5eb35af 100644 --- a/src/accessories/thermostatPlatformAccessory.ts +++ b/src/accessories/thermostatPlatformAccessory.ts @@ -13,6 +13,9 @@ export class ThermostatPlatformAccessory implements AccessoryPlugin { private service: Service; private information: Service; + private fakegatoService: any; + public services: Service[]; + private platform: any; private device: any; private pushButton: number; @@ -43,6 +46,9 @@ export class ThermostatPlatformAccessory implements AccessoryPlugin { this.pushButton = this.device.pushButton || this.platform.pushButton; this.logging = this.device.logging || 0; + this.fakegatoService = []; + this.services = []; + this.errorCheck(); this.service = new this.api.hap.Service.Thermostat(this.device.name); @@ -70,6 +76,8 @@ export class ThermostatPlatformAccessory implements AccessoryPlugin { .setCharacteristic(this.api.hap.Characteristic.SerialNumber, md5(this.device.name + this.model)) .setCharacteristic(this.api.hap.Characteristic.FirmwareRevision, this.platform.firmwareRevision); + this.services.push(this.service, this.information); + this.updateCurrentHeatingCoolingStateQueued = false; this.updateTargetHeatingCoolingStateQueued = false; this.updateCurrentTemperatureQueued = false; @@ -85,6 +93,12 @@ export class ThermostatPlatformAccessory implements AccessoryPlugin { } if (this.logging) { + + if (this.platform.loggerType == LoggerType.Fakegato) { + this.fakegatoService = new this.platform.FakeGatoHistoryService("custom", this, {storage: 'fs'}); + this.services.push(this.fakegatoService); + } + setInterval(() => { this.logAccessory(); }, this.platform.loggerInterval); @@ -101,7 +115,7 @@ export class ThermostatPlatformAccessory implements AccessoryPlugin { } getServices(): Service[] { - return [ this.information, this.service ]; + return this.services; } async setTargetHeatingCoolingState(value: CharacteristicValue) { @@ -320,7 +334,7 @@ export class ThermostatPlatformAccessory implements AccessoryPlugin { if (this.platform.loggerType == LoggerType.Fakegato) { - // this.fakegatoService.addEntry({time: Math.round(new Date().valueOf() / 1000), temp: this.sensStates.CurrentTemperature}); + this.fakegatoService.addEntry({time: Math.round(new Date().valueOf() / 1000), temp: this.accStates.CurrentTemperature, setTemp: this.accStates.TargetTemperature}); } From 91ffec656929f944521dff947909ba13656adb6d Mon Sep 17 00:00:00 2001 From: Sinclair81 Date: Sat, 18 Nov 2023 11:13:41 +0100 Subject: [PATCH 10/12] Added logging capability to Eve App --- ChangeLog.md | 7 +++++++ README.md | 16 ++++++++-------- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index d573344..38fb309 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,10 @@ +# 1.4.1 # + +Added logging capability to Eve App to several sensor and accessories.
+Accessorys: switch, lightbulb, outlet, thermostat +Sensors: motion, contact, CO2, humidity +More information about this in the README on GitHub.
+ # 1.4.0 # Change from node-snap7 to napi-snap7.
diff --git a/README.md b/README.md index eab07b2..a7c3738 100644 --- a/README.md +++ b/README.md @@ -615,24 +615,24 @@ Name | Value | Required | Option for | Notes | Type | Characteristic | InfluxDB | Eve App | |-----------------------|----------------------------------------------------------------------------------------------------|---------------------------------|----------------------------| -| Switch | On | yes | no | -| Lightbulb | On
Brightness | yes
yes | no
no | +| Switch | On | yes | yes | +| Lightbulb | On
Brightness | yes
yes | yes
no | | Blind | CurrentPosition
PositionState
TargetPosition | yes
yes
yes | no
no
no | | Window | CurrentPosition
PositionState
TargetPosition | yes
yes
yes | no
no
no | | Garage Door | CurrentDoorState
TargetDoorState
ObstructionDetected | yes
yes
yes | no
no
no | -| Thermostat | CurrentHeatingCoolingState
TargetHeatingCoolingState
CurrentTemperature
TargetTemperature | yes
yes
yes
yes | no
no
no
no | +| Thermostat | CurrentHeatingCoolingState
TargetHeatingCoolingState
CurrentTemperature
TargetTemperature | yes
yes
yes
yes | no
no
yes
yes | | Irrigation System | Active
ProgramMode
InUse
RemainingDuration
WaterLevel | yes
yes
yes
yes
yes | no
no
no
no
no | | Valve | Active
InUse
RemainingDuration
SetDuration
IsConfigured | yes
yes
yes
yes
yes | no
no
no
no
no | | Fan | On
RotationDirection
RotationSpeed | yes
yes
yes | no
no
no | | Filter Maintenance | FilterChangeIndication
FilterLifeLevel
ResetFilterIndication | yes
yes
yes | no
no
no | -| Outlet | On
InUse | yes
yes | no
no | +| Outlet | On
InUse | yes
yes | yes
no | | Light Sensor | CurrentAmbientLightLevel | yes | no | -| Motion Sensor | MotionDetected | yes | no | -| Contact Sensor | ContactSensorState | yes | no | +| Motion Sensor | MotionDetected | yes | yes | +| Contact Sensor | ContactSensorState | yes | yes | | Smoke Sensor | SmokeDetected | yes | no | | Temperature Sensor | CurrentTemperature | yes | yes | -| Humidity Sensor | CurrentRelativeHumidity | yes | no | -| Carbon Dioxide Sensor | CarbonDioxideDetected
CarbonDioxideLevel
CarbonDioxidePeakLevel | yes
yes
yes | no
no
no | +| Humidity Sensor | CurrentRelativeHumidity | yes | yes | +| Carbon Dioxide Sensor | CarbonDioxideDetected
CarbonDioxideLevel
CarbonDioxidePeakLevel | yes
yes
yes | no
yes
no | | Air Quality Sensor | AirQuality | yes | no | | Leak Sensor | LeakDetected
WaterLevel | yes
yes | no
no | diff --git a/package-lock.json b/package-lock.json index bc4ffda..a7fb573 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "homebridge-logo-platform", - "version": "1.4.0", + "version": "1.4.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "homebridge-logo-platform", - "version": "1.4.0", + "version": "1.4.1", "license": "---", "dependencies": { "@influxdata/influxdb-client": "^1.33.2", diff --git a/package.json b/package.json index 889316b..aa0ab7f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "displayName": "Homebridge Logo Platform", "name": "homebridge-logo-platform", - "version": "1.4.0", + "version": "1.4.1", "model": "Logo Platform", "description": "This is a Siemens LOGO! Platform Plugin.", "license": "---", From 2fba21cab3d2f51d0e73adf72593c0d4996323d2 Mon Sep 17 00:00:00 2001 From: Sinclair81 Date: Sat, 18 Nov 2023 11:23:53 +0100 Subject: [PATCH 11/12] Update ChangeLog.md --- ChangeLog.md | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 38fb309..9b2084a 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,17 +1,21 @@ # 1.4.1 # -Added logging capability to Eve App to several sensor and accessories.
-Accessorys: switch, lightbulb, outlet, thermostat -Sensors: motion, contact, CO2, humidity +## Added logging capability to Eve App to several sensor and accessories ## + +Accessorys: switch, lightbulb, outlet, thermostat
+Sensors: motion, contact, CO2, humidity
More information about this in the README on GitHub.
# 1.4.0 # -Change from node-snap7 to napi-snap7.
+## Change from node-snap7 to napi-snap7 ## + +To ensure compatibility with Node.js 18.x and 20.x. # 1.3.8 # -Adding logging of all values to an InfluxDB.
+## Adding logging of all values to an InfluxDB ## + And as a test, log a temperature using Fakegato in the Eve app.
More information about this in the README on GitHub.
@@ -21,40 +25,40 @@ Added logging for all accessories and sensors.
For [Homebridge-Logging](https://github.com/Sinclair81/Homebridge-Logging) or any other freely configurable udp server for logging.
# 1.3.6 # - + Integrated valve as sub-accessory of IrrigationSystem.
Fix pushButton in all Accessories.
# 1.3.5 # - + Hotfix for no Snap7 in Node.js versions 19.x and 20.x!
# 1.3.4 # - + Add Outlet Accessory.
# 1.3.3 # - + Bugfix to avoid memory leak.
- + # 1.3.2 # - + Reading of negative numbers and error handling improved, in Modbus and Snap7.
- + # 1.3.1 # - + Removed unnecessary debug messages.
- + # 1.3.0 # - + ## Snap7 Support ## - + From now on, the S7 protocol via Snap7 is also supported in this plug-in.
- + # 1.2.0 # - + ## Improvements in Garagedoor Accessory ## - + Add functionality to read digital state values for CurrentDoorState and TargetDoorState.
The digital status for open and closed is on purpose reversed.
Analog - 0 = Open; 1 = Closed; 2 = Opening; 3 = Closing; 4 = Stopped;
From 2b9a46afc1f26aa45bfa7a9e5e562e4fbc483c75 Mon Sep 17 00:00:00 2001 From: Sinclair81 Date: Sat, 18 Nov 2023 11:55:44 +0100 Subject: [PATCH 12/12] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a7c3738..021e1b1 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,10 @@ __Examples:__ ## Thanks to ## -- [Tellicious](https://github.com/Tellicious) for Integrated valve as sub-accessory of IrrigationSystem and his Bugfix to avoid memory leak. +- [Tellicious](https://github.com/Tellicious) for: + - Adding logging to the Eve app. + - Integrated valve as sub-accessory of IrrigationSystem. + - His Bugfix to avoid memory leak. ## Special thanks to ##