Page 2 of 2

Re: Node Red -> Domoticz help with setting up transfer

Posted: Saturday 22 February 2025 18:24
by Daro1003
You are a great leader.

Thank you
Will you help with the data from the recuperator? If I have the data in NodeRed from the machine?

Re: Node Red -> Domoticz help with setting up transfer

Posted: Saturday 22 February 2025 19:03
by FireWizard
Ho @Daro1003,
You are a great leader.
No I'm not.

I build up some knowledge, but in specific area's and a lot of things are based on 50-60 years of experience.
Will you help with the data from the recuperator? If I have the data in Node Red from the machine?
yes, that's okay, if you can provide the input data and tell me how you want to present the data (which sensors).

Regards

Re: Node Red -> Domoticz help with setting up transfer

Posted: Saturday 22 February 2025 19:55
by Daro1003
I have the data from the recuperator in a program on my computer, now I need to get them into NodeRed somehow.

Re: Node Red -> Domoticz help with setting up transfer

Posted: Sunday 23 February 2025 14:56
by FireWizard
Hello @Daro1003,

You wrote:
I have the data from the recuperator in a program on my computer, now I need to get them into NodeRed somehow.
Your recuperator is the same as I know in ventilation systems as Heat Recovery Unit. Right?

I have of course a few questions.

You have the data available in a program on your computer.

1. What OS runs this Computer? (Windows, Linux, MacOS, etc)
2. Does this program has any interlace to the outside world, like HTTP or MQTT?
3. The first picture (Actual Temperature) looks like a screen on a Smart Phone.
How does your phone communicate? With that program on your computer or directly with the unit.
4. The second picture shows a MobBus (master) simulator. Does that mean that your Heat Recovery Unit
supports ModBus?
5. If so, is it ModBus RTU (serial port) or Modbus TCP (ethernet)
6. Do you have documentation available? Manual? ModBus registers settings?
7. In the first picture I see 4 temperatures:
1. Outside Air Temperature (19.8 oC)
2. Exhaust Air (18.8 oC)
3. Extract Air (19.6 oC)
4. Supply Air (20.1 oC)
Do you want all 4 temperatures in Domoticz or only 1, 2 or 3?
8. Is more data available, that you want to be shown in Domoticz?
9. Are controls available, that you want to use with Domoticz?

Perhaps more questions will arise, but if you can help me with this, we can try to start.

Regards

Re: Node Red -> Domoticz help with setting up transfer

Posted: Monday 24 February 2025 14:49
by FireWizard
hello @Daro1003,

I have looked more carefully to your pictures and I believe I can answer a few of my own questions (partly), but you should confirm, that I'm correct
1What OS runs this Computer? (Windows, Linux, MacOS, etc)
I think that you mean with 'the program on your computer', the "Modbus master Simulator" from Radzio!
See: https://en.radzio.dxp.pl/modbus-master-simulator/

This is a Windows application, so the OS is Windows and not relevant.
Does this program has any interlace to the outside world, like HTTP or MQTT?
No it has not, it talks ModBus protocol to your Device, which is a ModBus Slave
The second picture shows a MobBus (master) simulator. Does that mean that your Heat Recovery Unit
supports ModBus?
I think, it does.
If so, is it Mod-bus RTU (serial port) or Modbus TCP (Ethernet)
ModBus TCP, but I need the ModBus register information

And please answer also the other remaining questions.

[Edit] Can you also provide the brand and typenumber of your recuperator unit?

Regards

Re: Node Red -> Domoticz help with setting up transfer

Posted: Tuesday 25 February 2025 6:32
by Daro1003
Hey
I managed to read the data from the Recuperator in NodeRed - it has quite a lot of data but first I would like to send the temperatures marked in red in the image 1, 2, 3, 4.

1. The program works on a computer with Windows.

2. I have no idea

3. Yes, this is an image from a smartphone application

4. Yes, my heat recovery unit supports Modbus.

5. Modbus RTU and Modbus TCP - I use TCP, it reads data over the network. The heat recovery unit is connected to the home network using Wi-Fi

6. Yes, I have the documentation, I am sending it in the attachment, but it is also available on the vents website, I am sending the link below

7. I would like to read all 4 temperatures at the beginning.

8. Much more data is available for the beginning of the temperature, but I think I would like more data if I can decipher it.

