matterbridge-eve-weather 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,22 @@
1
+ # <img src="https://github.com/Luligu/matterbridge/blob/main/frontend/public/matterbridge%2064x64.png" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge eve weather with history
2
+
3
+ [![npm version](https://img.shields.io/npm/v/matterbridge-eve-weather.svg)](https://www.npmjs.com/package/matterbridge-eve-weather)
4
+ [![npm downloads](https://img.shields.io/npm/dt/matterbridge-eve-weather.svg)](https://www.npmjs.com/package/matterbridge-eve-weather)
5
+
6
+ [![power by](https://img.shields.io/badge/powered%20by-matterbridge-blue)](https://www.npmjs.com/package/matterbridge)
7
+ [![power by](https://img.shields.io/badge/powered%20by-matter--history-blue)](https://www.npmjs.com/package/matter-history)
8
+ [![power by](https://img.shields.io/badge/powered%20by-node--ansi--logger-blue)](https://www.npmjs.com/package/node-ansi-logger)
9
+ [![power by](https://img.shields.io/badge/powered%20by-node--persist--manager-blue)](https://www.npmjs.com/package/node-persist-manager)
10
+
11
+ ---
12
+
13
+ This plugin shows how to use the Matter history and how to create passive device in matter.js.
14
+
15
+ It create a climate sensor device with pressure temperature (min and max) and humidity that continuously changes state.
16
+
17
+ ## Prerequisites
18
+
19
+ ### Matterbridge
20
+
21
+ See the guidelines on [Matterbridge](https://github.com/Luligu/matterbridge/blob/main/README.md) for more information.
22
+
@@ -0,0 +1,11 @@
1
+ import { Matterbridge, PlatformConfig } from 'matterbridge';
2
+ import { AnsiLogger } from 'node-ansi-logger';
3
+ import { EveWeatherPlatform as EveWeatherPlatform } from './platform.js';
4
+ /**
5
+ * This is the standard interface for MatterBridge plugins.
6
+ * Each plugin should export a default function that follows this signature.
7
+ *
8
+ * @param matterbridge - An instance of MatterBridge
9
+ */
10
+ export default function initializePlugin(matterbridge: Matterbridge, log: AnsiLogger, config: PlatformConfig): EveWeatherPlatform;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEzE;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,YAAY,EAAE,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,sBAE3G"}
package/dist/index.js ADDED
@@ -0,0 +1,11 @@
1
+ import { EveWeatherPlatform as EveWeatherPlatform } from './platform.js';
2
+ /**
3
+ * This is the standard interface for MatterBridge plugins.
4
+ * Each plugin should export a default function that follows this signature.
5
+ *
6
+ * @param matterbridge - An instance of MatterBridge
7
+ */
8
+ export default function initializePlugin(matterbridge, log, config) {
9
+ return new EveWeatherPlatform(matterbridge, log, config);
10
+ }
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEzE;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,YAA0B,EAAE,GAAe,EAAE,MAAsB;IAC1G,OAAO,IAAI,kBAAkB,CAAC,YAAY,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;AAC3D,CAAC"}
@@ -0,0 +1,14 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ import { PlatformConfig } from 'matterbridge';
3
+ import { Matterbridge, MatterbridgeDevice, MatterbridgeAccessoryPlatform, MatterHistory } from 'matterbridge';
4
+ import { AnsiLogger } from 'node-ansi-logger';
5
+ export declare class EveWeatherPlatform extends MatterbridgeAccessoryPlatform {
6
+ weather: MatterbridgeDevice | undefined;
7
+ history: MatterHistory | undefined;
8
+ interval: NodeJS.Timeout | undefined;
9
+ constructor(matterbridge: Matterbridge, log: AnsiLogger, config: PlatformConfig);
10
+ onStart(reason?: string): Promise<void>;
11
+ onConfigure(): Promise<void>;
12
+ onShutdown(reason?: string): Promise<void>;
13
+ }
14
+ //# sourceMappingURL=platform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":";AAAA,OAAO,EAA2B,cAAc,EAAgI,MAAM,cAAc,CAAC;AAErM,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC9G,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,qBAAa,kBAAmB,SAAQ,6BAA6B;IACnE,OAAO,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACxC,OAAO,EAAE,aAAa,GAAG,SAAS,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC;gBAEzB,YAAY,EAAE,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc;IAIhE,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM;IAoCvB,WAAW;IAuCX,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM;CAM1C"}
@@ -0,0 +1,80 @@
1
+ import { DeviceTypes, EveHistory, PowerSource, PressureMeasurement, RelativeHumidityMeasurement, TemperatureMeasurement } from 'matterbridge';
2
+ import { MatterbridgeDevice, MatterbridgeAccessoryPlatform, MatterHistory } from 'matterbridge';
3
+ export class EveWeatherPlatform extends MatterbridgeAccessoryPlatform {
4
+ weather;
5
+ history;
6
+ interval;
7
+ constructor(matterbridge, log, config) {
8
+ super(matterbridge, log, config);
9
+ }
10
+ async onStart(reason) {
11
+ this.log.info('onStart called with reason:', reason ?? 'none');
12
+ this.history = new MatterHistory(this.log, 'Eve weather', { filePath: this.matterbridge.matterbridgeDirectory });
13
+ this.weather = new MatterbridgeDevice(DeviceTypes.TEMPERATURE_SENSOR);
14
+ this.weather.createDefaultIdentifyClusterServer();
15
+ this.weather.createDefaultBasicInformationClusterServer('Eve weather', '0x84286995', 4874, 'Eve Systems', 0x57, 'Eve Weather 20EBS9901', 2996, '2.1.3', 1, '1.1');
16
+ this.weather.createDefaultTemperatureMeasurementClusterServer(20 * 100);
17
+ this.weather.addDeviceType(DeviceTypes.HUMIDITY_SENSOR);
18
+ this.weather.createDefaultRelativeHumidityMeasurementClusterServer(50 * 100);
19
+ this.weather.addDeviceType(DeviceTypes.PRESSURE_SENSOR);
20
+ this.weather.createDefaultPressureMeasurementClusterServer(950);
21
+ this.weather.createDefaultPowerSourceReplaceableBatteryClusterServer(87, PowerSource.BatChargeLevel.Ok, 1500, 'CR2450', 1);
22
+ //weather.createDefaultPowerSourceConfigurationClusterServer(1);
23
+ // Add the EveHistory cluster to the device as last cluster!
24
+ this.weather.createWeatherEveHistoryClusterServer(this.history, this.log);
25
+ this.history.autoPilot(this.weather);
26
+ await this.registerDevice(this.weather);
27
+ this.weather.addCommandHandler('identify', async ({ request: { identifyTime } }) => {
28
+ this.log.warn(`Command identify called identifyTime:${identifyTime}`);
29
+ this.history?.logHistory(false);
30
+ });
31
+ this.weather.getClusterServerById(EveHistory.Cluster.id)?.setElevationAttribute(250); // Elevation in mt
32
+ this.weather.getClusterServerById(EveHistory.Cluster.id)?.setWeatherTrendAttribute(1 /* WeatherTrend.SUN */);
33
+ this.weather.getClusterServerById(EveHistory.Cluster.id)?.setTemperatureDisplayUnitsAttribute(0 /* TemperatureDisplayUnits.CELSIUS */);
34
+ this.weather.getClusterServerById(EveHistory.Cluster.id)?.setAirPressureAttribute(950);
35
+ }
36
+ async onConfigure() {
37
+ this.log.info('onConfigure called');
38
+ let minTemperature = 0;
39
+ let maxTemperature = 0;
40
+ this.interval = setInterval(() => {
41
+ if (!this.weather || !this.history)
42
+ return;
43
+ const temperature = this.history.getFakeLevel(10, 30, 2);
44
+ if (minTemperature === 0)
45
+ minTemperature = temperature;
46
+ if (maxTemperature === 0)
47
+ maxTemperature = temperature;
48
+ minTemperature = Math.min(minTemperature, temperature);
49
+ maxTemperature = Math.max(maxTemperature, temperature);
50
+ const humidity = this.history.getFakeLevel(1, 99, 2);
51
+ const pressure = this.history.getFakeLevel(700, 1100, 1);
52
+ this.weather.getClusterServerById(TemperatureMeasurement.Cluster.id)?.setMeasuredValueAttribute(temperature * 100);
53
+ this.weather.getClusterServerById(TemperatureMeasurement.Cluster.id)?.setMinMeasuredValueAttribute(minTemperature * 100);
54
+ this.weather.getClusterServerById(TemperatureMeasurement.Cluster.id)?.setMaxMeasuredValueAttribute(maxTemperature * 100);
55
+ this.weather.getClusterServerById(TemperatureMeasurement.Cluster.id)?.setMeasuredValueAttribute(temperature * 100);
56
+ this.weather.getClusterServerById(RelativeHumidityMeasurement.Cluster.id)?.setMeasuredValueAttribute(humidity * 100);
57
+ this.weather.getClusterServerById(PressureMeasurement.Cluster.id)?.setMeasuredValueAttribute(pressure);
58
+ if (pressure < 800)
59
+ this.weather.getClusterServerById(EveHistory.Cluster.id)?.setWeatherTrendAttribute(12 /* WeatherTrend.RAIN_WIND */);
60
+ else if (pressure < 900)
61
+ this.weather.getClusterServerById(EveHistory.Cluster.id)?.setWeatherTrendAttribute(5 /* WeatherTrend.RAIN */);
62
+ else if (pressure < 1000)
63
+ this.weather.getClusterServerById(EveHistory.Cluster.id)?.setWeatherTrendAttribute(3 /* WeatherTrend.CLOUDS_SUN */);
64
+ else
65
+ this.weather.getClusterServerById(EveHistory.Cluster.id)?.setWeatherTrendAttribute(1 /* WeatherTrend.SUN */);
66
+ // The Eve app doesn't read the pressure from the PressureMeasurement cluster (Home app doesn't have it!), so we set it in the EveHistory cluster
67
+ this.weather.getClusterServerById(EveHistory.Cluster.id)?.setAirPressureAttribute(pressure);
68
+ this.history.setMaxMinTemperature(maxTemperature, minTemperature);
69
+ this.history.addEntry({ time: this.history.now(), temperature, humidity, pressure });
70
+ this.log.info(`Set temperature: ${temperature} (min: ${minTemperature} max: ${maxTemperature}) humidity: ${humidity} pressure: ${pressure}`);
71
+ }, 60 * 1000 - 100);
72
+ }
73
+ async onShutdown(reason) {
74
+ this.log.info('onShutdown called with reason:', reason ?? 'none');
75
+ await this.history?.close();
76
+ clearInterval(this.interval);
77
+ await this.unregisterAllDevices();
78
+ }
79
+ }
80
+ //# sourceMappingURL=platform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAkB,WAAW,EAAE,mBAAmB,EAAE,2BAA2B,EAA2B,sBAAsB,EAAgB,MAAM,cAAc,CAAC;AAErM,OAAO,EAAgB,kBAAkB,EAAE,6BAA6B,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG9G,MAAM,OAAO,kBAAmB,SAAQ,6BAA6B;IACnE,OAAO,CAAiC;IACxC,OAAO,CAA4B;IACnC,QAAQ,CAA6B;IAErC,YAAY,YAA0B,EAAE,GAAe,EAAE,MAAsB;QAC7E,KAAK,CAAC,YAAY,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;IACnC,CAAC;IAEQ,KAAK,CAAC,OAAO,CAAC,MAAe;QACpC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,6BAA6B,EAAE,MAAM,IAAI,MAAM,CAAC,CAAC;QAE/D,IAAI,CAAC,OAAO,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,aAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,qBAAqB,EAAE,CAAC,CAAC;QAEjH,IAAI,CAAC,OAAO,GAAG,IAAI,kBAAkB,CAAC,WAAW,CAAC,kBAAkB,CAAC,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
4
+
5
+ exec(command, (error, stdout, stderr) => {
6
+ if (error) {
7
+ console.error(`exec error: ${error}`);
8
+ return;
9
+ }
10
+ console.log(`stdout: ${stdout}`);
11
+ if (stderr) {
12
+ console.error(`stderr: ${stderr}`);
13
+ }
14
+ });
package/package.json ADDED
@@ -0,0 +1,75 @@
1
+ {
2
+ "name": "matterbridge-eve-weather",
3
+ "version": "1.0.2",
4
+ "description": "Matterbridge eve weather with history",
5
+ "author": "https://github.com/Luligu",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "main": "dist/index.js",
9
+ "types": "dist/index.d.js",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/Luligu/matterbridge-eve-weather"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/Luligu/matterbridge-eve-weather/issues"
16
+ },
17
+ "keywords": [
18
+ "matterbridge",
19
+ "homebridge",
20
+ "matter",
21
+ "matter.js",
22
+ "plugin",
23
+ "eve",
24
+ "weather",
25
+ "temperature",
26
+ "humidity",
27
+ "pressure",
28
+ "history"
29
+ ],
30
+ "engines": {
31
+ "node": "^18.19.0 || ^20.11.0"
32
+ },
33
+ "scripts": {
34
+ "build": "tsc",
35
+ "watch": "tsc --watch",
36
+ "start:bridge": "matterbridge -bridge",
37
+ "start:childbridge": "matterbridge -childbridge",
38
+ "test": "jest",
39
+ "test:verbose": "jest --verbose",
40
+ "test:watch": "jest --watch",
41
+ "lint": "eslint src/**.ts",
42
+ "lint:fix": "eslint src/**.ts --fix",
43
+ "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,css,md}\"",
44
+ "format:check": "prettier --check \"src/**/*.{js,jsx,ts,tsx,json,css,md}\"",
45
+ "clean": "rimraf tsconfig.tsbuildinfo ./dist",
46
+ "cleanBuild": "npm run clean && tsc",
47
+ "deepClean": "rimraf tsconfig.tsbuildinfo package-lock.json ./dist ./node_modules",
48
+ "prepublishOnly": "npm run lint && npm run cleanBuild",
49
+ "checkDependencies": "npx npm-check-updates",
50
+ "updateDependencies": "npx npm-check-updates -u",
51
+ "matterbridge:add": "matterbridge -add .\\",
52
+ "matterbridge:remove": "matterbridge -remove .\\",
53
+ "matterbridge:enable": "matterbridge -enable .\\",
54
+ "matterbridge:disable": "matterbridge -disable .\\",
55
+ "matterbridge:list": "matterbridge -list",
56
+ "dev:link": "npm link --save-dev matterbridge",
57
+ "dev:install": "npm install --save-dev matterbridge",
58
+ "dev:uninstall": "npm uninstall matterbridge && npm unlink matterbridge",
59
+ "install": "node link-matterbridge-script.js"
60
+ },
61
+ "devDependencies": {
62
+ "@stylistic/eslint-plugin": "^1.7.0",
63
+ "@tsconfig/node-lts": "^20.1.1",
64
+ "@types/node": "^20.11.30",
65
+ "@typescript-eslint/eslint-plugin": "^7.3.1",
66
+ "@typescript-eslint/parser": "^7.3.1",
67
+ "eslint-config-prettier": "^9.1.0",
68
+ "eslint-plugin-prettier": "^5.1.3",
69
+ "prettier": "^3.2.5",
70
+ "typescript": "^5.4.3"
71
+ },
72
+ "dependencies": {
73
+ "node-ansi-logger": "^1.9.2"
74
+ }
75
+ }