Page 1 of 1

Error on a dummy General kWh meter

Posted: Sunday 30 November 2025 10:18
by Kedi
I got this error:

Code: Select all

2025-11-30 10:15:00.527 Error: UpdateMeter: Error converting sValue/sUsage! (IDX: 1973, sValue: 'nan', sUsage: '55210', dType: 243, sType: 29)
Any idea how to resolve the 'nan' error?

Re: Error on a dummy General kWh meter

Posted: Sunday 30 November 2025 11:06
by FireWizard
Hello @Kedi,

'nan' means Not a Number. Your dummy kWh meter expects a number value, written as a string, e.g. "123" and obviously receives something else. I don't know how you populatie your variable, but check your source.

Regards

Re: Error on a dummy General kWh meter

Posted: Sunday 30 November 2025 11:26
by Kedi
I use node-red to populate the values.
I now made some provisions in node-red to catch the 'nan' so the domoticz database does not get the 'nan's anymore.
I had to go into deleting and editing records directly into the Domoticz database, so it is working again.
But Domoticz should be self-healing for those errors if data after the nan is correct, but it does not.

Re: Error on a dummy General kWh meter

Posted: Sunday 30 November 2025 14:55
by FireWizard
Hello @Kedi,

You said:
But Domoticz should be self-healing for those errors if data after the nan is correct, but it does not.
The General kWh sensor requires two values:
1. The power usage in W(att)
2. The cumulative energy in Wh (but will be shown in kWh)
These two values are separated by a semicolon (;) and send as a svalue. So as a string.

How could Domoticz restore or repair an invalid value, send by an external application, even if the other value is valid?
I.m.o it is the responsibility of the transmitting party to check that valid data will be sent.

Regards

Re: Error on a dummy General kWh meter

Posted: Monday 01 December 2025 18:49
by Kedi
Node-red had some time sending 'nan' as a value.
That is transfered to Domoticz, hence the errors.
I fixed the 'nan' transfer to nothing being send to Domoticz.
I also fixed the source of the nan's so Node-red is sending valid values again.
But Domoticz still would refuse to take the valid values as valid, because the 'nan' was still in the database
and was not overwritten by the valid values Node-red was already sending.
With 'self-healing' I ment that Domoticz should accept the valid values again, which it did not.
I had to go into the Domoticz database and fix it there.

Re: Error on a dummy General kWh meter

Posted: Monday 01 December 2025 19:22
by FireWizard
Hello @Kedi.

I do not know, if Domoticz checks for NaN and, if so, how Domoticz checks.

Keep in mind, that (as said earlier) in JavaScript, NaN is short for "Not-a-Number", but in JavaScript, NaN is a number that is not a legal number.
This is quite confusing and so be careful on how to check for NaN.

You cannot use the typeof operator in JavaScript to check for NaN, but you have to use the isNaN() method.
The isNaN() method returns true if a value is NaN.

For more info: https://www.w3schools.com/jsref/jsref_isnan.asp

Regards

Re: Error on a dummy General kWh meter

Posted: Tuesday 02 December 2025 10:11
by habahabahaba
We discussed such problem HERE

@Kedi, may be your version of Domoticz is older than 2024 ?

Re: Error on a dummy General kWh meter

Posted: Tuesday 02 December 2025 17:03
by Kedi
My version is: Version: 2025.1 (build 16657) So a little over half a year old, so should be fine.
I now use this to catch a NaN or the string 'nan' (because 'nan' was in the database).

Code: Select all

if (isNaN(msg.payload) || msg.payload == 'nan') {
    node.warn(msg.payload);
    return;
} else {.....
Data is comming from a P1P2 device from a Daikin heatpump. I never had the NaN's before, watched the node.warn for a while but it never came back. I had this issue twice now, hopefully no more.