Is it possible to send commands to the heat recovery unit? For example, to change the speed or turn off or on the schedule?

My heat recovery unit is: Vents VUTR 600 VE EC A21 https://ventilation-system.com/product/ ... #downloads

Re: Node Red -> Domoticz help with setting up transfer

Posted: Tuesday 25 February 2025 19:52
by FireWizard
Hi @Daro1003,

This is exactly, what I needed, thanks for that.
I downloaded a number of their documents as well

Please find the "flow" of only the "Function"node below.
The total flow is almost identical with the previous flow of the Sofar 15KTL-X inverter.

Screenshot_Vents.png
Screenshot_Vents.png (55.02 KiB) Viewed 1270 times
As said, I send you only the "Function" node, called "Prepare for Domoticz"
For the other nodes use your own ModBus Read node and MQTT output node

In the "Function" node, replace the idx1, idx2, idx3 and idx4 with your own indexes of the Virtual Temperature sensors,
as you did before in the inverter flow.

Below the flow of the "function" node:
Import this in the usual way.

Code: Select all

[
    {
        "id": "e03d6e55aef23111",
        "type": "function",
        "z": "972c9476422a46d9",
        "name": "Prepare for Domoticz",
        "func": "// Declaration of variables\n\nlet idx1 = 123;\nlet idx2 = 456;\nlet idx3 = 789;\nlet idx4 = 158;\n\nlet msg1 = {};\nlet msg2 = {};\nlet msg3 = {};\nlet msg4 = {};\n\nmsg1.payload = { \"command\": \"udevice\", \"idx\": idx1, \"svalue\": (msg.payload[1] / 10).toString() };\nmsg2.payload = { \"command\": \"udevice\", \"idx\": idx2, \"svalue\": (msg.payload[2] / 10).toString() };\nmsg3.payload = { \"command\": \"udevice\", \"idx\": idx3, \"svalue\": (msg.payload[3] / 10).toString() };\nmsg4.payload = { \"command\": \"udevice\", \"idx\": idx4, \"svalue\": (msg.payload[4] / 10).toString() };\n\nreturn[[msg1,msg2,msg3,msg4]];",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1060,
        "y": 180,
        "wires": [
            []
        ]
    }
]
Consider also the following:

For all sensors the following is the case. -32768 - no sensor, +32767 - short circuit
As this are not real temperatures, but only an indication of a lost sensor or shortcut it is advisable to use a "Text" or "Alert" sensor to monitor the wiring to the sensors. In that case we have to add a "Fault" indication. Think about that

Regards and let me know.

Re: Node Red -> Domoticz help with setting up transfer

Posted: Tuesday 25 February 2025 20:04
by Daro1003
Tell me what changes if I want to read more data in the future?

What should be changed in the system you sent me?

P.S. Do you also have such a recuperator?

Re: Node Red -> Domoticz help with setting up transfer

Posted: Tuesday 25 February 2025 20:36
by Daro1003
I think I understood, I added one IDX and changed the name in NodeRed and it's ok:

Code: Select all

[
    {
        "id": "e03d6e55aef23111",
        "type": "function",
        "z": "972c9476422a46d9",
        "name": "Rekuperator do Domoticz",
        "func": "// Declaration of variables\n\nlet idx1 = 123;\nlet idx2 = 456;\nlet idx3 = 789;\nlet idx4 = 158;\nlet idx5 = 413;\n\nlet msg1 = {};\nlet msg2 = {};\nlet msg3 = {};\nlet msg4 = {};\nlet msg5 = {};\n\nmsg1.payload = { \"command\": \"udevice\", \"idx\": idx1, \"svalue\": (msg.payload[1] / 10).toString() };\nmsg2.payload = { \"command\": \"udevice\", \"idx\": idx2, \"svalue\": (msg.payload[2] / 10).toString() };\nmsg3.payload = { \"command\": \"udevice\", \"idx\": idx3, \"svalue\": (msg.payload[3] / 10).toString() };\nmsg4.payload = { \"command\": \"udevice\", \"idx\": idx4, \"svalue\": (msg.payload[4] / 10).toString() };\nmsg5.payload = { \"command\": \"udevice\", \"idx\": idx5, \"svalue\": (msg.payload[5] / 10).toString() };\n\nreturn[[msg1,msg2,msg3,msg4,msg5]];",
		"outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1060,
        "y": 180,
        "wires": [
            []
        ]
    }
]
Is this ok?
Can I add other data this way?

