Skip to content

allow a mnemonic MQTT topic instead of hardcoded chn<number>#706

Open
Zugschlus wants to merge 2 commits intovolkszaehler:masterfrom
Zugschlus:zg/mqtttopic
Open

allow a mnemonic MQTT topic instead of hardcoded chn<number>#706
Zugschlus wants to merge 2 commits intovolkszaehler:masterfrom
Zugschlus:zg/mqtttopic

Conversation

@Zugschlus
Copy link
Copy Markdown
Contributor

This backwards-compatible change allows one to set the mqtt topic from the channel configuration. Currently, the meter values are published via an mqtt topic that is set to the channel number, which changes whenever a new channel is defined or and old deleted. And it's totally not mnemonic.

Configuration example:

   "meters": [
        { 
            // bidirectional Power Meter external
            "enabled": true,
            "skip": false,
            "protocol": "sml",
            "device": "/dev/USBserialNetz",
            "baudrate": 9600, 
            "parity": "8n1", 
            "read_timeout": 60, 
            "aggtime": 60,
            "aggmode": "max",
            "aggfixedinterval": true,
            "use_local_time": true,
            "channels" : [
                { 
                    "api": "null", 
                    "uuid": "snip", 
                    "mqtt_topic": "1-0:1.8.0_Bezug",
                    "identifier": "1-0:1.8.0" 
                },
                { 
                    "api": "null", 
                    "uuid": "snip", 
                    "mqtt_topic": "1-0:2.8.0_Einspeisung",
                    "identifier": "1-0:2.8.0" 
                }
            ] 
        },

This addresses issue #420 from 2020.

This makes it easier to build the source package only, for example for a
binary build inside sbuild. Build-Depends: must always be satisfied,
Build-Depends-Arch: only when the architecture dependent binary packages
are built. So, one just needs debhelper-compat 12, pkgconf, and cmake to
build the source package. All the library dev packages are only needed
to build the actual binary package.

There is also Build-Depends-Indep: for architecture independent
packages, but that doesn't apply to vzlogger
@r00t-
Copy link
Copy Markdown
Contributor

r00t- commented Apr 24, 2026

thanks, will have a look

@r00t-
Copy link
Copy Markdown
Contributor

r00t- commented Apr 24, 2026

            "channels" : [ { 
                    "api": "null", 

this is #550 :\

@Zugschlus
Copy link
Copy Markdown
Contributor Author

            "channels" : [ { 
                    "api": "null", 

this is #550 :\

Yes, I agree. This was just annoying enough for me to do this quick fix instead of refactoring the whole thing.

Comment thread include/Channel.hpp Outdated
This backwards-compatible change allows one to set the mqtt topic from
the channel configurtation. Currently, the meter values are published
via an mqtt topic that is set to the channel number, which changes
whenever a new channel is defined or and old deleted. And it's totally
not mnemonic.

This addresses issue volkszaehler#420 from 2020.
@r00t-
Copy link
Copy Markdown
Contributor

r00t- commented Apr 25, 2026

your new push contains the commit from #705
but doesn't matter as long as you/we merge that one first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants