P1 Gas data not stored in Managed Counter

Moderator: leecollings

Post Reply
User avatar
JustDude
Posts: 16
Joined: Thursday 23 February 2023 18:15
Target OS: Linux
Domoticz version: Latest
Location: NL
Contact:

P1 Gas data not stored in Managed Counter

Post by JustDude »

This is the flow to add P1 data from Node-red to Domoticz
Image

However the Managed Counter (tyoe Gas for this try out) is not updated in Domoticz
What am I doing wrong?

Warning: Newbie on Node-Red and Domoticz :!:
Attachments
Screenshot 2023-03-01 at 21-54-35 Node-RED 192.168.2.7.png
Screenshot 2023-03-01 at 21-54-35 Node-RED 192.168.2.7.png (36.14 KiB) Viewed 1928 times
---
Measuring is knowing
User avatar
FireWizard
Posts: 1763
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: P1 Gas data not stored in Managed Counter

Post by FireWizard »

Hi @JustDude,

1. Can you publish your flow?

2. Can you connect a Debug node to the MQTT input node, called Read dsmr Gas?
Please publish the results of that Debug node.

Regards
User avatar
JustDude
Posts: 16
Joined: Thursday 23 February 2023 18:15
Target OS: Linux
Domoticz version: Latest
Location: NL
Contact:

Re: P1 Gas data not stored in Managed Counter

Post by JustDude »

Thanks for taking the time to looking onto this:

Code: Select all

[
    {
        "id": "76a5d1b7.ed381",
        "type": "tab",
        "label": "P1monitor Data Import",
        "disabled": false,
        "info": ""
    },
    {
        "id": "8df1efad74bf4ddc",
        "type": "mqtt out",
        "z": "76a5d1b7.ed381",
        "name": "Send MQTT to Domonticz",
        "topic": "domoticz/In",
        "qos": "2",
        "retain": "true",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "f9f13036.e28b58",
        "x": 790,
        "y": 220,
        "wires": []
    },
    {
        "id": "910303dcec5d5d55",
        "type": "function",
        "z": "76a5d1b7.ed381",
        "name": "Store IDX Power",
        "func": "//if mpayload.P1_consumed \nmsg.payload = { \"command\": \"udevice\", \"idx\": 129, \"usage\": msg.payload.P1_consumed + \";0\", \"return\": msg.payload.P1_generated + \";0\" }\nreturn msg;\n\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 570,
        "y": 260,
        "wires": [
            []
        ]
    },
    {
        "id": "0f45f1515688ccc7",
        "type": "mqtt in",
        "z": "76a5d1b7.ed381",
        "name": "Read dsmr EL",
        "topic": "test_dsmr/el",
        "qos": "2",
        "datatype": "auto-detect",
        "broker": "f9f13036.e28b58",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 110,
        "y": 80,
        "wires": [
            []
        ]
    },
    {
        "id": "04cfacc53718b421",
        "type": "comment",
        "z": "76a5d1b7.ed381",
        "name": "Test DSMR for now",
        "info": "",
        "x": 110,
        "y": 220,
        "wires": []
    },
    {
        "id": "4efba523b05ff7c6",
        "type": "switch",
        "z": "76a5d1b7.ed381",
        "name": "Filter",
        "property": "topic",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "gas_consumed",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "P1_consumed",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "P1_generated",
                "vt": "str"
            }
        ],
        "checkall": "false",
        "repair": true,
        "outputs": 3,
        "x": 390,
        "y": 260,
        "wires": [
            [
                "88737b2f75bb95ed"
            ],
            [
                "910303dcec5d5d55"
            ],
            []
        ]
    },
    {
        "id": "a5f675ed14c7b626",
        "type": "split",
        "z": "76a5d1b7.ed381",
        "name": "",
        "splt": "\\n",
        "spltType": "str",
        "arraySplt": 1,
        "arraySpltType": "len",
        "stream": false,
        "addname": "topic",
        "x": 270,
        "y": 260,
        "wires": [
            [
                "4efba523b05ff7c6"
            ]
        ]
    },
    {
        "id": "b34696bab8933e0b",
        "type": "mqtt in",
        "z": "76a5d1b7.ed381",
        "name": "Read dsmr Gas",
        "topic": "test_dsmr/gas",
        "qos": "2",
        "datatype": "auto-detect",
        "broker": "f9f13036.e28b58",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 120,
        "y": 260,
        "wires": [
            [
                "a5f675ed14c7b626",
                "5ee7cd5893fdc546"
            ]
        ]
    },
    {
        "id": "88737b2f75bb95ed",
        "type": "function",
        "z": "76a5d1b7.ed381",
        "name": "Store IDX Gas",
        "func": "//if (msg.topic == \"p1monitor/smartmeter/consumption_gas_m3\") {\n//    msg.payload = { \"idx\": 10, \"svalue\": msg.payload.toString() };\n//    return msg;\n//}\n\n// {\"command\":\"udevice\", \"idx\":1234, \"svalue\":\"3.45\", \"parse\": false}\nmsg.payload = { \"command\": \"udevice\", \"idx\": 135, \"svalue\": msg.payload, \"parse\": false};\nreturn msg;\n\n\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 560,
        "y": 200,
        "wires": [
            [
                "8316c64589c8cfa5",
                "8df1efad74bf4ddc"
            ]
        ]
    },
    {
        "id": "8316c64589c8cfa5",
        "type": "debug",
        "z": "76a5d1b7.ed381",
        "name": "debug 2",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 740,
        "y": 140,
        "wires": []
    },
    {
        "id": "5ee7cd5893fdc546",
        "type": "debug",
        "z": "76a5d1b7.ed381",
        "name": "debug 3",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 300,
        "y": 160,
        "wires": []
    },
    {
        "id": "f9f13036.e28b58",
        "type": "mqtt-broker",
        "name": "Domoticz 192.168.2.7",
        "broker": "192.168.2.7",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "5",
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthRetain": "false",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    }
]
Screenshot 2023-03-02 at 16-50-25 MK.png
Screenshot 2023-03-02 at 16-50-25 MK.png (31.85 KiB) Viewed 1904 times
Screenshot 2023-03-02 at 16-54-25 Node-RED 192.168.2.7.png
Screenshot 2023-03-02 at 16-54-25 Node-RED 192.168.2.7.png (26.13 KiB) Viewed 1904 times
---
Measuring is knowing
User avatar
FireWizard
Posts: 1763
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: P1 Gas data not stored in Managed Counter