Re: Node Red -> Domoticz help with setting up transfer

Posted: Tuesday 25 February 2025 20:39
by Daro1003
I just don't know what the "ID" and "Z" code means, is it some kind of unique number?

Re: Node Red -> Domoticz help with setting up transfer

Posted: Tuesday 25 February 2025 21:32
by FireWizard
Hi,

What do you mean with ID code? Idx?

And what do you mean with Z code?

Regards

Re: Node Red -> Domoticz help with setting up transfer

Posted: Tuesday 25 February 2025 22:21
by Daro1003
What I marked in the code:

Re: Node Red -> Domoticz help with setting up transfer

Posted: Tuesday 25 February 2025 23:12
by Daro1003
And what about sending commands from Domoticz to the recuperator?

This part probably corresponds to:

Re: Node Red -> Domoticz help with setting up transfer

Posted: Wednesday 26 February 2025 16:14
by FireWizard
Hello @Dara1003,

Let me answer the questions first, you previously asked, before I explain how to write ModBus commands.
Tell me what changes if I want to read more data in the future?
This depends on what you want. Basically you have to consider the following steps:

1. What do I want to send from the device to Domoticz. In your case, it is the "Vents" Recuperator, but it is also possible with other devices.
that support HTTP, MQTT, ModBus or even anything else.
2. What is the most suitable sensor, available in Domoticz. For e.g. a temperature the most suitable sensor is a temperature sensor. That's obvious, but sometimes a sensor is not available. In that case you can select the "Custom" sensor
3. Have a look at https://piandmore.wordpress.com/2019/02 ... -domoticz/ and see, what the sensor of your choice requires.
Most sensors require only a string value, but a few, such as "Air Quality" need a nvalue and even some, such as "Alert", needs both.
4. In the "Function" node, you can simply extend the number of messages by
- Declare a new msg variable, such as msgxx
- Declare a new idx variable, equal to the idx of the virtual sensor, you configured in Domoticz.
- Dependent on the required format (see previous link) create your string.

Note,

Be aware that in case you want to send a numerical value, such as a Temperature, and the format of the message requires that that value is in "svalue", you should convert the value to a string. The used method is to add "toString()"
What should be changed in the system you sent me?
See above
P.S. Do you also have such a recuperator?
No, I do not have such a unit. Otherwise I could have send you a copy of my flow. :D
I think I understood, I added one IDX and changed the name in NodeRed and it's ok:
Node-RED flows are exported (and also imported) in JSON code.
Never edit, and I repeat, never edit to JSON code directly in the exported flow.
Do always a normal import (or export), using the "Hamburger" menu, by selecting "Import" (or "Export")
If you want to change particular properties of a node, such as "Name", "double click" on the node and the editor of the node will open.
There you do all the editing.
Is this ok?
If you do it the correct way, then "Yes", but, as said, edit the node properties only in the editor and not directly in the flow.
Can I add other data this way?
Yes, you can

But I also recommend to watch some of the Node-RED video's available on the Internet.
I just don't know what the "ID" and "Z" code means, is it some kind of unique number?
What I marked in the code:
Now it is clear to me, but I never look into that code. Keep in mind that wires, connections, node positions on the canvas, etc. are also included in that JSON code. So if you want to know it, look into the Node-RED source code.
And what about sending commands from Domoticz to the recuperator?
I will explain that later in a separate post.

Regards

Re: Node Red -> Domoticz help with setting up transfer

Posted: Thursday 27 February 2025 14:34
by FireWizard
hello @Daro1003,

As promised, hereby my example of sending commands to your Vents equipment.

I follow the steps, that I explained in my previous post.

In my example, I want to control the Power of the Unit. So Unit On/Off and also want to be able to "Reset all alarms"
This means, I have to write a Binary value (either 0/1 or false/true) into the register with address 0.
This is a Read/Write register.
For the "Reset all alarms", I need to write a 1/0 into the register with address 18 This register address in only writable.

Therefor I use two virtual switches in Domoticz, as follows:

1. On/Off Switch for the 'Unit On/Off'

