Parameters:
+Returns:
+ + + + +-
+
- + Type + +
- + +Promise.<finished> + + + +
(async) setS0Timeout(value) → {Promise.<finished>}
+ + + + + + +-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Set the Power pulses timeout
+Parameters:
+ + +Name | + + +Type | + + + + + +Description | +
---|---|---|
value |
+
+
+ + + +number + + + + | + + + + + +the timeout in minutes. 0 = 30s. |
+
Returns:
@@ -2913,7 +3059,7 @@Returns:
diff --git a/docs/global.html b/docs/global.html index 3fbdf6b..ee8e6e9 100644 --- a/docs/global.html +++ b/docs/global.html @@ -26,7 +26,7 @@
Properties:
+net
total energy counter, consumption - production
pwr
Properties:
wtr
+ + + +
counter water-meter (in m^3). e.g. 6161.243 NOTE: only for LS120 ^1.6 version firmware and BE meters
wts
+ + + +
time of the last water measurement (yyMMddhhmm). e.g. 1811182200 NOTE: only for LS120 ^1.6 version firmware and BE meters
wtm
+ + + +
time of the last gas measurement. unix-time-format. e.g. 1542574800 NOTE: NOTE: only for LS120 ^1.6 version firmware and BE meters
Example
diff --git a/docs/index.html b/docs/index.html index d9d4d22..04606b9 100644 --- a/docs/index.html +++ b/docs/index.html @@ -26,7 +26,7 @@
get:
Detailed documentation:
diff --git a/package.json b/package.json index e5c0919..9126e15 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "youless", - "version": "2.7.1", + "version": "2.8.0", "description": "Node package to interface with Youless energy monitor devices (LS110 and LS120)", "main": "youless.js", "scripts": { diff --git a/test/_test.js b/test/_test.js index fc15eed..ce2159e 100644 --- a/test/_test.js +++ b/test/_test.js @@ -164,15 +164,20 @@ async function doTest() { // .catch((error) => logError(error)); // // set the S0 counter value (in KwH) - // log.push('trying to set the S0 counter (LS120-EL only)'); + // log.push('trying to set the S0 counter (LS120 only)'); // await youless.setS0Counter(12345) // .catch((error) => logError(error)); // // set the S0 pulses per KwH value NOTE: also resets powerPulses to 1000 - // log.push('trying to set the S0 pulses (LS120-EL only)'); + // log.push('trying to set the S0 pulses (LS120 only)'); // await youless.setS0Pulses(1000) // .catch((error) => logError(error)); + // set the S0 pulses timeout + log.push('trying to set the S0 timeout (LS120 only)'); + await youless.setS0Timeout(5) + .catch((error) => logError(error)); + // // set the Power counter value (in KwH) NOTE: also resets powerPulses to 1000 // await youless.setPowerCounter(12345) // .catch((error) => logError(error)); diff --git a/youless.js b/youless.js index 18686e4..6416d69 100644 --- a/youless.js +++ b/youless.js @@ -46,6 +46,9 @@ const s0LogPath = '/Z'; // add range h/w/d/m, selection, and json format. e.g. ? // Only available for LS120 fw>-1.5: const P1StatusPath = '/f'; // Power, Voltage, Current per phase. Active Tariff. +// Only available for LS120 fw>-1.6: +const setS0TimeoutPath = '/M?to='; // power pulse timeout in minutes. 0 = 30s. + // Unknown where available const rawP1Path = '/V?p='; const setLumiPath = '/M?l='; @@ -92,6 +95,7 @@ class Youless { p1: undefined, gas: undefined, s0: undefined, + water: undefined, }; this.lastResponse = undefined; } @@ -284,6 +288,12 @@ class Youless { advancedStatus.ps0 = 0; advancedStatus.cs0 = 0; } + if (advancedStatus.wts) { // water meter connected (BE fw>=v1.6) + this.hasMeter.water = true; + advancedStatus.wtm = toEpoch(advancedStatus.wts); + } else { // no water meter available + this.hasMeter.water = false; + } if (this.reversed) { const tmp = { ...advancedStatus }; advancedStatus.p1 = tmp.p2; @@ -554,6 +564,20 @@ class Youless { } } + /** + * Set the Power pulses timeout + * @param {number} value - the timeout in minutes. 0 = 30s. + * @returns {Promise