diff --git a/changelog.txt b/changelog.txt index 7041d89..5c3e3d5 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,4 @@ +2.8.0 - 27-11-2023 Added S0 timeout setting (LS120 fw ^1.6.0). Documentation update BE water meter. (LS120 fw ^1.6.0) 2.7.1 - 31-05-2023 Fix for P1 data LS120 fw ^1.6.0 2.7.0 - 23-06-2022 Added P1Status method (3 phase P1 information, only for LS120 fw ^1.5.0) 2.6.0 - 27-03-2022 Improved and fixed autodiscovery. diff --git a/docs/Youless.html b/docs/Youless.html index 7296807..2c84283 100644 --- a/docs/Youless.html +++ b/docs/Youless.html @@ -26,7 +26,7 @@
@@ -2776,6 +2776,152 @@
Parameters:
+
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<finished> + + +
+
+ + + + + + + + + +

(async) setS0Timeout(value) → {Promise.<finished>}

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Set the Power pulses timeout

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
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 @@
@@ -218,6 +218,35 @@
Properties:
+ + + net + + + + + +number + + + + + + + + + + + + + + + +

total energy counter, consumption - production

+ + + + pwr @@ -546,6 +575,99 @@
Properties:
+ + + + wtr + + + + + +number + + + + + + + + + <optional>
+ + + + + + + + +

counter water-meter (in m^3). e.g. 6161.243 NOTE: only for LS120 ^1.6 version firmware and BE meters

+ + + + + + + wts + + + + + +number + + + + + + + + + <optional>
+ + + + + + + + +

time of the last water measurement (yyMMddhhmm). e.g. 1811182200 NOTE: only for LS120 ^1.6 version firmware and BE meters

+ + + + + + + wtm + + + + + +number + + + + + + + + + <optional>
+ + + + + + + + +

time of the last gas measurement. unix-time-format. e.g. 1542574800 NOTE: NOTE: only for LS120 ^1.6 version firmware and BE meters

+ + + @@ -2620,7 +2742,7 @@
Example

- Documentation generated by JSDoc 3.6.6 on Thu Jun 23 2022 12:02:32 GMT+0200 (Midden-Europese zomertijd) using the docdash theme. + Documentation generated by JSDoc 3.6.6 on Mon Nov 27 2023 19:02:12 GMT+0100 (Midden-Europese standaardtijd) using the docdash theme.
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 @@
@@ -59,6 +59,7 @@

get:

  • live energy and gas readings of P1 smart meters (LS120 only)
  • live readings of the S0 input (LS120 only)
  • live readings of the optical sensor
  • +
  • live P1 tariff, power, voltage, current readings per phase (LS120 only)
  • raw P1 data (Experimental and unstable!)
  • historic logs of power
  • historic log of gas (LS120 only)
  • @@ -125,7 +126,7 @@

    Detailed documentation:


    - Documentation generated by JSDoc 3.6.6 on Thu Jun 23 2022 12:02:32 GMT+0200 (Midden-Europese zomertijd) using the docdash theme. + Documentation generated by JSDoc 3.6.6 on Mon Nov 27 2023 19:02:12 GMT+0100 (Midden-Europese standaardtijd) using the docdash theme.
    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} + */ + async setS0Timeout(value) { + try { + const success = await this._makeRequest(setS0TimeoutPath + Number(value)); + return Promise.resolve(success); + } catch (error) { + return Promise.reject(error); + } + } + // Het is eigenlijk meer een testfunctie, maar je kunt url /M?l=3 (luminance) gebruiken om de belichting // op hoog te forceren (in de auto belichting wordt onder de 6% naar hoog geschakeld). // De waarde 0 stelt overigens weer de default auto luminance in en de waarde 2 forceert op lage luminance (1 wordt niet gebruikt). @@ -811,6 +835,7 @@ sts: '(17)', cs0: ' 12345,0000', ps0: 0, raw: 627, net: 20289.512, tm: 154306573 * @typedef advancedStatus * @description advancedStatus is an object containing power information. * @property {number} tm time of retrieving info. unix-time-format. e.g. 1542575626 +* @property {number} net total energy counter, consumption - production * @property {number} pwr power consumption in Watt. e.g. 3030 * @property {number} [ts0] time of the last S0 measurement. unix-time-format. e.g. 1542575626 NOTE: only for LS120 ^1.4 version firmware * @property {number} [cs0] counter of S0 input (KwH). e.g. 0 NOTE: only for LS120 ^1.4 version firmware @@ -822,6 +847,9 @@ sts: '(17)', cs0: ' 12345,0000', ps0: 0, raw: 627, net: 20289.512, tm: 154306573 * @property {number} gas counter gas-meter (in m^3). e.g. 6161.243 * @property {number} [gts] time of the last gas measurement (yyMMddhhmm). e.g. 1811182200 NOTE: only for LS120 ^1.4 version firmware * @property {number} [gtm] time of the last gas measurement. unix-time-format. e.g. 1542574800 NOTE: only for LS120 ^1.4 version firmware +* @property {number} [wtr] counter water-meter (in m^3). e.g. 6161.243 NOTE: only for LS120 ^1.6 version firmware and BE meters +* @property {number} [wts] time of the last water measurement (yyMMddhhmm). e.g. 1811182200 NOTE: only for LS120 ^1.6 version firmware and BE meters +* @property {number} [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 // advancedStatus information { tm: 1543065732, net: 20289.512, pwr: 640, ts0: 1542562800, cs0: 12345, ps0: 0, p1: 16168.673, p2: 9942.712, n1: 1570.936, n2: 4250.937, gas: 6192.638, gts: 1811241400, gtm: 1543064400 }