Screenshot_Domoticz On-Off-Switch.png
Screenshot_Domoticz On-Off-Switch.png (87.19 KiB) Viewed 1142 times

2.Push On Button for the "Reset all alarms" function

Screenshot_Domoticz Push_On-Button.png
Screenshot_Domoticz Push_On-Button.png (87.58 KiB) Viewed 1142 times

As a "Push On button" does not return to Off (false or 0) after being pushed, you have to set
the "Off Delay" to another value. In this example it will give a pulse with a duration of 1 second.


If you "Push" the Switch or the "Button", you will publish this to the MQTT topic "domoticz/out" (depends on your Domoticz Settings)
The message looks as follows:

Screenshot_Switch MQTT Out.png
Screenshot_Switch MQTT Out.png (22.8 KiB) Viewed 1142 times
The important elements in this object are idx (in this case 10) and nvalue ( in this case 1).

In my next post I will cover the Node-RED part

Regards

Re: Node Red -> Domoticz help with setting up transfer

Posted: Thursday 27 February 2025 14:57
by FireWizard
Hi, @daro 1003,

This part covers the Node-RED nodes needed to control your vents equipment.

Screenshot_Modbus-Control.png
Screenshot_Modbus-Control.png (48.01 KiB) Viewed 1140 times
First you have to configure your own MQTT server (Broker) You can use the same configuration as for the MQTT Output node.
The topic is "domoticz/out"

The next node is a "default" "Switch" node. This node filters the different idx's of your virtual Domoticz switches (On/Off and Push On Button).
The On/Off Switch goes to output 1 and the Push On button goes to output 2.

The "Change"node moves msg.payload.nvalue to msg.payload and that data is sent to to ModBus "Write" node.

The "Inject node is used to set the "Preset" value into the 'Register address"

You can remove all the "Debug" nodes, as soon as everything has been tested.

Please find the flow below:

Code: Select all

