Orno Power-Meters with Modbus RS485 and Node-Red - an unexpected success-story

Tuya introduced new powermeters that can not easily be hacked/ported to local-tuya. They deliver malformed json and i did not want to brush up on my python to try and fffffix up stuff. And since my wifi is allways a bit crowded i can get some more bandwidth by freeing it up.

So, i bought the following

  • 1 additional network-switch (~16€ Aliexpress)
  • 1 Orno OR-WE-514 Single-Phase Din-Rail Powermeter (~30€ - Amazon)
    image
  • 1 ZLAN 5143D Din-Rail Modbus RTU to Ethernet TCP Server (~16€ - Aliexpress)
    image
  • 1 24V= Din-Rail PSU (~16€ - Amazon)
    image

The Orno is a Single-Width Power Meter. Needs L and N to work and offers A,B,Gn Serial Modbus connector. Taking only the powermeter and the modbus-server in account, the price is comparable to the tuya devices with the benefit, that we get off the cloud but switching the cicuit needs an additional solution, that we will talk about in an other installment of the modbus-saga.

The Orno has the following registers:

0x0130 - 304   - Frequency - Hz
0x0131 - 305   - Voltage - V
0x0139 - 314   - Current - A
0x0140 - 320   - Active Power - kW
0x0148 - 328   - Reactive Power - kW
0x0150 - 336   - Apperent Power - kW
0x0158 - 344   - Power Factor - cosPHI
0xA000 - 40960 - Total Power - kWh
0xA030 - 41010 - Power last Month - kWh

The ZLAN-Server is easily setup with the tool provided. i gave it a fixed IP
and it works fine with both the modbus integration and the node-red modbus nodes.

on the web-surface i set the serial parameters for the Orno

and then the node-red-tango started.
since i plan to use modbus via node-red a lot, i wanted to use the flex-getter. so i had to put together the follwing flow:

i put the code for you to import into a comment down under:

lets go through the flow:

1.)
image
image

So, basically the flow starts 15 seconds after startup and “runs” in a loop with 11 sec. interval.


2.)
image
to get anything wiht the getter you have to enter code into a function to hand a prepared msg-object over to the flex-getter

msg.payload = {
    'fc': 3,
    'unitid': 1,
    'address': 0x0131,
    'quantity': 1
    };
return msg;

for larger values we read two words, not one:

msg.payload = {
    'fc': 3,
    'unitid': 1,
    'address': 0xA000,
    'quantity': 2,
    };
return msg;


3.)
image
here…
image

The Flex-Getter gets also the “server-config” for the Modbus RTU-TCP-Gateway.
image


4.)
image
We want to rectify the returned value to fit the “scale” of the Unit and get rid of unusual values…
so we add the following function:

value= msg.payload.data[0]/100; 

if (value < 0.01) {
    value= 0
}
msg.payload = value;
return msg;

some values come as a double-word, so its not an integer but a larger number, needing two registers
there we concatenate the two values as follows:

value= (msg.payload.data[0] << 16) + msg.payload.data[1];

if (value < 0.01) {
    value= 0
}
msg.payload = value;
return msg;


5.)
image

so, finally we feed the home-assistant an entity with the newly aquired value

Any other Business/
Final Words

  • put in more infos about the Modbus Gateway
  • put in more infos about the Power Meter
  • Draw up a electric wiring diagramm
  • “fulfill readers wishes”

here is the complete code from the node-red-flow.
feel free to use on your own risk :crazy_face:

