logo elektroda
logo elektroda
X
logo elektroda

Domoticz and the Vents VUT R 600 VE EC A21 recuperator: communication via Modbus and Raspberry Pi

Daro1003 2949 61
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #31 21065007
    xury
    Automation specialist
    I could arrange it, as long as it is within 100km of Radom. I do not want to drive further. Not everything can be done remotely, unless you guarantee that everything is physically correct and connected and access is provided via, for example, Anydesk.
  • ADVERTISEMENT
  • #32 21065018
    Daro1003
    Level 33  
    A little further than 100km

    I think redirects or Anydesk and would take care of the subject.
  • #33 21065062
    zuhjk
    Level 22  
    >>21064990
    I recommend myself because I have a contact with a person who does for me. I also have off grid solar and inverter on rs485. as i wrote there are several ways.
    It can be done on node red - i'm testing, on a gateway (the name doesn't matter for now} it can talk directly to domoticz after mqtt - in the initial setup phase. can be programmed in flprog esp32 - I haven't got around to it yet, need good knowledge of Russian.
    The best programmers are at russian.

    Added after 12 [minutes]:

    Daro1003 wrote:
    A little further like 100km

    I think redirects or Anydesk and would take care of the subject.

    It would be nice to have a fixed IP and be able to write redirects to hardware, internal devices to be able to call them directly
    from the other end of the country. Maintaining a proper network security policy.
  • Helpful post
    #35 21451976
    michal.zd
    Level 28  
    I can also write a program for rpi that reads the data from the control panel and uploads the json to mosquitto. Only for this I need time, well and testing time at daro.
  • ADVERTISEMENT
  • #36 21451988
    Daro1003
    Level 33  
    michal.zd wrote:
    I can also write a program for rpi


    That would be great.

    michal.zd wrote:
    only it needs time for that, and testing time at daro.


    This is the worst thing: people often plan what they will not do, but it is difficult to find the time.

    If you write a programme I will test it.
    Maybe someone will find it useful, by the way, I wonder if anyone is already using your program for the inverter besides me.
  • #37 21452002
    michal.zd
    Level 28  
    Daro1003 wrote:
    I wonder if anyone is already using your inverter program besides me.
    .
    If they have node-red, you can embrace everything in it, no need to make separate programs.
    I wrote in c because with binary data it's simpler for me to do it that way than with node blocks. Basically the same way I have the other pieces of the puzzle done, the calculations in the program and the finished results get node-red.
  • #38 21454728
    Daro1003
    Level 33  
    Screenshot of a program with a data table and debug results on the right side. .

    See @michal.zd because I don't believe it myself.

    Now the question of what I managed to read.
    Question how to read other tables from the radzio program ??
  • ADVERTISEMENT
  • #39 21454742
    michal.zd
    Level 28  
    Apparently so.
    Others have a different starting address. Everything is in the document you sent me.
    In it you will also find the descriptions of the data you read.
  • #40 21454753
    Daro1003
    Level 33  
    michal.zd wrote:
    The others have a different starting address. Everything is in the document you sent me.
    In it you will also find the descriptions of the data you read.


    I just can't get it down yet.
  • #41 21454759
    michal.zd
    Level 28  
    Post the flow definitions you used, using the export. I'll take a look at it, maybe someone has already done something similar.
  • #42 21454767
    Daro1003
    Level 33  
    I set it up that way and it went:

    Screenshot showing Modbus-Read node configuration in Node-RED with active debugging. .
  • #43 21454776
    michal.zd
    Level 28  
    In node-red you can basically embrace everything, but sometimes there will be a complicated flow. It is easier to do the same in a normal program written in c/cpp.
  • #44 21454777
    Daro1003
    Level 33  
    I have temperatures like nothing:


    bb647f92a Table of input registers with Modbus functions for temperature. .
  • #45 21454780
    michal.zd
    Level 28  
    Daro1003 wrote:
    I set
    .
    There is an address there, you currently have a value of 1. The next address where something is is 21 and 31 and 41.
    Type there and see if the data agrees with the data in the corresponding columns.
  • #46 21454781
    Daro1003
    Level 33  
    Now just how to upload to domoticz.

    I wonder if there is a standard layout of what a fellow Domoticz forum member sent or a completely different code.
  • #47 21454785
    michal.zd
    Level 28  
    Aa in the program you read 90 registers at once. Set up the same way in node-red.
  • #48 21454789
    Daro1003
    Level 33  
    michal.zd wrote:
    The next address where something is at is 21st and 31st and 41st.


    And in the documentation it says 1 - 16


    Table showing Modbus parameters with address column highlighted as 1-16.

    I do not understand why exactly.
  • ADVERTISEMENT
  • Helpful post
    #49 21454792
    michal.zd
    Level 28  
    Daro1003 wrote:
    Now just how to upload to domoticz
    .
    Same as for sofar.
    Identical json, you can just copy this node and replace idx and svalue.
  • #50 21454795
    Daro1003
    Level 33  
    michal.zd wrote:
    Aa in the program you read 90 registers at once. Set up the same in node-red.
    .


    Screenshot of Node-RED editor configured for a Modbus node with the quantity field set to 90. .

    Continues to show 10 as I give here at 90

    Added after 1 [minute]:

    It is ok though:


    Debug interface displaying array values with a ok annotation.
  • #51 21454803
    michal.zd
    Level 28  
    Daro1003 wrote:
    I don't understand why exactly.

    Sometimes it's not worth getting into 😉 . Read 90 registers from address 1, you get the same data as you see in the program.
    I don't know the node, for reading modbus, look on the net where it is set up.

    Added after 1 [minute]: .

    Daro1003 wrote:
    It is ok however:
    .
    Oh you see. Next up is the flake...
  • #52 21454831
    Daro1003
    Level 33  
    michal.zd wrote:
    Identical json, you can just copy this node and replace the idx and svalue.


    So something in the code below needs to be changed:

    
    [
        {
            "id": "9faeea04b2b50403",
            "type": "function",
            "z": "c03666d911c02a8f",
            "name": "Prepare for Domoticz",
            "func": "// Declaration of variables\n\nlet idx1 = 123;\nlet idx2 = 456;\nlet idx3 = 789;\n\nlet msg1 = {};\nlet msg2 = {};\nlet msg3 = {};\n\nmsg1.payload = { \"command\": \"udevice\", \"idx\": idx1, \"svalue\": msg.payload.P.toString() + \";0\"};\nmsg2.payload = { \"command\": \"udevice\", \"idx\": idx2, \"svalue\": msg.payload.GP.toString() + \";0\" };\nmsg3.payload = { \"command\": \"udevice\", \"idx\": idx3, \"svalue\": msg.payload.CP.toString() + \";0\" };\n\nreturn[[msg1,msg2,msg3]];",
            "outputs": 1,
            "timeout": 0,
            "noerr": 0,
            "initialize": "",
            "finalize": "",
            "libs": [],
            "x": 460,
            "y": 180,
            "wires": [
                [
                    "85eb0898c7979634",
                    "5b94fc5b22b41f4e"
                ]
            ]
        },
        {
            "id": "5b94fc5b22b41f4e",
            "type": "mqtt out",
            "z": "c03666d911c02a8f",
            "name": "MQTT Domoticz",
            "topic": "",
            "qos": "",
            "retain": "",
            "respTopic": "",
            "contentType": "",
            "userProps": "",
            "correl": "",
            "expiry": "",
            "broker": "175c3dc01f359e9d",
            "x": 710,
            "y": 180,
            "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": ""
        }
    ]
    
    
    .

    Added after 4 [minutes]:

    You still have to process the data somehow because it is, for example, 183 and that is 18.3 degrees.
  • #53 21454845
    michal.zd
    Level 28  
    No. I'll hint tomorrow when I'm at the computer, I'm writing from a tablet.
  • #54 21454877
    Daro1003
    Level 33  
    Cool.
    I didn't think it would go so smoothly with that recuperator data I was sure it was a much more complicated affair.

    I wonder if other devices that have modbus can also be read this way.
  • #55 21454900
    michal.zd
    Level 28  
    Daro1003 wrote:
    I wonder if other devices that have a modbus can also be read this way
    .
    If you have access to the documentation and the device has a modbus TCP interface, then by all means. The interface itself is a standard, but what you read depends on the system (manufacturer).
  • #56 21456142
    Daro1003
    Level 33  
    @michal.zd I already have a feature node from a fellow domoticz forum member.

    The only topic left is how to embrace the data from the recuperator to make it not 199 but 19.9.
    Currently it commands me the data the recuperator sends.

    
    [
        {
            "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": [
                []
            ]
        }
    ]
    
    .

    What is changing here in this code ?
    If I wanted to add more data ?

    Added after 23 [minutes]:

    I think I've covered:

    
    [
        {
            "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": [
                []
            ]
        }
    ]
    


    I just don't know what the ID and Z stand for if it's always the same or if it's some unique number.
  • #57 21456187
    michal.zd
    Level 28  
    Daro1003 wrote:
    recuperator to make it not 199 just 19.9
    .
    Ee o just plain maths, divide by di before writing to msg.
    Aa you already have I see in the Flow code.

    Added after 10 [hours] 5 [minutes]: .

    Daro1003 wrote:
    I just don't know what ID and Z mean
    .
    This is internal node-red stuff, node ID, don't change it.
  • #58 21456551
    Daro1003
    Level 33  
    michal.zd wrote:
    This is internal node-red business, node ID, don't change it.
    .

    ok but what if i want to create a new node-red flow for another node, what does it say there ?
  • #59 21456951
    michal.zd
    Level 28  
    Nothing, these are as I wrote, node-red's internal idxes.
    I think you've confused them with domoticz's idx.
    Then that's what you specify in node with the msg formatting function.

    Added after 1 [minute]: .

    And yes, just import into the new flow do:
    Screenshot of Node-RED interface for importing flows with JSON code. .

    and then in
    View of a function node in Node-RED labeled Rekuperator do Domoticz. .
    substitute idx for domoticz.
  • #60 21459691
    zuhjk
    Level 22  
    Daro1003 wrote:
    Cool.
    I didn't think it would go so smoothly with that recuperator data I was sure it was a much more complicated affair.

    I wonder if other devices that have modbus can also be read this way.

    Cool that you have mastered this node-red, for me it was put together by a colleague and everything worked. Sometimes the read data after MQTT doesn't agree with MQTT what ingests domoticz.
    You need to format it properly which node-red does perfectly. As I wrote, I also sent data from the microtik like received signal strength to domoticz.
    Modbus is the standard for sending data. This data can be sent to domoticz from any device that has a modbus interface. It is a free interface
    It is a free interface, focused on reading rather than writing. It is also limited to a certain number of read devices.

Topic summary

The discussion focuses on integrating the Vents VUT R 600 VE EC A21 recuperator with Domoticz running on a Raspberry Pi via Modbus communication. The recuperator supports Modbus TCP over RS485, accessible through an embedded A21 module or via LAN/Wi-Fi with a converter. Initial steps involve establishing communication using Modbus master simulators on PC to read input registers, primarily temperature and humidity data. Challenges include identifying the correct IP address for Wi-Fi connections, setting fixed IPs for stable communication, and understanding Modbus RTU over TCP versus Modbus TCP protocols. Domoticz configuration requires appropriate plugins and correct setup of communication parameters (RTU over TCP or RTU via USB), with read-only or read-write modes depending on needs. Node-RED is recommended as a middleware to parse Modbus frames, convert data to JSON, and publish via MQTT to Domoticz, facilitating both data reading and control commands. Users share Node-RED flow examples for data scaling and device control, emphasizing the need for knowledge in JavaScript and Modbus protocol specifics. The community highlights the scarcity of ready-made plugins and suggests seeking expert assistance for complex integration. The discussion also touches on similar RS485 integrations with other devices like Sofar photovoltaic inverters and Vaillant EcoTEC boilers.
Summary generated by the language model.
ADVERTISEMENT