[
    {
        "id": "93913941cc4231cc",
        "type": "mqtt in",
        "z": "972c9476422a46d9",
        "name": "From Domoticz",
        "topic": "domoticz/out",
        "qos": "0",
        "datatype": "auto-detect",
        "broker": "175c3dc01f359e9d",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 140,
        "y": 440,
        "wires": [
            [
                "5dfe82928ca830f0"
            ]
        ]
    },
    {
        "id": "5dfe82928ca830f0",
        "type": "switch",
        "z": "972c9476422a46d9",
        "name": "Split Commands",
        "property": "payload.idx",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "10",
                "vt": "num"
            },
            {
                "t": "eq",
                "v": "11",
                "vt": "num"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 370,
        "y": 440,
        "wires": [
            [
                "7a74f7aa86cdb761",
                "416007f8a4a3c831"
            ],
            [
                "dad788f1bf3bc6c6",
                "6039a68fa21840c4"
            ]
        ]
    },
    {
        "id": "7a74f7aa86cdb761",
        "type": "debug",
        "z": "972c9476422a46d9",
        "name": "debug 14",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 580,
        "y": 340,
        "wires": []
    },
    {
        "id": "dad788f1bf3bc6c6",
        "type": "debug",
        "z": "972c9476422a46d9",
        "name": "debug 15",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 580,
        "y": 540,
        "wires": []
    },
    {
        "id": "d3eec76e54bbc6f0",
        "type": "modbus-write",
        "z": "972c9476422a46d9",
        "name": "To Vents",
        "showStatusActivities": false,
        "showErrors": false,
        "showWarnings": true,
        "unitid": "1",
        "dataType": "Coil",
        "adr": "0",
        "quantity": "1",
        "server": "7f7fed9221928721",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 880,
        "y": 400,
        "wires": [
            [
                "aa132a17d7edbe25"
            ],
            [
                "0f9c72e16fb0bc5e"
            ]
        ]
    },
    {
        "id": "416007f8a4a3c831",
        "type": "change",
        "z": "972c9476422a46d9",
        "name": "",
        "rules": [
            {
                "t": "move",
                "p": "payload.nvalue",
                "pt": "msg",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 640,
        "y": 400,
        "wires": [
            [
                "a1b2a6df7e87b16b",
                "d3eec76e54bbc6f0"
            ]
        ]
    },
    {
        "id": "a1b2a6df7e87b16b",
        "type": "debug",
        "z": "972c9476422a46d9",
        "name": "debug 20",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 880,
        "y": 340,
        "wires": []
    },
    {
        "id": "aa132a17d7edbe25",
        "type": "debug",
        "z": "972c9476422a46d9",
        "name": "debug 21",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1060,
        "y": 380,
        "wires": []
    },
    {
        "id": "0f9c72e16fb0bc5e",
        "type": "debug",
        "z": "972c9476422a46d9",
        "name": "debug 22",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1060,
        "y": 420,
        "wires": []
    },
    {
        "id": "6039a68fa21840c4",
        "type": "change",
        "z": "972c9476422a46d9",
        "name": "",
        "rules": [
            {
                "t": "move",
                "p": "payload.nvalue",
                "pt": "msg",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 640,
        "y": 480,
        "wires": [
            [
                "6ebd7c59520cc41f",
                "dc6750fcbe3cb228"
            ]
        ]
    },
    {
        "id": "6ebd7c59520cc41f",
        "type": "modbus-write",
        "z": "972c9476422a46d9",
        "name": "To Vents",
        "showStatusActivities": false,
        "showErrors": false,
        "showWarnings": true,
        "unitid": "1",
        "dataType": "Coil",
        "adr": "18",
        "quantity": "1",
        "server": "7f7fed9221928721",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 880,
        "y": 480,
        "wires": [
            [
                "9b4eae8c44c6b861"
            ],
            [
                "6f48f5a58816c04e"
            ]
        ]
    },
    {
        "id": "9b4eae8c44c6b861",
        "type": "debug",
        "z": "972c9476422a46d9",
        "name": "debug 23",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1060,
        "y": 460,
        "wires": []
    },
    {
        "id": "6f48f5a58816c04e",
        "type": "debug",
        "z": "972c9476422a46d9",
        "name": "debug 24",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1060,
        "y": 500,
        "wires": []
    },
    {
        "id": "637b7ab6d1034d60",
        "type": "inject",
        "z": "972c9476422a46d9",
        "name": "Start",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "false",
        "payloadType": "bool",
        "x": 710,
        "y": 440,
        "wires": [
            [
                "d3eec76e54bbc6f0"
            ]
        ]
    },
    {
        "id": "dc6750fcbe3cb228",
        "type": "debug",
        "z": "972c9476422a46d9",
        "name": "debug 26",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 880,
        "y": 540,
        "wires": []
    },
    {
        "id": "175c3dc01f359e9d",
        "type": "mqtt-broker",
        "name": "Raspberry Pi 1B",
        "broker": "192.168.10.51",
        "port": 1883,
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": 4,
        "keepalive": 60,
        "cleansession": true,
        "autoUnsubscribe": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthRetain": "false",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closeRetain": "false",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willRetain": "false",
        "willPayload": "",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    },
    {
        "id": "7f7fed9221928721",
        "type": "modbus-client",
        "name": "Reku",
        "clienttype": "tcp",
        "bufferCommands": true,
        "stateLogEnabled": false,
        "queueLogEnabled": false,
        "failureLogEnabled": true,
        "tcpHost": "192.168.10.1",
        "tcpPort": 502,
        "tcpType": "DEFAULT",
        "serialPort": "/dev/ttyUSB",
        "serialType": "RTU-BUFFERD",
        "serialBaudrate": 9600,
        "serialDatabits": 8,
        "serialStopbits": 1,
        "serialParity": "none",
        "serialConnectionDelay": 100,
        "serialAsciiResponseStartDelimiter": "0x3A",
        "unit_id": 1,
        "commandDelay": 1,
        "clientTimeout": 1000,
        "reconnectOnTimeout": true,
        "reconnectTimeout": 2000,
        "parallelUnitIdsAllowed": true,
        "showErrors": false,
        "showWarnings": true,
        "showLogs": true
    }
]
Test these things carefully, as an error in addressing the registers is easily made.

let me know the results.

Regards

Re: Node Red -> Domoticz help with setting up transfer

Posted: Thursday 06 March 2025 14:04
by Daro1003
Hello

Regarding the data from the inverter - converter, I wanted to take a reading of how many KWH are charged daily.

So I created a sensor: "instantaneous electricity + meters" but it only shows the power W and does not show the consumption.

Do I need to process this data in NodeRed somehow?