Please use template to report bugs and problems. Post here your questions when not sure where else to post Only for bugs in the Domoticz application! other problems go in different subforums!
Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.
'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.
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.
Logic will get you from A to B. Imagination will take you everywhere.
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.
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.
Logic will get you from A to B. Imagination will take you everywhere.
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.
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).
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.
Logic will get you from A to B. Imagination will take you everywhere.