[
    {
        "id": "95b1a3ab.e15c1",
        "type": "tab",
        "label": "OR-WE-514 - Flex Test",
        "disabled": false,
        "info": ""
    },
    {
        "id": "62eff98004127c80",
        "type": "modbus-flex-getter",
        "z": "95b1a3ab.e15c1",
        "name": "Get Voltage",
        "showStatusActivities": true,
        "showErrors": true,
        "logIOActivities": false,
        "server": "982d9453.cd0ef",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 530,
        "y": 140,
        "wires": [
            [
                "7a6463149d53365b"
            ],
            [
                "96e65b943cda6c15"
            ]
        ]
    },
    {
        "id": "a79fb589bd77dafd",
        "type": "function",
        "z": "95b1a3ab.e15c1",
        "name": "0x0131 Voltage",
        "func": "msg.payload = {\n    'fc': 3,\n    'unitid': 1,\n    'address': 0x0131,\n    'quantity': 1\n    };\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 340,
        "y": 140,
        "wires": [
            [
                "62eff98004127c80"
            ]
        ]
    },
    {
        "id": "96e65b943cda6c15",
        "type": "function",
        "z": "95b1a3ab.e15c1",
        "name": "/100",
        "func": "value= msg.payload.data[0]/100; \nif (value < 0.01) {\n    value= 0\n}\nmsg.payload = value;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 770,
        "y": 140,
        "wires": [
            [
                "19f3fd563d026744",
                "9a46b7cad05cae9f"
            ]
        ]
    },
    {
        "id": "19f3fd563d026744",
        "type": "ha-entity",
        "z": "95b1a3ab.e15c1",
        "name": "ModPow1 Volts",
        "server": "69eb452d.8a610c",
        "version": 1,
        "debugenabled": false,
        "outputs": 1,
        "entityType": "sensor",
        "config": [
            {
                "property": "name",
                "value": "Pow1 Volts"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": "V"
            }
        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": false,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "allow",
        "outputOnStateChange": false,
        "outputPayload": "$entity().state ? \"on\": \"off\"",
        "outputPayloadType": "jsonata",
        "x": 1020,
        "y": 140,
        "wires": [
            []
        ]
    },
    {
        "id": "53ad96eee82c4d59",
        "type": "function",
        "z": "95b1a3ab.e15c1",
        "name": "0x0139 Current",
        "func": "msg.payload = {\n    'fc': 3,\n    'unitid': 1,\n    'address': 0x0139,\n    'quantity': 1\n    };\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 340,
        "y": 200,
        "wires": [
            [
                "b7cf124cca2bc33b"
            ]
        ]
    },
    {
        "id": "b7cf124cca2bc33b",
        "type": "modbus-flex-getter",
        "z": "95b1a3ab.e15c1",
        "name": "Get Current",
        "showStatusActivities": true,
        "showErrors": true,
        "logIOActivities": false,
        "server": "982d9453.cd0ef",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 530,
        "y": 200,
        "wires": [
            [
                "7a6463149d53365b"
            ],
            [
                "f5cd417fd295827a"
            ]
        ]
    },
    {
        "id": "f5cd417fd295827a",
        "type": "function",
        "z": "95b1a3ab.e15c1",
        "name": "/100",
        "func": "value= msg.payload.data[0]/100;\nif (value < 0.01) {\n    value= 0\n}\nmsg.payload = value;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 770,
        "y": 200,
        "wires": [
            [
                "30da9faac195f00f",
                "9a46b7cad05cae9f"
            ]
        ]
    },
    {
        "id": "30da9faac195f00f",
        "type": "ha-entity",
        "z": "95b1a3ab.e15c1",
        "name": "ModPow1 Amps",
        "server": "69eb452d.8a610c",
        "version": 1,
        "debugenabled": false,
        "outputs": 1,
        "entityType": "sensor",
        "config": [
            {
                "property": "name",
                "value": "Pow1 Amps"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": "A"
            }
        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": false,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "allow",
        "outputOnStateChange": false,
        "outputPayload": "$entity().state ? \"on\": \"off\"",
        "outputPayloadType": "jsonata",
        "x": 1020,
        "y": 200,
        "wires": [
            []
        ]
    },
    {
        "id": "6c04d6080a763d91",
        "type": "function",
        "z": "95b1a3ab.e15c1",
        "name": "0x0140 Power",
        "func": "msg.payload = {\n    'fc': 3,\n    'unitid': 1,\n    'address': 0x0140,\n    'quantity': 1\n    };\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 340,
        "y": 260,
        "wires": [
            [
                "3ae21f81a0a03eb5"
            ]
        ]
    },
    {
        "id": "3ae21f81a0a03eb5",
        "type": "modbus-flex-getter",
        "z": "95b1a3ab.e15c1",
        "name": "Get Power",
        "showStatusActivities": true,
        "showErrors": true,
        "logIOActivities": false,
        "server": "982d9453.cd0ef",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 530,
        "y": 260,
        "wires": [
            [
                "7a6463149d53365b"
            ],
            [
                "73bc0677209b8f69"
            ]
        ]
    },
    {
        "id": "73bc0677209b8f69",
        "type": "function",
        "z": "95b1a3ab.e15c1",
        "name": "/100",
        "func": "value= msg.payload.data[0]/100;\nif (value < 0.01) {\n    value= 0\n}\nmsg.payload = value;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 770,
        "y": 260,
        "wires": [
            [
                "8f92714ace25797e",
                "9a46b7cad05cae9f"
            ]
        ]
    },
    {
        "id": "8f92714ace25797e",
        "type": "ha-entity",
        "z": "95b1a3ab.e15c1",
        "name": "ModPow1 Watts",
        "server": "69eb452d.8a610c",
        "version": 1,
        "debugenabled": false,
        "outputs": 1,
        "entityType": "sensor",
        "config": [
            {
                "property": "name",
                "value": "Pow1 Watts"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": "kW"
            }
        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": false,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "allow",
        "outputOnStateChange": false,
        "outputPayload": "$entity().state ? \"on\": \"off\"",
        "outputPayloadType": "jsonata",
        "x": 1020,
        "y": 260,
        "wires": [
            []
        ]
    },
    {
        "id": "5c5306075d976b32",
        "type": "function",
        "z": "95b1a3ab.e15c1",
        "name": "0x0130 Frequenz",
        "func": "msg.payload = {\n    'fc': 3,\n    'unitid': 1,\n    'address': 0x0130,\n    'quantity': 1\n    };\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 350,
        "y": 340,
        "wires": [
            [
                "81cadcab10457ee4"
            ]
        ]
    },
    {
        "id": "81cadcab10457ee4",
        "type": "modbus-flex-getter",
        "z": "95b1a3ab.e15c1",
        "name": "Get Frequenz",
        "showStatusActivities": true,
        "showErrors": true,
        "logIOActivities": false,
        "server": "982d9453.cd0ef",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 540,
        "y": 340,
        "wires": [
            [
                "7a6463149d53365b"
            ],
            [
                "66bd3e30ef5d9ee2"
            ]
        ]
    },
    {
        "id": "66bd3e30ef5d9ee2",
        "type": "function",
        "z": "95b1a3ab.e15c1",
        "name": "/100",
        "func": "value= msg.payload.data[0]/100;\nif (value < 0.01) {\n    value= 0\n}\nmsg.payload = value;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 770,
        "y": 340,
        "wires": [
            [
                "5b169d880863318b",
                "9a46b7cad05cae9f"
            ]
        ]
    },
    {
        "id": "5b169d880863318b",
        "type": "ha-entity",
        "z": "95b1a3ab.e15c1",
        "name": "ModPow1 Herz",
        "server": "69eb452d.8a610c",
        "version": 1,
        "debugenabled": false,
        "outputs": 1,
        "entityType": "sensor",
        "config": [
            {
                "property": "name",
                "value": "Pow1 Herz"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": "Hz"
            }
        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": false,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "allow",
        "outputOnStateChange": false,
        "outputPayload": "$entity().state ? \"on\": \"off\"",
        "outputPayloadType": "jsonata",
        "x": 1020,
        "y": 340,
        "wires": [
            []
        ]
    },
    {
        "id": "9a46b7cad05cae9f",
        "type": "debug",
        "z": "95b1a3ab.e15c1",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1010,
        "y": 80,
        "wires": []
    },
    {
        "id": "27b4acb1fcc55a39",
        "type": "function",
        "z": "95b1a3ab.e15c1",
        "name": "0x0158 cosP",
        "func": "msg.payload = {\n    'fc': 3,\n    'unitid': 1,\n    'address': 0x0158,\n    'quantity': 1\n    };\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 330,
        "y": 400,
        "wires": [
            [
                "9fbd417be7d48360"
            ]
        ]
    },
    {
        "id": "9fbd417be7d48360",
        "type": "modbus-flex-getter",
        "z": "95b1a3ab.e15c1",
        "name": "Get Factor",
        "showStatusActivities": true,
        "showErrors": true,
        "logIOActivities": false,
        "server": "982d9453.cd0ef",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 530,
        "y": 400,
        "wires": [
            [
                "7a6463149d53365b"
            ],
            [
                "e1ffdc440d4da86b"
            ]
        ]
    },
    {
        "id": "e1ffdc440d4da86b",
        "type": "function",
        "z": "95b1a3ab.e15c1",
        "name": "/100",
        "func": "value= msg.payload.data[0]/100;\nif (value < 0.01) {\n    value= 0\n}\nmsg.payload = value;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 770,
        "y": 400,
        "wires": [
            [
                "7f4c3d35b4a57a00",
                "9a46b7cad05cae9f"
            ]
        ]
    },
    {
        "id": "7f4c3d35b4a57a00",
        "type": "ha-entity",
        "z": "95b1a3ab.e15c1",
        "name": "ModPow1 cosP",
        "server": "69eb452d.8a610c",
        "version": 1,
        "debugenabled": false,
        "outputs": 1,
        "entityType": "sensor",
        "config": [
            {
                "property": "name",
                "value": "Pow1 cosP"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": "times"
            }
        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": false,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "allow",
        "outputOnStateChange": false,
        "outputPayload": "$entity().state ? \"on\": \"off\"",
        "outputPayloadType": "jsonata",
        "x": 1020,
        "y": 400,
        "wires": [
            []
        ]
    },
    {
        "id": "f277332469bb2138",
        "type": "function",
        "z": "95b1a3ab.e15c1",
        "name": "0x0148 Power R",
        "func": "msg.payload = {\n    'fc': 3,\n    'unitid': 1,\n    'address': 0x0148,\n    'quantity': 1\n    };\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 340,
        "y": 480,
        "wires": [
            [
                "ac610ddc5d3448f3"
            ]
        ]
    },
    {
        "id": "ac610ddc5d3448f3",
        "type": "modbus-flex-getter",
        "z": "95b1a3ab.e15c1",
        "name": "Get P Reactive",
        "showStatusActivities": true,
        "showErrors": true,
        "logIOActivities": false,
        "server": "982d9453.cd0ef",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 540,
        "y": 480,
        "wires": [
            [
                "7a6463149d53365b"
            ],
            [
                "7110cf5c61470290"
            ]
        ]
    },
    {
        "id": "7110cf5c61470290",
        "type": "function",
        "z": "95b1a3ab.e15c1",
        "name": "/100",
        "func": "value= msg.payload.data[0]/100;\nif (value < 0.01) {\n    value= 0\n}\nmsg.payload = value;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 770,
        "y": 480,
        "wires": [
            [
                "885d0889e8282f13",
                "9a46b7cad05cae9f"
            ]
        ]
    },
    {
        "id": "885d0889e8282f13",
        "type": "ha-entity",
        "z": "95b1a3ab.e15c1",
        "name": "ModPow1 Watts R",
        "server": "69eb452d.8a610c",
        "version": 1,
        "debugenabled": false,
        "outputs": 1,
        "entityType": "sensor",
        "config": [
            {
                "property": "name",
                "value": "Pow1 Watts Reactive"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": "kW"
            }
        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": false,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "allow",
        "outputOnStateChange": false,
        "outputPayload": "$entity().state ? \"on\": \"off\"",
        "outputPayloadType": "jsonata",
        "x": 1030,
        "y": 480,
        "wires": [
            []
        ]
    },
    {
        "id": "7ef7af96fc8e69de",
        "type": "function",
        "z": "95b1a3ab.e15c1",
        "name": "0x0150 Power A",
        "func": "msg.payload = {\n    'fc': 3,\n    'unitid': 1,\n    'address': 0x0150,\n    'quantity': 1\n    };\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 340,
        "y": 540,
        "wires": [
            [
                "c37f263d6a280bc8"
            ]
        ]
    },
    {
        "id": "c37f263d6a280bc8",
        "type": "modbus-flex-getter",
        "z": "95b1a3ab.e15c1",
        "name": "Get P Apperent",
        "showStatusActivities": true,
        "showErrors": true,
        "logIOActivities": false,
        "server": "982d9453.cd0ef",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 540,
        "y": 540,
        "wires": [
            [
                "7a6463149d53365b"
            ],
            [
                "c3422b9703aa8c35"
            ]
        ]
    },
    {
        "id": "c3422b9703aa8c35",
        "type": "function",
        "z": "95b1a3ab.e15c1",
        "name": "/100",
        "func": "value= msg.payload.data[0]/100;\nif (value < 0.01) {\n    value= 0\n}\nmsg.payload = value;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 770,
        "y": 540,
        "wires": [
            [
                "442abcab93282ffa",
                "9a46b7cad05cae9f"
            ]
        ]
    },
    {
        "id": "442abcab93282ffa",
        "type": "ha-entity",
        "z": "95b1a3ab.e15c1",
        "name": "ModPow1 Watts A",
        "server": "69eb452d.8a610c",
        "version": 1,
        "debugenabled": false,
        "outputs": 1,
        "entityType": "sensor",
        "config": [
            {
                "property": "name",
                "value": "Pow1 Watts Apperent"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": "kW"
            }
        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": false,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "allow",
        "outputOnStateChange": false,
        "outputPayload": "$entity().state ? \"on\": \"off\"",
        "outputPayloadType": "jsonata",
        "x": 1030,
        "y": 540,
        "wires": [
            []
        ]
    },
    {
        "id": "9679467918ae3783",
        "type": "function",
        "z": "95b1a3ab.e15c1",
        "name": "0xA000 P total",
        "func": "msg.payload = {\n    'fc': 3,\n    'unitid': 1,\n    'address': 0xA000,\n    'quantity': 2,\n    };\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 340,
        "y": 620,
        "wires": [
            [
                "6fc00fd7e7ca5db6"
            ]
        ]
    },
    {
        "id": "6fc00fd7e7ca5db6",
        "type": "modbus-flex-getter",
        "z": "95b1a3ab.e15c1",
        "name": "Get P total",
        "showStatusActivities": true,
        "showErrors": true,
        "logIOActivities": false,
        "server": "982d9453.cd0ef",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 530,
        "y": 620,
        "wires": [
            [
                "7a6463149d53365b"
            ],
            [
                "12c4a0be3f713342"
            ]
        ]
    },
    {
        "id": "12c4a0be3f713342",
        "type": "function",
        "z": "95b1a3ab.e15c1",
        "name": "dword",
        "func": "\nvalue= (msg.payload.data[0] << 16) + msg.payload.data[1];\n\nif (value < 0.01) {\n    value= 0\n}\nmsg.payload = value;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 770,
        "y": 620,
        "wires": [
            [
                "8516c292d09d5657",
                "9a46b7cad05cae9f"
            ]
        ]
    },
    {
        "id": "8516c292d09d5657",
        "type": "ha-entity",
        "z": "95b1a3ab.e15c1",
        "name": "ModPow1 total KWh",
        "server": "69eb452d.8a610c",
        "version": 1,
        "debugenabled": false,
        "outputs": 1,
        "entityType": "sensor",
        "config": [
            {
                "property": "name",
                "value": "Pow1 Watts total"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": "kWh"
            }
        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": false,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "allow",
        "outputOnStateChange": false,
        "outputPayload": "$entity().state ? \"on\": \"off\"",
        "outputPayloadType": "jsonata",
        "x": 1040,
        "y": 620,
        "wires": [
            []
        ]
    },
    {
        "id": "1a96548c0546f20a",
        "type": "function",
        "z": "95b1a3ab.e15c1",
        "name": "0xA030 P -1m",
        "func": "msg.payload = {\n    'fc': 3,\n    'unitid': 1,\n    'address': 0xA030,\n    'quantity': 2\n    };\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 340,
        "y": 680,
        "wires": [
            [
                "aba5fface027604a"
            ]
        ]
    },
    {
        "id": "aba5fface027604a",
        "type": "modbus-flex-getter",
        "z": "95b1a3ab.e15c1",
        "name": "Get P last month",
        "showStatusActivities": true,
        "showErrors": true,
        "logIOActivities": false,
        "server": "982d9453.cd0ef",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 550,
        "y": 680,
        "wires": [
            [
                "7a6463149d53365b"
            ],
            [
                "389eaf850223a381"
            ]
        ]
    },
    {
        "id": "389eaf850223a381",
        "type": "function",
        "z": "95b1a3ab.e15c1",
        "name": "dword",
        "func": "\nvalue= (msg.payload.data[0] << 16) + msg.payload.data[1];\n\nif (value < 0.01) {\n    value= 0\n}\nmsg.payload = value;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 770,
        "y": 680,
        "wires": [
            [
                "0ca8d6cfc81072c1",
                "9a46b7cad05cae9f"
            ]
        ]
    },
    {
        "id": "0ca8d6cfc81072c1",
        "type": "ha-entity",
        "z": "95b1a3ab.e15c1",
        "name": "ModPow1 last month kWh",
        "server": "69eb452d.8a610c",
        "version": 1,
        "debugenabled": false,
        "outputs": 1,
        "entityType": "sensor",
        "config": [
            {
                "property": "name",
                "value": "Pow1 Watts last month"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": "kWh"
            }
        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": false,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "allow",
        "outputOnStateChange": false,
        "outputPayload": "$entity().state ? \"on\": \"off\"",
        "outputPayloadType": "jsonata",
        "x": 1050,
        "y": 680,
        "wires": [
            []
        ]
    },
    {
        "id": "7a6463149d53365b",
        "type": "debug",
        "z": "95b1a3ab.e15c1",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 770,
        "y": 80,
        "wires": []
    },
    {
        "id": "46ea014148b6fc68",
        "type": "inject",
        "z": "95b1a3ab.e15c1",
        "name": "11sec int",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "11",
        "crontab": "",
        "once": true,
        "onceDelay": "15",
        "topic": "",
        "payloadType": "date",
        "x": 130,
        "y": 60,
        "wires": [
            [
                "a79fb589bd77dafd",
                "53ad96eee82c4d59",
                "6c04d6080a763d91",
                "9679467918ae3783",
                "1a96548c0546f20a"
            ]
        ]
    },
    {
        "id": "982d9453.cd0ef",
        "type": "modbus-client",
        "name": "ORNO 514",
        "clienttype": "tcp",
        "bufferCommands": true,
        "stateLogEnabled": true,
        "queueLogEnabled": true,
        "tcpHost": "10.0.0.68",
        "tcpPort": "502",
        "tcpType": "DEFAULT",
        "serialPort": "/dev/ttyUSB",
        "serialType": "RTU-BUFFERD",
        "serialBaudrate": "9600",
        "serialDatabits": "8",
        "serialStopbits": "1",
        "serialParity": "none",
        "serialConnectionDelay": "100",
        "unit_id": 1,
        "commandDelay": 1,
        "clientTimeout": 1000,
        "reconnectOnTimeout": true,
        "reconnectTimeout": 2000,
        "parallelUnitIdsAllowed": true
    },
    {
        "id": "69eb452d.8a610c",
        "type": "server",
        "name": "Home Assistant",
        "version": 1,
        "addon": true,
        "rejectUnauthorizedCerts": true,
        "ha_boolean": "y|yes|true|on|home|open",
        "connectionDelay": true,
        "cacheJson": true
    }
]
1 Like

I’m using the OR-WE-517 3-phase energy meter. The meter has an internal clock which can be set and read by using the register “0x003C”. At least that’s what I’ve thought after reading the register list.
Has anybody managed to read or to set the time using Modbus on this meter? I’m struggling with this register only.
Thank you guys!