Node red flow

Moderator: leecollings

User avatar
FireWizard
Posts: 1967
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Node red flow

Post by FireWizard »

@edwin1234,
Now i got some value perhaps i have to wait till it runs for a day or so to see the kwh
I do not own a Tuya device, but of course, the update frequency is dependent on the publishing frequency
of the Tuya device (your refrigerator).

But I see another strange thing in your picture.

The consumed energy for today shows "nan kWh".
Did you change the setting for "Energy read" to "Computed"?
Is the value (93.7 Watt) an expected value for the consumption of the refrigerator?

Let wait and see, if that changes tomorrow

Regards
edwin1234
Posts: 330
Joined: Sunday 09 October 2016 20:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Nederland
Contact:

Re: Node red flow

Post by edwin1234 »

Yes i have it on computed and now a few minutes later i have a nan watt value, very strange.
with the inject node i got 101.2 watt and nan kwh
Also an error in the domoticz log:
Error: UpdateMeter: Error converting sValue/sUsage! (IDX: 1463, sValue: 'nan', sUsage: 'nan', dType: 243, sType: 29)

I will wait and see what value there tomorow will be.

Regards
User avatar
FireWizard
Posts: 1967
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Node red flow

Post by FireWizard »

Hi @edwin1234,

Can you tell me, what you see in "debug 10", both with my Inject node and with the Tuya device?

Regards
edwin1234
Posts: 330
Joined: Sunday 09 October 2016 20:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Nederland
Contact:

Re: Node red flow

Post by edwin1234 »

First one with inject node:Image

Second one with tuya node:Image
IMG_6586.jpeg
IMG_6586.jpeg (38.56 KiB) Viewed 122 times

And still errors in the log:
2025-10-15 19:10:01.023 Error: UpdateMeter: Error converting sValue/sUsage! (IDX: 1463, sValue: 'nan', sUsage: '0', dType: 243, sType: 29)
2025-10-15 19:15:00.200 Error: UpdateMeter: Error converting sValue/sUsage! (IDX: 1463, sValue: 'nan', sUsage: 'nan', dType: 243, sType: 29)
2025-10-15 19:20:00.333 Error: UpdateMeter: Error converting sValue/sUsage! (IDX: 1463, sValue: 'nan', sUsage: 'nan', dType: 243, sType: 29)
2025-10-15 19:25:00.469 Error: UpdateMeter: Error converting sValue/sUsage! (IDX: 1463, sValue: 'nan', sUsage: 'nan', dType: 243, sType: 29)
2025-10-15 19:30:00.597 Error: UpdateMeter: Error converting sValue/sUsage! (IDX: 1463, sValue: 'nan', sUsage: 'nan', dType: 243, sType: 29)
2025-10-15 19:35:00.718 Error: UpdateMeter: Error converting sValue/sUsage! (IDX: 1463, sValue: 'nan', sUsage: 'nan', dType: 243, sType: 29)
2025-10-15 19:40:00.833 Error: UpdateMeter: Error converting sValue/sUsage! (IDX: 1463, sValue: 'nan', sUsage: 'nan', dType: 243, sType: 29)
2025-10-15 19:45:00.976 Error: UpdateMeter: Error converting sValue/sUsage! (IDX: 1463, sValue: 'nan', sUsage: 'nan', dType: 243, sType: 29)
2025-10-15 19:50:00.153 Error: UpdateMeter: Error converting sValue/sUsage! (IDX: 1463, sValue: 'nan', sUsage: 'nan', dType: 243, sType: 29)
2025-10-15 19:55:00.303 Error: UpdateMeter: Error converting sValue/sUsage! (IDX: 1463, sValue: 'nan', sUsage: '978', dType: 243, sType: 29)
2025-10-15 20:00:00.454 Error: UpdateMeter: Error converting sValue/sUsage! (IDX: 1463, sValue: 'nan', sUsage: '978', dType: 243, sType: 29)
2025-10-15 20:05:00.596 Error: UpdateMeter: Error converting sValue/sUsage! (IDX: 1463, sValue: 'nan', sUsage: 'nan', dType: 243, sType: 29)
2025-10-15 20:10:00.721 Error: UpdateMeter: Error converting sValue/sUsage! (IDX: 1463, sValue: 'nan', sUsage: '1012', dType: 243, sType: 29)
2025-10-15 20:15:00.860 Error: UpdateMeter: Error converting sValue/sUsage! (IDX: 1463, sValue: 'nan', sUsage: '921', dType: 243, sType: 29)
2025-10-15 20:20:00.983 Error: UpdateMeter: Error converting sValue/sUsage! (IDX: 1463, sValue: 'nan', sUsage: '921', dType: 243, sType: 29)
Attachments
IMG_6587.jpeg
IMG_6587.jpeg (40.13 KiB) Viewed 122 times
User avatar
FireWizard
Posts: 1967
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Node red flow

Post by FireWizard »

Hello @edwin1234,

I am puzzled. There is no difference between the real Tuya device and the simulation. The values and the formatting of the Object is correct.
Just a question. What is the device type for idx 1463?

Regards
edwin1234
Posts: 330
Joined: Sunday 09 October 2016 20:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Nederland
Contact:

Re: Node red flow

Post by edwin1234 »

Hi firewizard,
I use this:
type Electric (Usage + Counter)

Regards
User avatar
waltervl
Posts: 6681
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: Node red flow

Post by waltervl »

Both values in svalues should be integers so "101;0"
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
habahabahaba
Posts: 266
Joined: Saturday 18 March 2023 14:44
Target OS: Windows
Domoticz version: 2024.4
Contact:

Re: Node red flow

Post by habahabahaba »

waltervl wrote: Thursday 16 October 2025 8:18 Both values in svalues should be integers so "101;0"
https://wiki.domoticz.com/Domoticz_API/ ... d_counter) - Only Energy should be integer.

@edwin1234, Just try from browser

Code: Select all

http://<domoticz_ip>:8080/json.htm?type=command&param=udevice&idx=1463&nvalue=0&svalue=92.1;0
If NaN will disappear then the problem is in NodeRed or Mqtt, if not - then may be in Domoticz.
User avatar
FireWizard
Posts: 1967
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Node red flow

Post by FireWizard »

Hi all,

Thank you both @waltervl and @habahabahaba for your responses.

@waltervl said:
Both values in svalues should be integers so "101;0"
I don't think that is correct for several reasons.

1. At https://piandmore.wordpress.com/2019/02 ... -domoticz/ you can find:
The electric sensor will show the current usage of electricity in Watt and the cumulative usage in kWh. You can add digits after the decimal if needed.

{"command":"udevice", "idx":1234, "svalue":"us;cu"}

where us is usage in Watt and cu is cumulative usage in Wh (even though it is displayed in kWh)
2. In the Wiki, you cannot find any restriction. So I agree with @habahabahaba.

3. I have a similar device in my production system, that functions for years

4. In my test system, where I built the simulation for @edwin1234's project, I don't discover any issues.
See the screenshots.

So I agree with @habahaba

I would also suggest to test with http instead of mqtt, but I do not expect to find the solution.

There is something else, cheating us, but what?

Regards
User avatar
FireWizard
Posts: 1967
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Node red flow

Post by FireWizard »

Hi all,

I studied the issue in more detail,

I found a similar error message: https://github.com/domoticz/domoticz/issues/5626

This has been solved in version 15132, more than 2 years ago. I don't think it has returned.

@edwin1234.

What Domoticz version do you run. My test system runs 2025.1 Stable
In the error messages in the log, I see, beside a number of "nan" (Not a Number) for sUsage, also valid numerical values.

Could you check in the debug nodes, debug 9 and 10, that you always get a number for DataPoint 19 and also in "svalue".
I suspect the Tuya node, that it does not frequently send the correct data every 5 minutes.

So that Domoticz is correct as NR may send garbage.

Regards
User avatar
waltervl
Posts: 6681
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: Node red flow

Post by waltervl »

habahabahaba wrote: Thursday 16 October 2025 9:58
waltervl wrote: Thursday 16 October 2025 8:18 Both values in svalues should be integers so "101;0"
https://wiki.domoticz.com/Domoticz_API/ ... d_counter) - Only Energy should be integer.

@edwin1234, Just try from browser

Code: Select all

http://<domoticz_ip>:8080/json.htm?type=command&param=udevice&idx=1463&nvalue=0&svalue=92.1;0
If NaN will disappear then the problem is in NodeRed or Mqtt, if not - then may be in Domoticz.
And the perhaps also try with an integer as value to see if that is working (i suspect so).

Code: Select all

http://<domoticz_ip>:8080/json.htm?type=command&param=udevice&idx=1463&nvalue=0&svalue=92;0
It could well be that Domoticz has been more strict on values. it is a little bit strange to show watts in digit numbers from history perspective. I dont think that for example a P1 meter is showing watts on digits, only integers.
And that it is not mentioned in the wiki is because it was never mentioned before.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
waltervl
Posts: 6681
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: Node red flow

Post by waltervl »

FireWizard wrote: Thursday 16 October 2025 16:19
What Domoticz version do you run. My test system runs 2025.1 Stable
In the error messages in the log, I see, beside a number of "nan" (Not a Number) for sUsage, also valid numerical values.
And those valid ones are all integers and not digits.....
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
edwin1234
Posts: 330
Joined: Sunday 09 October 2016 20:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Nederland
Contact:

Re: Node red flow

Post by edwin1234 »

With http i get the same error:
2025-10-16 17:30:00.362 Error: UpdateMeter: Error converting sValue/sUsage! (IDX: 1463, sValue: 'nan', sUsage: '974', dType: 243, sType: 29)

I have an older version of domoticz 2021 its old i know but i am afraid that a lot of old stuff and scripts dont work otherwise.
User avatar
waltervl
Posts: 6681
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: Node red flow

Post by waltervl »

edwin1234 wrote: Thursday 16 October 2025 17:34 With http i get the same error:
2025-10-16 17:30:00.362 Error: UpdateMeter: Error converting sValue/sUsage! (IDX: 1463, sValue: 'nan', sUsage: '974', dType: 243, sType: 29)

I have an older version of domoticz 2021 its old i know but i am afraid that a lot of old stuff and scripts dont work otherwise.
Important to know you are on 2021.1...
But what was the http command you sent????
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
edwin1234
Posts: 330
Joined: Sunday 09 October 2016 20:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Nederland
Contact:

Re: Node red flow

Post by edwin1234 »

Domoticz version 2021.1

The command i send was :
http://<domoticz_ip>:8080/json.htm?type=command&param=udevice&idx=1463&nvalue=0&svalue=92;0
User avatar
habahabahaba
Posts: 266
Joined: Saturday 18 March 2023 14:44
Target OS: Windows
Domoticz version: 2024.4
Contact:

Re: Node red flow

Post by habahabahaba »

edwin1234 wrote: Thursday 16 October 2025 17:48 http://<domoticz_ip>:8080/json.htm?type=command&param=udevice&idx=1463&nvalue=0&svalue=92;0
That is only for 2023.2 and later... The API was changed...
User avatar
FireWizard
Posts: 1967
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Node red flow

Post by FireWizard »

Hello @waltervl,

You said:
FireWizard wrote: 16 Oct 2025, 16:19
What Domoticz version do you run. My test system runs 2025.1 Stable
In the error messages in the log, I see, beside a number of "nan" (Not a Number) for sUsage, also valid numerical values.
And those valid ones are all integers and not digits.....
I agree, it are integers and no digits, but this does not explain, why I can send floats, with 1 or 2 digits, without any error message.
See the screenshot of the widget

It is good that this is clear for everyone. Adapting the flow, to send only integers, is an easy job.

Regards
edwin1234
Posts: 330
Joined: Sunday 09 October 2016 20:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Nederland
Contact:

Re: Node red flow

Post by edwin1234 »

If you know how? ;)

Regards
User avatar
FireWizard
Posts: 1967
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Node red flow

Post by FireWizard »

@edwin1234,

You asked:
If you know how? ;)
Yes, I know how, but I think you wanted it to know?

Okay

In the "Function" node change the line:

Code: Select all

msg.payload = { "command": "udevice", "idx": 14, "nvalue" : 0, "svalue": (msg.payload.dps["19"]/10).toString() + ";0"};
into

Code: Select all

msg.payload = { "command": "udevice", "idx": 14, "nvalue" : 0, "svalue": parseInt(msg.payload.dps["19"]/10).toString() + ";0"};
Only added the function parseInt. Ignore the idx number and take your own idx number

Try it and let us know.

Regards
edwin1234
Posts: 330
Joined: Sunday 09 October 2016 20:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Nederland
Contact:

Re: Node red flow

Post by edwin1234 »

I have value on watt now but nan kwh
Should i wait a few hours to see if there comes a value on the kwh?

I have no error in the log now.

Regards
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest