ioBroker / ioBroker.javascript

Script engine for JavaScript and Blockly
MIT License
325 stars 120 forks source link

[bug]: Wrong value for first Alias calculation of the day #1761

Open 5G7K opened 4 days ago

5G7K commented 4 days ago

No existing issues.

Description

Alias for energy meter which will be increased by old meter end value. (Math.round(val * 100) / 100) + 11608.84

Org value: 5206 kWh Alias value ~16814kWh

Original values: image

Trigger auf Alias - First log of the day image

2024-11-15 00:01:02.085 - debug: javascript.0 (14413) script.js.Lovelace.Lovelace_ApexChart: Aktualisierung LWP mit: 28422.8Cache: [object Object]
--
2024-11-15 00:01:02.086 - debug: javascript.0 (14413) script.js.Lovelace.Lovelace_ApexChart: Aktualisierung LWP mit: 16813.96Cache: [object Object]
2024-11-15 00:01:14.322 - debug: javascript.0 (14413) script.js.Lovelace.Lovelace_ApexChart: Aktualisierung LWP mit: 16813.97Cache: [object Object]

First triggered Alias Value is 28422.8 (16814 + 11608) which is the old increased value + a second increasement. This is wrong. Second triggered value is correct. But at 00:01 there is only one value change. Don't know why there are two triggers with a wrong and the correct value...

Reproduction instruction

No response

JS-controller version

7.02

Node version

20.18.0

foxriver76 commented 4 days ago

This is not js-controller it’s JavaScript

5G7K commented 4 days ago

hm, ok. Then I will add a few debug logs at this point and try to narrow down the problem further