Post by FireWizard »

Hi @JustDude,

I checked your flow and discovered a few things.

1. I believe the data from the dsmr reader is not complete, unless you receive the Electricity data and Gas data in different topics.
It looks that, that is the case as the topic from the MQTT node is test_dsmr/gas.

2. I do not understand the functionality of the "Split" node. So this one I have removed from the flow.

3 The "Switch" node filters on topic. So, as the topic is "test_dsmr/gas", I filter on contains "test_dsmr/gas".
No reason to filter on "gas_consumed" as this is not part of the topic but it is part of the payload.

4.You are interested is the value of "gas_consumed" (and not in the "serial" or "timestamp")

5.Your msg.payload from the "Function" node has to be changed a little.

It will become:

Code: Select all

msg.payload = { "command": "udevice", "idx": 135, "svalue": msg.payload.gas_consumed.toString(), "parse": false};
return msg;
You will send an object to the MQTT output node (See between {})
- "command": "udevice". This is the default and may be omitted.
- "idx": 135. That is ok and should be a number. It is.
- "svalue" represent always a String, so the value should be a String.
If you hoover with your mouse over the text "gas_consumed" in "Debug 3", you will see at the right some extra buttons.
The first one represents the path of gas_consumed, the second one the value and the third (last) pins the selected element.
See: https://nodered.org/docs/user-guide/messages

In this case the value of "svalue" has to be: msg.payload.gas_consumed instead of only msg.payload.
As it should be a String and the value of gas_consumed is a number (blue) we have to add the toString() function.

"parse": false is optional

See the flow below. Test it and let me know.

Screenshot_DSMR1.png
Screenshot_DSMR1.png (54.01 KiB) Viewed 1895 times

Code: Select all

