# Node Red to device Domoticz

**URL:** <https://discourse.nodered.org/t/node-red-to-device-domoticz/42358>\
**Category:** General\
**Created:** [9 March 2021 18:55 UTC](https://discourse.nodered.org/t/node-red-to-device-domoticz/42358 "2021-03-09T18:55:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![RobTester](https://avatars.discourse-cdn.com/v4/letter/r/e47c2d/32.png) [@RobTester](https://discourse.nodered.org/u/RobTester)\
**Post date:** [9 March 2021 18:55 UTC](https://discourse.nodered.org/t/node-red-to-device-domoticz/42358/1 "2021-03-09T18:55:52Z")

</div>

Hi,

How can I send a value to Domoticz with a function Node?  
I have a Domoticz Device type "General,kWh" with IDX=522 and I want to have the value what is send with the inject Node in Domoticz Device "Today kWh"

Thanks

 ![Schermafbeelding 2021-03-09 om 19.58.22](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/7/07a5b351537f4442a575249224d20877d017c064.png)

---

<div class="post-metadata">

**Author:** ![FireWizard52](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/firewizard52/32/34508_2.png) [@FireWizard52](https://discourse.nodered.org/u/FireWizard52)\
**Post date:** [9 March 2021 21:23 UTC](https://discourse.nodered.org/t/node-red-to-device-domoticz/42358/2 "2021-03-09T21:23:24Z")

</div>

Hello @RobTester

From the screenshot I cannot see, whether you inject a number or a string ( 10 or "10")  
Also I do not know what you Inject (usage in Watt or cumulative usage in Wh) and how your value should be handled (computed or from device).

Let's assume that you inject usage in Watt and that it is a number.

The contents of the "Function" node would be:

```auto
msg.payload = {"command":"udevice","idx":522,"nvalue":0,"svalue":(msg.payload.toString() + ";0")};
return msg

```

Regards

---

<div class="post-metadata">

**Author:** ![RobTester](https://avatars.discourse-cdn.com/v4/letter/r/e47c2d/32.png) [@RobTester](https://discourse.nodered.org/u/RobTester)\
**Post date:** [10 March 2021 06:32 UTC](https://discourse.nodered.org/t/node-red-to-device-domoticz/42358/3 "2021-03-10T06:32:59Z")

</div>

Hi @FireWizard52

Thank you for the example.  
The value I am reading in is the total solar panel energy delivered from my solar panels on the roof and on the garage. The output of this is only a string, which should represent the value of the total delivered energy kW. This kW indication should then also be presented in the Domoticz device. Currently I get the value in Watts. The intention is that I can see in the Log of the Device per day how much my solar installation has produced.

Regards

---

<div class="post-metadata">

**Author:** ![FireWizard52](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/firewizard52/32/34508_2.png) [@FireWizard52](https://discourse.nodered.org/u/FireWizard52)\
**Post date:** [10 March 2021 10:52 UTC](https://discourse.nodered.org/t/node-red-to-device-domoticz/42358/4 "2021-03-10T10:52:01Z")

</div>

Hello @ RobTester.

You wrote:

> The output of this is only a string, which should represent the value of the total delivered energy kW

The electric sensor in Domoticz will show the current production of electricity in Watt and the cumulative usage in kWh. However the cumulative production is in Wh (even though it is displayed in kWh)

> Currently I get the value in Watts.

That is okay, as Domoticz will calculate the total production.

Can you post a screenshot of the payload, you receive from your solar panels?

Just to avoid that this thread will discuss Domoticz issues and not NR, I suggest that you go to the Domoticz forum and contact me there.(FireWizard)

Regards

---

<div class="post-metadata">

**Author:** ![RobTester](https://avatars.discourse-cdn.com/v4/letter/r/e47c2d/32.png) [@RobTester](https://discourse.nodered.org/u/RobTester)\
**Post date:** [10 March 2021 11:59 UTC](https://discourse.nodered.org/t/node-red-to-device-domoticz/42358/5 "2021-03-10T11:59:37Z")

</div>

Hi @FireWizard52,

I have opened a treat on the Domoticz forum under General discusions

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [9 May 2021 12:00 UTC](https://discourse.nodered.org/t/node-red-to-device-domoticz/42358/6 "2021-05-09T12:00:10Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
