iobroker.chargeamps1 0.1.9

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 michipi85 <sammer.michael.ms@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,63 @@
1
+ ![Logo](admin/chargeamps.png)
2
+
3
+ # Charge Amps for ioBroker
4
+ ### ioBroker adapter for Charge Amps Halo wallboxes via the Charge Amps External REST API.
5
+
6
+ This adapter uses the official Charge Amps External API at https://eapi.charge.space. You need a Charge Amps account and an External API key. Charge Amps documents the API at https://eapi.charge.space/swagger/index.html; according to the public Python reference client, the current API version used here is v5.
7
+
8
+ ## Features
9
+ - Login with email, password and External API key
10
+ - Poll owned charge points and connector status
11
+ - Expose current, voltage, total consumption, session and wallbox metadata
12
+ - Change wallbox settings: dimmer and down light
13
+ - Change connector settings: mode, RFID lock, cable lock and maximum current
14
+ - Commands for remote start, remote stop and reboot
15
+ - Convenience commands for connector mode: switch wallbox on, set wallbox to standby and use schedule
16
+
17
+ ## Configuration
18
+ Create an instance of the adapter and configure:
19
+
20
+ - email: Charge Amps account email
21
+ - password: Charge Amps account password
22
+ - apiKey: External API key from Charge Amps
23
+ - pollInterval: polling interval in seconds, minimum 30
24
+
25
+ - rfid, rfidFormat, rfidLength: optional values used for remoteStart.
26
+ For HEX RFID values, rfidLength is the byte length, not the number of HEX characters. Example: 8 HEX characters are 4 bytes. Set rfidLength to 0 to calculate it automatically.
27
+
28
+
29
+ ## Funktion
30
+
31
+ **The convenience commands change the connector mode:**
32
+
33
+ - enableCharging sets mode to On and switches the wallbox/connector on.
34
+ - disableCharging sets mode to Off and puts the wallbox/connector into standby.
35
+ - useSchedule sets mode to Schedule.
36
+
37
+
38
+ **Writable setting states:**
39
+
40
+ - settings.dimmer
41
+ - settings.downLight
42
+ - connectors.<connectorId>.settings.mode
43
+ - connectors.<connectorId>.settings.rfidLock
44
+ - connectors.<connectorId>.settings.cableLock
45
+ - connectors.<connectorId>.settings.maxCurrent
46
+
47
+
48
+ ## ToDo
49
+
50
+ - implement the Schedule function
51
+
52
+
53
+ ## Changelog
54
+ <!--
55
+ Placeholder for the next version (at the beginning of the line):
56
+ ### **WORK IN PROGRESS**
57
+ -->
58
+
59
+ ### **WORK IN PROGRESS**
60
+ * (michipi85) initial release
61
+
62
+ ## License
63
+ MIT License
Binary file
@@ -0,0 +1,117 @@
1
+ {
2
+ "type": "panel",
3
+ "items": {
4
+ "Account settings": {
5
+ "type": "header",
6
+ "text": "Account settings",
7
+ "size": 2,
8
+ "newLine": true
9
+ },
10
+ "email": {
11
+ "type": "text",
12
+ "label": "Charge Amps email",
13
+ "newLine": true,
14
+ "xs": 12,
15
+ "sm": 12,
16
+ "md": 12,
17
+ "lg": 12,
18
+ "xl": 12
19
+ },
20
+ "password": {
21
+ "type": "password",
22
+ "label": "Charge Amps password",
23
+ "newLine": true,
24
+ "xs": 12,
25
+ "sm": 12,
26
+ "md": 8,
27
+ "lg": 3,
28
+ "xl": 3
29
+ },
30
+ "apiKey": {
31
+ "type": "password",
32
+ "label": "External API key",
33
+ "xs": 12,
34
+ "sm": 12,
35
+ "md": 8,
36
+ "lg": 3,
37
+ "xl": 3
38
+ },
39
+
40
+ "Api settings": {
41
+ "type": "header",
42
+ "text": "Api settings",
43
+ "size": 2,
44
+ "newLine": true
45
+ },
46
+
47
+ "apiBaseUrl": {
48
+ "type": "text",
49
+ "label": "API base URL",
50
+ "newLine": true,
51
+ "xs": 12,
52
+ "sm": 12,
53
+ "md": 8,
54
+ "lg": 3,
55
+ "xl": 3
56
+ },
57
+ "pollInterval": {
58
+ "type": "number",
59
+ "label": "Poll interval in seconds",
60
+ "min": 30,
61
+ "xs": 12,
62
+ "sm": 12,
63
+ "md": 8,
64
+ "lg": 3,
65
+ "xl": 3
66
+ },
67
+
68
+ "RFID settings": {
69
+ "type": "header",
70
+ "text": "RFID settings (for remote start)",
71
+ "size": 2,
72
+ "newLine": true,
73
+ "xs": 12,
74
+ "sm": 12,
75
+ "md": 8,
76
+ "lg": 4,
77
+ "xl": 4
78
+ },
79
+
80
+ "rfid": {
81
+ "type": "text",
82
+ "label": "RFID for remote start",
83
+ "newLine": true
84
+ },
85
+ "rfidFormat": {
86
+ "type": "select",
87
+ "label": "RFID format",
88
+ "options": [
89
+ {
90
+ "label": "Hex",
91
+ "value": "Hex"
92
+ },
93
+ {
94
+ "label": "Decimal",
95
+ "value": "Decimal"
96
+ }
97
+ ],
98
+ "newLine": true,
99
+ "xs": 12,
100
+ "sm": 12,
101
+ "md": 8,
102
+ "lg": 4,
103
+ "xl": 4
104
+ },
105
+ "rfidLength": {
106
+ "type": "number",
107
+ "label": "RFID length (HEX: bytes, Decimal: digits)",
108
+ "help": "For HEX values, enter the byte length, e.g. 4 for an 8-character HEX RFID. Leave 0 to calculate automatically.",
109
+ "min": 0,
110
+ "xs": 12,
111
+ "sm": 12,
112
+ "md": 8,
113
+ "lg": 4,
114
+ "xl": 4
115
+ }
116
+ }
117
+ }
@@ -0,0 +1,89 @@
1
+ export interface ChargePointConnector {
2
+ chargePointId: string;
3
+ connectorId: number;
4
+ type: string;
5
+ }
6
+ export interface ChargePoint {
7
+ id: string;
8
+ name: string;
9
+ password?: string;
10
+ type: string;
11
+ isLoadbalanced: boolean;
12
+ firmwareVersion: string;
13
+ hardwareVersion: string;
14
+ connectors: ChargePointConnector[];
15
+ }
16
+ export interface Measurement {
17
+ phase: string;
18
+ current: number;
19
+ voltage: number;
20
+ }
21
+ export interface ConnectorStatus {
22
+ chargePointId: string;
23
+ connectorId: number;
24
+ totalConsumptionKwh: number;
25
+ status: string;
26
+ measurements?: Measurement[] | null;
27
+ startTime?: string | null;
28
+ endTime?: string | null;
29
+ sessionId?: number | null;
30
+ }
31
+ export interface ChargePointStatus {
32
+ id: string;
33
+ status: string;
34
+ connectorStatuses: ConnectorStatus[];
35
+ }
36
+ export interface ChargePointSettings {
37
+ id: string;
38
+ dimmer: string;
39
+ downLight: boolean;
40
+ }
41
+ export interface ConnectorSettings {
42
+ chargePointId: string;
43
+ connectorId: number;
44
+ mode: string;
45
+ rfidLock: boolean;
46
+ cableLock: boolean;
47
+ maxCurrent?: number | null;
48
+ }
49
+ export interface StartAuth {
50
+ rfidLength: number;
51
+ rfidFormat: string;
52
+ rfid: string;
53
+ externalTransactionId: string;
54
+ }
55
+ export interface ChargeAmpsApiOptions {
56
+ email: string;
57
+ password: string;
58
+ apiKey: string;
59
+ apiBaseUrl?: string;
60
+ fetchImpl?: typeof fetch;
61
+ now?: () => number;
62
+ }
63
+ export declare class ChargeAmpsApiError extends Error {
64
+ readonly status: number;
65
+ readonly body: string;
66
+ constructor(message: string, status: number, body: string);
67
+ }
68
+ export declare class ChargeAmpsApi {
69
+ private readonly options;
70
+ private readonly baseUrl;
71
+ private readonly fetchImpl;
72
+ private readonly now;
73
+ private token;
74
+ private refreshToken;
75
+ private tokenExpiresAt;
76
+ constructor(options: ChargeAmpsApiOptions);
77
+ getChargePoints(): Promise<ChargePoint[]>;
78
+ getChargePointStatus(chargePointId: string): Promise<ChargePointStatus>;
79
+ getChargePointSettings(chargePointId: string): Promise<ChargePointSettings>;
80
+ setChargePointSettings(settings: ChargePointSettings): Promise<void>;
81
+ getConnectorSettings(chargePointId: string, connectorId: number): Promise<ConnectorSettings>;
82
+ setConnectorSettings(settings: ConnectorSettings): Promise<void>;
83
+ remoteStart(chargePointId: string, connectorId: number, startAuth: StartAuth): Promise<void>;
84
+ remoteStop(chargePointId: string, connectorId: number): Promise<void>;
85
+ reboot(chargePointId: string): Promise<void>;
86
+ private ensureToken;
87
+ private authenticate;
88
+ private request;
89
+ }
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChargeAmpsApi = exports.ChargeAmpsApiError = void 0;
4
+ class ChargeAmpsApiError extends Error {
5
+ status;
6
+ body;
7
+ constructor(message, status, body) {
8
+ super(message);
9
+ this.name = "ChargeAmpsApiError";
10
+ this.status = status;
11
+ this.body = body;
12
+ }
13
+ }
14
+ exports.ChargeAmpsApiError = ChargeAmpsApiError;
15
+ class ChargeAmpsApi {
16
+ options;
17
+ baseUrl;
18
+ fetchImpl;
19
+ now;
20
+ token;
21
+ refreshToken;
22
+ tokenExpiresAt = 0;
23
+ constructor(options) {
24
+ this.options = options;
25
+ this.baseUrl = (options.apiBaseUrl || "https://eapi.charge.space").replace(/\/$/, "");
26
+ this.fetchImpl = options.fetchImpl || fetch;
27
+ this.now = options.now || (() => Math.floor(Date.now() / 1000));
28
+ }
29
+ async getChargePoints() {
30
+ return this.request("/api/v5/chargepoints/owned");
31
+ }
32
+ async getChargePointStatus(chargePointId) {
33
+ return this.request(`/api/v5/chargepoints/${encodeURIComponent(chargePointId)}/status`);
34
+ }
35
+ async getChargePointSettings(chargePointId) {
36
+ return this.request(`/api/v5/chargepoints/${encodeURIComponent(chargePointId)}/settings`);
37
+ }
38
+ async setChargePointSettings(settings) {
39
+ await this.request(`/api/v5/chargepoints/${encodeURIComponent(settings.id)}/settings`, {
40
+ method: "PUT",
41
+ body: JSON.stringify(settings),
42
+ });
43
+ }
44
+ async getConnectorSettings(chargePointId, connectorId) {
45
+ return this.request(`/api/v5/chargepoints/${encodeURIComponent(chargePointId)}/connectors/${connectorId}/settings`);
46
+ }
47
+ async setConnectorSettings(settings) {
48
+ await this.request(`/api/v5/chargepoints/${encodeURIComponent(settings.chargePointId)}/connectors/${settings.connectorId}/settings`, {
49
+ method: "PUT",
50
+ body: JSON.stringify(settings),
51
+ });
52
+ }
53
+ async remoteStart(chargePointId, connectorId, startAuth) {
54
+ await this.request(`/api/v5/chargepoints/${encodeURIComponent(chargePointId)}/connectors/${connectorId}/remotestart`, {
55
+ method: "PUT",
56
+ body: JSON.stringify(startAuth),
57
+ });
58
+ }
59
+ async remoteStop(chargePointId, connectorId) {
60
+ await this.request(`/api/v5/chargepoints/${encodeURIComponent(chargePointId)}/connectors/${connectorId}/remotestop`, {
61
+ method: "PUT",
62
+ body: JSON.stringify({}),
63
+ });
64
+ }
65
+ async reboot(chargePointId) {
66
+ await this.request(`/api/v5/chargepoints/${encodeURIComponent(chargePointId)}/reboot`, {
67
+ method: "PUT",
68
+ body: JSON.stringify({}),
69
+ });
70
+ }
71
+ async ensureToken() {
72
+ if (this.token && this.tokenExpiresAt - 30 > this.now()) {
73
+ return;
74
+ }
75
+ if (this.token && this.refreshToken) {
76
+ try {
77
+ await this.authenticate("/api/v5/auth/refreshToken", {
78
+ token: this.token,
79
+ refreshToken: this.refreshToken,
80
+ });
81
+ return;
82
+ }
83
+ catch {
84
+ this.token = undefined;
85
+ this.refreshToken = undefined;
86
+ this.tokenExpiresAt = 0;
87
+ }
88
+ }
89
+ await this.authenticate("/api/v5/auth/login", {
90
+ email: this.options.email,
91
+ password: this.options.password,
92
+ });
93
+ }
94
+ async authenticate(path, payload) {
95
+ const response = await this.fetchImpl(`${this.baseUrl}${path}`, {
96
+ method: "POST",
97
+ headers: {
98
+ "Content-Type": "application/json",
99
+ apiKey: this.options.apiKey,
100
+ },
101
+ body: JSON.stringify(payload),
102
+ });
103
+ const body = await response.text();
104
+ if (!response.ok) {
105
+ throw new ChargeAmpsApiError(`Charge Amps authentication failed with HTTP ${response.status}`, response.status, body);
106
+ }
107
+ const auth = JSON.parse(body);
108
+ this.token = auth.token;
109
+ this.refreshToken = auth.refreshToken;
110
+ this.tokenExpiresAt = readJwtExpiration(auth.token);
111
+ }
112
+ async request(path, init = {}) {
113
+ await this.ensureToken();
114
+ const response = await this.fetchImpl(`${this.baseUrl}${path}`, {
115
+ ...init,
116
+ headers: {
117
+ "Content-Type": "application/json",
118
+ apiKey: this.options.apiKey,
119
+ Authorization: `Bearer ${this.token}`,
120
+ ...(init.headers || {}),
121
+ },
122
+ });
123
+ const body = await response.text();
124
+ if (!response.ok) {
125
+ throw new ChargeAmpsApiError(`Charge Amps request failed with HTTP ${response.status}`, response.status, body);
126
+ }
127
+ return body ? JSON.parse(body) : undefined;
128
+ }
129
+ }
130
+ exports.ChargeAmpsApi = ChargeAmpsApi;
131
+ function readJwtExpiration(token) {
132
+ const [, payload] = token.split(".");
133
+ if (!payload) {
134
+ return 0;
135
+ }
136
+ const normalized = payload.replace(/-/g, "+").replace(/_/g, "/");
137
+ const decoded = Buffer.from(normalized, "base64").toString("utf8");
138
+ const parsed = JSON.parse(decoded);
139
+ return parsed.exp || 0;
140
+ }
141
+ //# sourceMappingURL=chargeamps-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chargeamps-api.js","sourceRoot":"","sources":["../src/chargeamps-api.ts"],"names":[],"mappings":";;;AA4EA,MAAa,kBAAmB,SAAQ,KAAK;IAC3B,MAAM,CAAS;IACf,IAAI,CAAS;IAE7B,YAAmB,OAAe,EAAE,MAAc,EAAE,IAAY;QAC9D,KAAK,CAAC,OAAO,CAA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3D,CAAC;CACF;AA9ID,sCA8IC;AAED,SAAS,iBAAiB,CAAC,KAAa;IACtC,MAAM,CAAC,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACrC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,CAAC,CAAC;IACX,CAAC;IAED,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACjE,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACnE,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAqB,CAAC;IACvD,OAAO,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;AACzB,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
package/build/main.js ADDED
@@ -0,0 +1,497 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ const utils = __importStar(require("@iobroker/adapter-core"));
37
+ const chargeamps_api_1 = require("./chargeamps-api");
38
+ class ChargeampsHalo extends utils.Adapter {
39
+ api;
40
+ pollTimer;
41
+ chargePointIds = new Map();
42
+ connectorIds = new Map();
43
+ chargePointSettings = new Map();
44
+ connectorSettings = new Map();
45
+ polling = false;
46
+ constructor(options = {}) {
47
+ super({
48
+ ...options,
49
+ name: "chargeamps1",
50
+ });
51
+ this.on("ready", this.onReady.bind(this));
52
+ this.on("stateChange", this.onStateChange.bind(this));
53
+ this.on("unload", this.onUnload.bind(this));
54
+ }
55
+ async onReady() {
56
+ await this.ensureBaseObjects();
57
+ await this.deleteObsoleteSessionObjects();
58
+ await this.setState("info.connection", false, true);
59
+ if (!this.config.email || !this.config.password || !this.config.apiKey) {
60
+ this.log.warn("Please configure email, password and API key.");
61
+ return;
62
+ }
63
+ this.api = new chargeamps_api_1.ChargeAmpsApi({
64
+ email: this.config.email,
65
+ password: this.config.password,
66
+ apiKey: this.config.apiKey,
67
+ apiBaseUrl: this.config.apiBaseUrl,
68
+ });
69
+ await this.subscribeStatesAsync("*");
70
+ await this.poll();
71
+ }
72
+ onUnload(callback) {
73
+ try {
74
+ if (this.pollTimer) {
75
+ this.clearTimeout(this.pollTimer);
76
+ this.pollTimer = undefined;
77
+ }
78
+ void this.setState("info.connection", false, true);
79
+ callback();
80
+ }
81
+ catch {
82
+ callback();
83
+ }
84
+ }
85
+ schedulePoll() {
86
+ if (this.pollTimer) {
87
+ this.clearTimeout(this.pollTimer);
88
+ }
89
+ const intervalSeconds = Math.max(30, Number(this.config.pollInterval) || 60);
90
+ this.pollTimer = this.setTimeout(() => void this.poll(), intervalSeconds * 1000);
91
+ }
92
+ async poll() {
93
+ if (!this.api || this.polling) {
94
+ return;
95
+ }
96
+ this.polling = true;
97
+ try {
98
+ const chargePoints = await this.api.getChargePoints();
99
+ for (const chargePoint of chargePoints) {
100
+ await this.ensureChargePointObjects(chargePoint);
101
+ await this.updateChargePoint(chargePoint);
102
+ }
103
+ await this.setState("info.connection", true, true);
104
+ }
105
+ catch (error) {
106
+ await this.setState("info.connection", false, true);
107
+ this.log.warn(`Charge Amps polling failed: ${formatError(error)}`);
108
+ }
109
+ finally {
110
+ this.polling = false;
111
+ this.schedulePoll();
112
+ }
113
+ }
114
+ async updateChargePoint(chargePoint) {
115
+ if (!this.api) {
116
+ return;
117
+ }
118
+ const cpId = objectId(chargePoint.id);
119
+ this.chargePointIds.set(cpId, chargePoint.id);
120
+ await this.setStateChangedAsync(`chargepoints.${cpId}.info.name`, chargePoint.name, true);
121
+ await this.setStateChangedAsync(`chargepoints.${cpId}.info.type`, chargePoint.type, true);
122
+ await this.setStateChangedAsync(`chargepoints.${cpId}.info.firmwareVersion`, chargePoint.firmwareVersion, true);
123
+ await this.setStateChangedAsync(`chargepoints.${cpId}.info.hardwareVersion`, chargePoint.hardwareVersion, true);
124
+ await this.setStateChangedAsync(`chargepoints.${cpId}.info.isLoadbalanced`, chargePoint.isLoadbalanced, true);
125
+ const [status, settings] = await Promise.all([
126
+ this.api.getChargePointStatus(chargePoint.id),
127
+ this.api.getChargePointSettings(chargePoint.id),
128
+ ]);
129
+ this.chargePointSettings.set(chargePoint.id, settings);
130
+ await this.setStateChangedAsync(`chargepoints.${cpId}.status`, status.status, true);
131
+ await this.setStateChangedAsync(`chargepoints.${cpId}.settings.dimmer`, settings.dimmer, true);
132
+ await this.setStateChangedAsync(`chargepoints.${cpId}.settings.downLight`, settings.downLight, true);
133
+ for (const connector of chargePoint.connectors) {
134
+ const connectorId = objectId(String(connector.connectorId));
135
+ this.connectorIds.set(`${cpId}.${connectorId}`, {
136
+ chargePointId: chargePoint.id,
137
+ connectorId: connector.connectorId,
138
+ });
139
+ const connectorSettings = await this.api.getConnectorSettings(chargePoint.id, connector.connectorId);
140
+ this.connectorSettings.set(connectorKey(chargePoint.id, connector.connectorId), connectorSettings);
141
+ const connectorStatus = status.connectorStatuses.find((item) => item.connectorId === connector.connectorId);
142
+ await this.setStateChangedAsync(`chargepoints.${cpId}.connectors.${connectorId}.info.type`, connector.type, true);
143
+ await this.setStateChangedAsync(`chargepoints.${cpId}.connectors.${connectorId}.settings.mode`, connectorSettings.mode, true);
144
+ await this.setStateChangedAsync(`chargepoints.${cpId}.connectors.${connectorId}.settings.rfidLock`, connectorSettings.rfidLock, true);
145
+ await this.setStateChangedAsync(`chargepoints.${cpId}.connectors.${connectorId}.settings.cableLock`, connectorSettings.cableLock, true);
146
+ await this.setStateChangedAsync(`chargepoints.${cpId}.connectors.${connectorId}.settings.maxCurrent`, connectorSettings.maxCurrent ?? null, true);
147
+ if (connectorStatus) {
148
+ const base = `chargepoints.${cpId}.connectors.${connectorId}.status`;
149
+ await this.setStateChangedAsync(`${base}.status`, connectorStatus.status, true);
150
+ await this.setStateChangedAsync(`${base}.totalConsumptionKwh`, connectorStatus.totalConsumptionKwh, true);
151
+ await this.setStateChangedAsync(`${base}.sessionId`, connectorStatus.sessionId ?? null, true);
152
+ await this.setStateChangedAsync(`${base}.startTime`, connectorStatus.startTime ?? "", true);
153
+ await this.setStateChangedAsync(`${base}.endTime`, connectorStatus.endTime ?? "", true);
154
+ await this.updateMeasurements(`${base}.measurements`, connectorStatus.measurements || []);
155
+ }
156
+ }
157
+ }
158
+ async updateMeasurements(base, measurements) {
159
+ await this.extendObjectAsync(base, {
160
+ type: "channel",
161
+ common: { name: "Measurements" },
162
+ native: {},
163
+ });
164
+ for (const measurement of measurements) {
165
+ const phase = objectId(measurement.phase);
166
+ await this.extendObjectAsync(`${base}.${phase}`, {
167
+ type: "channel",
168
+ common: { name: measurement.phase },
169
+ native: {},
170
+ });
171
+ await this.ensureState(`${base}.${phase}.current`, "Current", "number", "value.current", "A", false);
172
+ await this.ensureState(`${base}.${phase}.voltage`, "Voltage", "number", "value.voltage", "V", false);
173
+ await this.setStateChangedAsync(`${base}.${phase}.current`, measurement.current, true);
174
+ await this.setStateChangedAsync(`${base}.${phase}.voltage`, measurement.voltage, true);
175
+ }
176
+ }
177
+ async ensureBaseObjects() {
178
+ await this.extendObjectAsync("info", {
179
+ type: "channel",
180
+ common: { name: "Information" },
181
+ native: {},
182
+ });
183
+ await this.ensureState("info.connection", "Connected", "boolean", "indicator.connected", undefined, false);
184
+ await this.extendObjectAsync("chargepoints", {
185
+ type: "channel",
186
+ common: { name: "Charge points" },
187
+ native: {},
188
+ });
189
+ }
190
+ async deleteObsoleteSessionObjects() {
191
+ const objects = await this.getObjectListAsync({
192
+ startkey: `${this.namespace}.chargepoints.`,
193
+ endkey: `${this.namespace}.chargepoints.\u9999`,
194
+ });
195
+ const obsoleteChannels = new Set();
196
+ const namespacePattern = escapeRegExp(this.namespace);
197
+ const obsoleteSessionPattern = new RegExp(`^${namespacePattern}\\.(.+\\.last(?:Start|Stop)Session)(?:\\.|$)`);
198
+ for (const row of objects.rows) {
199
+ const match = row.id.match(obsoleteSessionPattern);
200
+ if (match) {
201
+ obsoleteChannels.add(match[1]);
202
+ }
203
+ }
204
+ for (const id of [...obsoleteChannels].sort((a, b) => a.length - b.length)) {
205
+ try {
206
+ await this.delObjectAsync(id, { recursive: true });
207
+ this.log.info(`Removed obsolete object ${id}`);
208
+ }
209
+ catch (error) {
210
+ this.log.debug(`Could not remove obsolete object ${id}: ${formatError(error)}`);
211
+ }
212
+ }
213
+ }
214
+ async ensureChargePointObjects(chargePoint) {
215
+ const cpId = objectId(chargePoint.id);
216
+ await this.extendObjectAsync(`chargepoints.${cpId}`, {
217
+ type: "device",
218
+ common: { name: chargePoint.name },
219
+ native: { chargePointId: chargePoint.id },
220
+ });
221
+ await this.extendObjectAsync(`chargepoints.${cpId}.info`, {
222
+ type: "channel",
223
+ common: { name: "Information" },
224
+ native: {},
225
+ });
226
+ await this.ensureState(`chargepoints.${cpId}.info.name`, "Name", "string", "info.name", undefined, false);
227
+ await this.ensureState(`chargepoints.${cpId}.info.type`, "Type", "string", "info.type", undefined, false);
228
+ await this.ensureState(`chargepoints.${cpId}.info.firmwareVersion`, "Firmware version", "string", "info.firmware", undefined, false);
229
+ await this.ensureState(`chargepoints.${cpId}.info.hardwareVersion`, "Hardware version", "string", "info.hardware", undefined, false);
230
+ await this.ensureState(`chargepoints.${cpId}.info.isLoadbalanced`, "Load balanced", "boolean", "indicator", undefined, false);
231
+ await this.ensureState(`chargepoints.${cpId}.status`, "Status", "string", "value", undefined, false);
232
+ await this.extendObjectAsync(`chargepoints.${cpId}.settings`, {
233
+ type: "channel",
234
+ common: { name: "Settings" },
235
+ native: {},
236
+ });
237
+ await this.ensureState(`chargepoints.${cpId}.settings.dimmer`, "Dimmer", "string", "level.dimmer", undefined, true);
238
+ await this.ensureState(`chargepoints.${cpId}.settings.downLight`, "Down light", "boolean", "switch.light", undefined, true);
239
+ await this.extendObjectAsync(`chargepoints.${cpId}.commands`, {
240
+ type: "channel",
241
+ common: { name: "Commands" },
242
+ native: {},
243
+ });
244
+ await this.ensureState(`chargepoints.${cpId}.commands.reboot`, "Reboot", "boolean", "button", undefined, true);
245
+ await this.extendObjectAsync(`chargepoints.${cpId}.connectors`, {
246
+ type: "channel",
247
+ common: { name: "Connectors" },
248
+ native: {},
249
+ });
250
+ for (const connector of chargePoint.connectors) {
251
+ const connectorId = objectId(String(connector.connectorId));
252
+ const base = `chargepoints.${cpId}.connectors.${connectorId}`;
253
+ await this.extendObjectAsync(base, {
254
+ type: "channel",
255
+ common: { name: `Connector ${connector.connectorId}` },
256
+ native: { chargePointId: chargePoint.id, connectorId: connector.connectorId },
257
+ });
258
+ await this.extendObjectAsync(`${base}.info`, {
259
+ type: "channel",
260
+ common: { name: "Information" },
261
+ native: {},
262
+ });
263
+ await this.ensureState(`${base}.info.type`, "Type", "string", "info.type", undefined, false);
264
+ await this.extendObjectAsync(`${base}.status`, {
265
+ type: "channel",
266
+ common: { name: "Status" },
267
+ native: {},
268
+ });
269
+ await this.ensureState(`${base}.status.status`, "Status", "string", "value", undefined, false);
270
+ await this.ensureState(`${base}.status.totalConsumptionKwh`, "Total consumption", "number", "value.power.consumption", "kWh", false);
271
+ await this.ensureState(`${base}.status.sessionId`, "Session ID", "number", "value", undefined, false);
272
+ await this.ensureState(`${base}.status.startTime`, "Start time", "string", "date", undefined, false);
273
+ await this.ensureState(`${base}.status.endTime`, "End time", "string", "date", undefined, false);
274
+ await this.extendObjectAsync(`${base}.settings`, {
275
+ type: "channel",
276
+ common: { name: "Settings" },
277
+ native: {},
278
+ });
279
+ await this.ensureState(`${base}.settings.mode`, "Mode", "string", "value", undefined, true);
280
+ await this.ensureState(`${base}.settings.rfidLock`, "RFID lock", "boolean", "switch.lock", undefined, true);
281
+ await this.ensureState(`${base}.settings.cableLock`, "Cable lock", "boolean", "switch.lock", undefined, true);
282
+ await this.ensureState(`${base}.settings.maxCurrent`, "Maximum current", "number", "level.current", "A", true);
283
+ await this.extendObjectAsync(`${base}.commands`, {
284
+ type: "channel",
285
+ common: { name: "Commands" },
286
+ native: {},
287
+ });
288
+ await this.ensureState(`${base}.commands.remoteStart`, "Remote start", "boolean", "button", undefined, true);
289
+ await this.ensureState(`${base}.commands.remoteStop`, "Remote stop", "boolean", "button", undefined, true);
290
+ await this.ensureState(`${base}.commands.enableCharging`, "Switch wallbox on", "boolean", "button", undefined, true);
291
+ await this.ensureState(`${base}.commands.disableCharging`, "Set wallbox to standby", "boolean", "button", undefined, true);
292
+ await this.ensureState(`${base}.commands.useSchedule`, "Use schedule", "boolean", "button", undefined, true);
293
+ }
294
+ }
295
+ async ensureState(id, name, type, role, unit, write) {
296
+ await this.extendObjectAsync(id, {
297
+ type: "state",
298
+ common: {
299
+ name,
300
+ type,
301
+ role,
302
+ read: true,
303
+ write,
304
+ unit,
305
+ },
306
+ native: {},
307
+ });
308
+ }
309
+ async onStateChange(id, state) {
310
+ if (!state || state.ack || !this.api) {
311
+ return;
312
+ }
313
+ const ownId = `${this.namespace}.`;
314
+ if (!id.startsWith(ownId)) {
315
+ return;
316
+ }
317
+ const relativeId = id.slice(ownId.length);
318
+ try {
319
+ let resetCommand = false;
320
+ if (relativeId.endsWith(".commands.reboot") && state.val === true) {
321
+ resetCommand = true;
322
+ await this.handleReboot(relativeId);
323
+ }
324
+ else if (relativeId.endsWith(".commands.remoteStart") && state.val === true) {
325
+ resetCommand = true;
326
+ await this.handleRemoteStart(relativeId);
327
+ }
328
+ else if (relativeId.endsWith(".commands.remoteStop") && state.val === true) {
329
+ resetCommand = true;
330
+ await this.handleRemoteStop(relativeId);
331
+ }
332
+ else if (relativeId.endsWith(".commands.enableCharging") && state.val === true) {
333
+ resetCommand = true;
334
+ await this.handleConnectorModeCommand(relativeId, "On");
335
+ }
336
+ else if (relativeId.endsWith(".commands.disableCharging") && state.val === true) {
337
+ resetCommand = true;
338
+ await this.handleConnectorModeCommand(relativeId, "Off");
339
+ }
340
+ else if (relativeId.endsWith(".commands.useSchedule") && state.val === true) {
341
+ resetCommand = true;
342
+ await this.handleConnectorModeCommand(relativeId, "Schedule");
343
+ }
344
+ else if (relativeId.includes(".settings.")) {
345
+ await this.handleSetting(relativeId, state.val);
346
+ }
347
+ await this.setStateAsync(relativeId, resetCommand ? false : state.val, true);
348
+ await this.poll();
349
+ }
350
+ catch (error) {
351
+ this.log.warn(`Command ${relativeId} failed: ${formatError(error)}`);
352
+ if (relativeId.includes(".commands.") && state.val === true) {
353
+ await this.setStateAsync(relativeId, false, true);
354
+ }
355
+ }
356
+ }
357
+ async handleReboot(relativeId) {
358
+ const [, cpId] = relativeId.split(".");
359
+ const chargePointId = this.chargePointIds.get(cpId);
360
+ if (chargePointId) {
361
+ await this.api?.reboot(chargePointId);
362
+ }
363
+ }
364
+ async handleConnectorModeCommand(relativeId, mode) {
365
+ const ref = this.resolveConnector(relativeId);
366
+ if (!ref) {
367
+ return;
368
+ }
369
+ const key = connectorKey(ref.chargePointId, ref.connectorId);
370
+ const settings = this.connectorSettings.get(key);
371
+ if (!settings) {
372
+ return;
373
+ }
374
+ const changed = { ...settings, mode };
375
+ await this.api?.setConnectorSettings(changed);
376
+ this.connectorSettings.set(key, changed);
377
+ const parts = relativeId.split(".");
378
+ await this.setStateChangedAsync(`chargepoints.${parts[1]}.connectors.${parts[3]}.settings.mode`, mode, true);
379
+ }
380
+ async handleRemoteStart(relativeId) {
381
+ const ref = this.resolveConnector(relativeId);
382
+ if (!ref) {
383
+ return;
384
+ }
385
+ if (!this.config.rfid) {
386
+ this.log.warn("Remote start was skipped because the Charge Amps API requires an RFID for this command.");
387
+ return;
388
+ }
389
+ await this.api?.remoteStart(ref.chargePointId, ref.connectorId, {
390
+ rfid: this.config.rfid,
391
+ rfidFormat: this.config.rfidFormat || "Hex",
392
+ rfidLength: rfidLength(this.config.rfid, this.config.rfidFormat, Number(this.config.rfidLength)),
393
+ externalTransactionId: `iobroker-${Date.now()}`,
394
+ });
395
+ }
396
+ async handleRemoteStop(relativeId) {
397
+ const ref = this.resolveConnector(relativeId);
398
+ if (ref) {
399
+ await this.api?.remoteStop(ref.chargePointId, ref.connectorId);
400
+ }
401
+ }
402
+ async handleSetting(relativeId, value) {
403
+ const parts = relativeId.split(".");
404
+ const cpId = parts[1];
405
+ const chargePointId = this.chargePointIds.get(cpId);
406
+ if (!chargePointId) {
407
+ return;
408
+ }
409
+ if (parts[2] === "settings") {
410
+ const settings = this.chargePointSettings.get(chargePointId);
411
+ if (!settings) {
412
+ return;
413
+ }
414
+ const changed = { ...settings };
415
+ if (parts[3] === "dimmer") {
416
+ changed.dimmer = String(value);
417
+ }
418
+ else if (parts[3] === "downLight") {
419
+ changed.downLight = Boolean(value);
420
+ }
421
+ await this.api?.setChargePointSettings(changed);
422
+ this.chargePointSettings.set(chargePointId, changed);
423
+ return;
424
+ }
425
+ const ref = this.resolveConnector(relativeId);
426
+ if (!ref) {
427
+ return;
428
+ }
429
+ const settings = this.connectorSettings.get(connectorKey(ref.chargePointId, ref.connectorId));
430
+ if (!settings) {
431
+ return;
432
+ }
433
+ const changed = { ...settings };
434
+ const field = parts[5];
435
+ if (field === "mode") {
436
+ changed.mode = String(value);
437
+ }
438
+ else if (field === "rfidLock") {
439
+ changed.rfidLock = Boolean(value);
440
+ }
441
+ else if (field === "cableLock") {
442
+ changed.cableLock = Boolean(value);
443
+ }
444
+ else if (field === "maxCurrent") {
445
+ if (value === null || value === "") {
446
+ changed.maxCurrent = null;
447
+ }
448
+ else {
449
+ const maxCurrent = Number(value);
450
+ if (!Number.isFinite(maxCurrent)) {
451
+ throw new Error(`Invalid maxCurrent value: ${String(value)}`);
452
+ }
453
+ changed.maxCurrent = maxCurrent;
454
+ }
455
+ }
456
+ await this.api?.setConnectorSettings(changed);
457
+ this.connectorSettings.set(connectorKey(ref.chargePointId, ref.connectorId), changed);
458
+ }
459
+ resolveConnector(relativeId) {
460
+ const parts = relativeId.split(".");
461
+ return this.connectorIds.get(`${parts[1]}.${parts[3]}`);
462
+ }
463
+ }
464
+ function objectId(value) {
465
+ return value.replace(/[^a-zA-Z0-9_-]/g, "_");
466
+ }
467
+ function connectorKey(chargePointId, connectorId) {
468
+ return `${chargePointId}:${connectorId}`;
469
+ }
470
+ function escapeRegExp(value) {
471
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
472
+ }
473
+ function rfidLength(rfid, format, configuredLength) {
474
+ const normalizedFormat = (format || "Hex").toLowerCase();
475
+ const hex = rfid.replace(/[^a-fA-F0-9]/g, "");
476
+ if (normalizedFormat === "hex" && Number.isFinite(configuredLength) && configuredLength > 0) {
477
+ return configuredLength === hex.length && hex.length % 2 === 0 ? hex.length / 2 : configuredLength;
478
+ }
479
+ if (Number.isFinite(configuredLength) && configuredLength > 0) {
480
+ return configuredLength;
481
+ }
482
+ return normalizedFormat === "hex" ? Math.ceil(hex.length / 2) : rfid.length;
483
+ }
484
+ function formatError(error) {
485
+ if (error instanceof chargeamps_api_1.ChargeAmpsApiError) {
486
+ const body = error.body ? `: ${error.body.slice(0, 500)}` : "";
487
+ return `${error.message}${body}`;
488
+ }
489
+ return error instanceof Error ? error.message : String(error);
490
+ }
491
+ if (require.main !== module) {
492
+ module.exports = (options) => new ChargeampsHalo(options);
493
+ }
494
+ else {
495
+ (() => new ChargeampsHalo())();
496
+ }
497
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8DAAgD;AAChD,qDAO0B;AAO1B,MAAM,cAAe,SAAQ,KAAK,CAAC,OAAO;IAChC,GAAG,CAA4B;IAC/B,SAAS,CAA+B;IAC/B,cAAc,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC3C,YAAY,GAAG,IAAI,GAAG,EAAwB,CAAC;IACxD,mBAAmB,GAAG,IAAI,GAAG,EAA+B,CAAC;IAC7D,iBAAiB,GAAG,IAAI,GAAG,EAA6B,CAAC;IACzD,OAAO,GAAG,KAAK,CAAC;IAExB,YAAmB,UAAyC,EAAE;QAC5D,KAAK,CAAC;YACJ,GAAG,OAAO;YACV,IAAI,EAAE,aAAa;SACpB,CAAC,CAAC;QAEH,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1C,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACtD,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,C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AED,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,MAAM,CAAC,OAAO,GAAG,CAAC,OAAkD,EAAE,EAAE,CAAC,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;AACvG,CAAC;KAAM,CAAC;IACN,CAAC,GAAG,EAAE,CAAC,IAAI,cAAc,EAAE,CAAC,EAAE,CAAC;AACjC,CAAC"}
@@ -0,0 +1,114 @@
1
+ {
2
+ "common": {
3
+ "name": "chargeamps1",
4
+ "version": "0.1.9",
5
+ "news": {
6
+ "0.1.8": {
7
+ "en": "npm fix.",
8
+ "de": "npm fix.",
9
+ "ru": "Добавлена поддержка RFID-карт и улучшена обработка ошибок.",
10
+ "pt": "Adicionado suporte para cartões RFID e melhor tratamento de erros.",
11
+ "nl": "Ondersteuning voor RFID-kaarten toegevoegd en foutafhandeling verbeterd.",
12
+ "fr": "Ajout du support pour les cartes RFID et amélioration de la gestion des erreurs.",
13
+ "it": "Aggiunto supporto per le carte RFID e migliorata la gestione degli errori.",
14
+ "es": "Se agregó soporte para tarjetas RFID y se mejoró el manejo de errores.",
15
+ "pl": "Dodano obsługę kart RFID i poprawiono obsługę błędów.",
16
+ "uk": "Додано підтримку карток RFID та покращено обробку помилок.",
17
+ "zh-cn": "添加了对RFID卡的支持,并改进了错误处理。"
18
+ }
19
+ },
20
+ "titleLang": {
21
+ "en": "ChargeAmps",
22
+ "de": "Chargeamps",
23
+ "ru": "Chargeamps",
24
+ "pt": "Chargeamps",
25
+ "nl": "Chargeamps",
26
+ "fr": "Chargée",
27
+ "it": "Chargeamps",
28
+ "es": "Cargadores",
29
+ "pl": "CharGeamps",
30
+ "uk": "Зарядка",
31
+ "zh-cn": "费用"
32
+ },
33
+ "desc": {
34
+ "en": "controll ChargeAmps Wallbox API",
35
+ "de": "Controll Chargeamps Wallbox -API",
36
+ "ru": "контроль API Wallbox chargeamps",
37
+ "pt": "Control Chargeamps Wallbox API",
38
+ "nl": "Control Chargeamps Wallbox API",
39
+ "fr": "API CORPORD CHARGEAMPS WALDBOX",
40
+ "it": "Controlla Chargeamps Wallbox API",
41
+ "es": "API de Wallbox de control de cargadores de control",
42
+ "pl": "kontrolować API Wallbox Wallbox",
43
+ "uk": "Контроль API Wallbox API Wallbox",
44
+ "zh-cn": "控制Chargeamps Wallbox API"
45
+ },
46
+ "authors": [
47
+ "michipi85 <sammer.michael.ms@gmail.com>"
48
+ ],
49
+ "keywords": [
50
+ "charge amps",
51
+ "wallbox",
52
+ "halo"
53
+ ],
54
+ "licenseInformation": {
55
+ "type": "free",
56
+ "license": "MIT"
57
+ },
58
+ "platform": "Javascript/Node.js",
59
+ "icon": "chargeamps.png",
60
+ "enabled": true,
61
+ "extIcon": "https://raw.githubusercontent.com/michipi85/ioBroker.chargeamps/main/admin/chargeamps.png",
62
+ "readme": "https://github.com/michipi85/ioBroker.chargeamps/blob/main/README.md",
63
+ "loglevel": "info",
64
+ "tier": 3,
65
+ "mode": "daemon",
66
+ "type": "vehicle",
67
+ "compact": true,
68
+ "connectionType": "cloud",
69
+ "dataSource": "poll",
70
+ "adminUI": {
71
+ "config": "json",
72
+ "tab": "materialize"
73
+ },
74
+ "dependencies": [
75
+ {
76
+ "js-controller": ">=5.0.0"
77
+ }
78
+ ],
79
+ "globalDependencies": [
80
+ {
81
+ "admin": ">=6.0.0"
82
+ }
83
+ ]
84
+ },
85
+ "encryptedNative": ["password","apiKey"],
86
+ "protectedNative": ["password","apiKey"],
87
+ "native": {
88
+ "email": "",
89
+ "password": "",
90
+ "apiKey": "",
91
+ "apiBaseUrl": "https://eapi.charge.space",
92
+ "pollInterval": 60,
93
+ "rfid": "",
94
+ "rfidFormat": "Hex",
95
+ "rfidLength": 0
96
+ },
97
+ "objects": [
98
+ {
99
+ "_id": "info.connection",
100
+ "type": "state",
101
+ "common": {
102
+ "name": "Connected",
103
+ "type": "boolean",
104
+ "role": "indicator.connected",
105
+ "read": true,
106
+ "write": false,
107
+ "def": false
108
+ },
109
+ "native": {}
110
+ }
111
+ ],
112
+ "instanceObjects": []
113
+
114
+ }
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "iobroker.chargeamps1",
3
+ "version": "0.1.9",
4
+ "description": "controll ChargeAmps Wallbox API",
5
+ "author": {
6
+ "name": "michipi85",
7
+ "email": "sammer.michael.ms@gmail.com"
8
+ },
9
+ "homepage": "https://github.com/michipi85/ioBroker.chargeamps1",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/michipi85/ioBroker.chargeamps1.git"
13
+ },
14
+ "license": "MIT",
15
+ "keywords": [
16
+ "charge amps",
17
+ "wallbox",
18
+ "halo"
19
+ ],
20
+ "engines": {
21
+ "node": ">= 18"
22
+ },
23
+ "dependencies": {
24
+ "@iobroker/adapter-core": "^3.3.2"
25
+ },
26
+ "devDependencies": {
27
+ "@iobroker/types": "^7.1.2",
28
+ "@types/node": "^20.19.0",
29
+ "typescript": "^5.8.3"
30
+ },
31
+ "main": "build/main.js",
32
+ "types": "build/main.d.ts",
33
+ "files": [
34
+ "admin",
35
+ "build",
36
+ "io-package.json",
37
+ "LICENSE",
38
+ "README.md"
39
+ ],
40
+ "scripts": {
41
+ "prebuild": "node -e \"require('fs').rmSync('build', { recursive: true, force: true })\"",
42
+ "build": "tsc -p tsconfig.json",
43
+ "watch": "tsc -w -p tsconfig.json",
44
+ "pretest": "node -e \"require('fs').rmSync('build-test', { recursive: true, force: true })\"",
45
+ "test": "npm run build && tsc -p tsconfig.test.json && node --test build-test/test/chargeamps-api.test.js",
46
+ "prepack": "npm run build"
47
+ },
48
+ "bugs": {
49
+ "url": "https://github.com/michipi85/ioBroker.chargeamps1/issues"
50
+ },
51
+ "readmeFilename": "README.md"
52
+ }