[
    {
        "id": "8df1efad74bf4ddc",
        "type": "mqtt out",
        "z": "76a5d1b7.ed381",
        "name": "Send MQTT to Domonticz",
        "topic": "domoticz/In",
        "qos": "2",
        "retain": "true",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "f9f13036.e28b58",
        "x": 1240,
        "y": 160,
        "wires": []
    },
    {
        "id": "910303dcec5d5d55",
        "type": "function",
        "z": "76a5d1b7.ed381",
        "name": "Store IDX Power",
        "func": "//if mpayload.P1_consumed \nmsg.payload = { \"command\": \"udevice\", \"idx\": 129, \"usage\": msg.payload.P1_consumed + \";0\", \"return\": msg.payload.P1_generated + \";0\" }\nreturn msg;\n\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1150,
        "y": 240,
        "wires": [
            []
        ]
    },
    {
        "id": "04cfacc53718b421",
        "type": "comment",
        "z": "76a5d1b7.ed381",
        "name": "Test DSMR for now",
        "info": "",
        "x": 530,
        "y": 100,
        "wires": []
    },
    {
        "id": "4efba523b05ff7c6",
        "type": "switch",
        "z": "76a5d1b7.ed381",
        "name": "Filter",
        "property": "topic",
        "propertyType": "msg",
        "rules": [
            {
                "t": "cont",
                "v": "test_dsmr/gas",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "P1_consumed",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "P1_generated",
                "vt": "str"
            }
        ],
        "checkall": "false",
        "repair": true,
        "outputs": 3,
        "x": 730,
        "y": 180,
        "wires": [
            [
                "88737b2f75bb95ed"
            ],
            [
                "910303dcec5d5d55"
            ],
            []
        ]
    },
    {
        "id": "b34696bab8933e0b",
        "type": "mqtt in",
        "z": "76a5d1b7.ed381",
        "d": true,
        "name": "Read dsmr Gas",
        "topic": "test_dsmr/gas",
        "qos": "2",
        "datatype": "auto-detect",
        "broker": "f9f13036.e28b58",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 540,
        "y": 140,
        "wires": [
            [
                "5ee7cd5893fdc546"
            ]
        ]
    },
    {
        "id": "88737b2f75bb95ed",
        "type": "function",
        "z": "76a5d1b7.ed381",
        "name": "Store IDX Gas",
        "func": "//if (msg.topic == \"p1monitor/smartmeter/consumption_gas_m3\") {\n//    msg.payload = { \"idx\": 10, \"svalue\": msg.payload.toString() };\n//    return msg;\n//}\n\n// {\"command\":\"udevice\", \"idx\":1234, \"svalue\":\"3.45\", \"parse\": false}\nmsg.payload = { \"command\": \"udevice\", \"idx\": 135, \"svalue\": msg.payload.gas_consumed.toString(), \"parse\": false};\nreturn msg;\n\n\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 960,
        "y": 160,
        "wires": [
            [
                "8316c64589c8cfa5",
                "8df1efad74bf4ddc"
            ]
        ]
    },
    {
        "id": "8316c64589c8cfa5",
        "type": "debug",
        "z": "76a5d1b7.ed381",
        "name": "debug 2",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1180,
        "y": 120,
        "wires": []
    },
    {
        "id": "5ee7cd5893fdc546",
        "type": "debug",
        "z": "76a5d1b7.ed381",
        "name": "debug 3",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 740,
        "y": 120,
        "wires": []
    },
    {
        "id": "932850c4abfecca5",
        "type": "inject",
        "z": "76a5d1b7.ed381",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "test_dsmr/gas.",
        "payload": "{\"gas_consumed\":10142194,\"serial\":\"33313137\",\"timestamp\":1677772436}",
        "payloadType": "json",
        "x": 550,
        "y": 180,
        "wires": [
            [
                "5ee7cd5893fdc546",
                "4efba523b05ff7c6"
            ]
        ]
    },
    {
        "id": "f9f13036.e28b58",
        "type": "mqtt-broker",
        "name": "Domoticz 192.168.2.7",
        "broker": "192.168.2.7",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "5",
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthRetain": "false",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    }
]
Regards
User avatar
JustDude
Posts: 16
Joined: Thursday 23 February 2023 18:15
Target OS: Linux
Domoticz version: Latest
Location: NL
Contact:

Re: P1 Gas data not stored in Managed Counter

Post by JustDude »

See the flow below. Test it and let me know.
OK, that clarifies a lot of my mistakes.
Thanks for the elaborate explanation. Kudos

I changed the topic subscription to gas and electricity using a #
the filter on topic solves the message formatting
The MQTT explorer view:
Screenshot from 2023-03-03 07-41-20.png
Screenshot from 2023-03-03 07-41-20.png (18.04 KiB) Viewed 1890 times
I see now that the counter date / time is updated when a message comes in, but no data is stored or a graph is visible.
So one step ahead thanks to your help :D
After work I will recreate the counter and start fresh.

I let you know the results.
---
Measuring is knowing
User avatar
FireWizard
Posts: 1763
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: P1 Gas data not stored in Managed Counter

Post by FireWizard »

Hello @JustDude.

Some more hints.

If you look to the data presented in MQTT Explorer, you see that the following "sub" topics are presented under test_dsmr.
So, if you take as topic in the MQTT Input node "test_dsmr/#", you wil get:

- system
- el
- gas
- status
- sw-version

I do not think you are interested in system and sw-version. Perhaps you want to monitor the status.

After the MQTT input node you have 2 options.

Option 1.

Connect a "Function" node to the MQTT Input node and with an "If....Then" statement you can split the correct topics.

Option 2.

Connect a "Swith" node as you did before, but 2 outputs are sufficient (unlesss you want to use "Status").

See below:

Screenshot_DSMR2.png
Screenshot_DSMR2.png (24.47 KiB) Viewed 1882 times

I configured "Checking all rules", because I wanted to process both gas and el in parallel.
I switched also "recreate message sequences" off. You do not need that. It is not important which data arrives first in Domoticz, because they are independent of each other.

For electricity I can only see:

- P1_consumed
- P1_generated
- P2_consumed
- P2_generated

I assume that you want to use a P1 Smartmeter device in Domoticz.
This device needs 6 values.
Beside the 4 mentioned above, it needs also actual consumption and actual production.
See: https://piandmore.wordpress.com/2019/02 ... -domoticz/
P1 Smart meter
The P1 Smart meter sensor allows you to show you power consumption, low and high usage, low and high return, actual consumption and actual return.

{"command":"udevice", "idx":1234, "svalue":"lu;hu;lr;hr;ac;ar"}
where lu is low tariff usage (in Wh so 1000 is 1 kWh), hu is high tariff usage (in Wh), lr is low tariff return (in Wh), hr is high tariff return (in Wh), ac is actual consumption (in W) and ar is current usage (in W).
Note: current usage is wrong. Should be: actual production,

If you follow the same approach as with the Gas. you will get a very long line after "msg.payload". You can make the whole line vissible with a horizontal scrollbar, but it is easier to use 6 variables instead.

See the following example in the "Function" node:

Code: Select all

let us1 = msg.payload.P1_consumed.toString();
let us2 = msg.payload.P2_consumed.toString();
let ret1 = msg.payload.P1_generated.toString();
let ret2 = msg.payload.P2_generated.toString();
let cons = msg.payload.xxxxxxxx.toString();
let prod = msg.payload.yyyyyyyy.toString();

msg.payload = {"command": "udevice", "idx": 129, "svalue": us1 + ";" + us2 + ";" + ret1 + ";" + ret2 + ";" + cons + ";" + prod};
return msg;

You have to fill in xxxxxxxx and yyyyyyyy yourself.

So you see, you have an easier overview instead of using the full message path, such as "msg.payload.P1_consumed.toString()".

Screenshot_DSMR3.png
Screenshot_DSMR3.png (52.81 KiB) Viewed 1882 times
See the flow below:

Code: Select all

[
    {
        "id": "8df1efad74bf4ddc",
        "type": "mqtt out",
        "z": "76a5d1b7.ed381",
        "name": "Send MQTT to Domonticz",
        "topic": "domoticz/In",
        "qos": "2",
        "retain": "true",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "f9f13036.e28b58",
        "x": 1240,
        "y": 180,
        "wires": []
    },
    {
        "id": "910303dcec5d5d55",
        "type": "function",
        "z": "76a5d1b7.ed381",
        "name": "Store IDX Power",
        "func": "let us1 = msg.payload.P1_consumed.toString();\nlet us2 = msg.payload.P2_consumed.toString();\nlet ret1 = msg.payload.P1_generated.toString();\nlet ret2 = msg.payload.P2_generated.toString();\nlet cons = msg.payload.xxxxxxxx.toString();\nlet prod = msg.payload.yyyyyyyy.toString();\n\nmsg.payload = {\"command\": \"udevice\", \"idx\": 129, \"svalue\": us1 + \";\" + us2 + \";\" + ret1 + \";\" + ret2 + \";\" + cons + \";\" + prod, \"parse\": false};\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 950,
        "y": 200,
        "wires": [
            [
                "8df1efad74bf4ddc"
            ]
        ]
    },
    {
        "id": "04cfacc53718b421",
        "type": "comment",
        "z": "76a5d1b7.ed381",
        "name": "Test DSMR for now",
        "info": "",
        "x": 530,
        "y": 100,
        "wires": []
    },
    {
        "id": "4efba523b05ff7c6",
        "type": "switch",
        "z": "76a5d1b7.ed381",
        "name": "Filter",
        "property": "topic",
        "propertyType": "msg",
        "rules": [
            {
                "t": "cont",
                "v": "test_dsmr/gas",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "test_dsmr/el",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 730,
        "y": 180,
        "wires": [
            [
                "88737b2f75bb95ed"
            ],
            [
                "910303dcec5d5d55"
            ]
        ]
    },
    {
        "id": "b34696bab8933e0b",
        "type": "mqtt in",
        "z": "76a5d1b7.ed381",
        "d": true,
        "name": "Read DSMR",
        "topic": "test_dsmr/#",
        "qos": "0",
        "datatype": "auto-detect",
        "broker": "f9f13036.e28b58",
        "nl": false,
        "rap": false,
        "rh": 0,
        "inputs": 0,
        "x": 530,
        "y": 140,
        "wires": [
            [
                "5ee7cd5893fdc546"
            ]
        ]
    },
    {
        "id": "88737b2f75bb95ed",
        "type": "function",
        "z": "76a5d1b7.ed381",
        "name": "Store IDX Gas",
        "func": "msg.payload = { \"command\": \"udevice\", \"idx\": 135, \"svalue\": msg.payload.gas_consumed.toString(), \"parse\": false};\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 940,
        "y": 160,
        "wires": [
            [
                "8316c64589c8cfa5",
                "8df1efad74bf4ddc"
            ]
        ]
    },
    {
        "id": "8316c64589c8cfa5",
        "type": "debug",
        "z": "76a5d1b7.ed381",
        "name": "debug 2",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1180,
        "y": 140,
        "wires": []
    },
    {
        "id": "5ee7cd5893fdc546",
        "type": "debug",
        "z": "76a5d1b7.ed381",
        "name": "debug 3",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 740,
        "y": 120,
        "wires": []
    },
    {
        "id": "932850c4abfecca5",
        "type": "inject",
        "z": "76a5d1b7.ed381",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "test_dsmr/gas.",
        "payload": "{\"gas_consumed\":10142194,\"serial\":\"33313137\",\"timestamp\":1677772436}",
        "payloadType": "json",
        "x": 550,
        "y": 180,
        "wires": [
            [
                "5ee7cd5893fdc546",
                "4efba523b05ff7c6"
            ]
        ]
    },
    {
        "id": "f9f13036.e28b58",
        "type": "mqtt-broker",
        "name": "Domoticz 192.168.2.7",
        "broker": "192.168.2.7",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "5",
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthRetain": "false",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    }
]
Regards
User avatar
JustDude
Posts: 16
Joined: Thursday 23 February 2023 18:15
Target OS: Linux
Domoticz version: Latest
Location: NL
Contact:

Re: P1 Gas data not stored in Managed Counter

Post by JustDude »

Thanks again, that is what I just did: subscribe to the test_dsmr/# topic and filter the messages.

it seems the Managed Counter does not work as intended (my mistake or??).
The normal Gas and electricity incremental/P1 counters work, although I need to add the actual usage etc as you mentioned.
Screenshot 2023-03-03 at 16-38-19 MK.png
Screenshot 2023-03-03 at 16-38-19 MK.png (9.72 KiB) Viewed 1875 times
This is the complete Electrcity message from the python program:

Code: Select all

{"P1_consumed":677.0,"P1_generated":0.0,"P2_consumed":56.0,"P2_generated":0.0,"P3_consumed":132.0,"P3_generated":0.0,"V1":231.0,"V1_sags":5,"V1_swells":0,"V2":234.0,"V2_sags":5,"V2_swells":0,"V3":233.0,"V3_sags":4,"V3_swells":0,"el_consumed":23679674.0,"el_returned":21097674.0,"long_power_failures":12,"p_consumed":866.0,"p_generated":0.0,"power_failures":1373,"serial":"33363137","timestamp":1677857885}
As it seems the code https://github.com/hansij66/dsmr2mqtt/ can be adapted easily to publish more or less topics.
No clue if that is from a user on this forum...

P_consumed and P_generated is already a total.
Huge learning curve but I learned a lot thanks to the help and insight.
I Continue learning ;)
---
Measuring is knowing
User avatar
waltervl
Posts: 5374
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: P1 Gas data not stored in Managed Counter

Post by waltervl »

Cannot comment on your issue but are you sure you want to use the managed counter instead of the normal counter as you have to calculate the daily history yourself while normal counter does that for you every night.
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
JustDude
Posts: 16
Joined: Thursday 23 February 2023 18:15
Target OS: Linux
Domoticz version: Latest
Location: NL
Contact:

Re: P1 Gas data not stored in Managed Counter

Post by JustDude »

waltervl wrote: Friday 03 March 2023 18:30 while normal counter does that for you every night.
Ok, good to know, I was already planning to use the normal counter, still testing it.
Thanks for the tip
---
Measuring is knowing
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests