This is a quickly whipped together stripped down example. It may be missing 
some things, but gives you an idea of how to include fields with limited 
config.
[MQTTPublish]
    # The MQTT server.
    # Default is localhost.
    host = localhost

    # username for broker authentication.
    # Default is None.
    username = None

    # password for broker authentication.
    # Default is None.
    password = None

    # The TLS options that are passed to tls_set method of the MQTT client.
    # For additional information see, 
https://eclipse.org/paho/clients/python/docs/strptime-format-codes
    [[tls]]
        # Turn tls on and off.
        # Default is true.
        enable = false

    [[topics]]
        [[[REPLACE_ME]]]
            # True if the field should not be published.
            # Valid values: True, False.
            # Default is  False
            ignore = true

            [[[[fields]]]]
                [[[[[REPLACE_ME -1]]]]]
                [[[[[REPLACE_ME -2]]]]]

On Tuesday, 7 July 2026 at 10:17:26 UTC-4 [email protected] wrote:

> Appreciate it thanks.  So you mean I have to include every variable in the 
> stanza and then toggle the ignore flag for each one, or can I just include 
> the values I want?  I'm posting individual archive entries and will 
> probably want the aggregate ones for day/week/month/year kind of thing.  Is 
> that possible?
>
> On Tuesday, July 7, 2026 at 9:42:34 a.m. UTC-4 John Smith wrote:
>
>> I posted a working snippet when I made a PR
>>
>>
>> https://github.com/weewx-mqtt/publish/pull/15/changes/90f1473887deef1459cd647e3aaae129a6caf5f1
>>
>> However I realised how inefficient it was trying to include or exclude 
>> things like that and have since come up with a fork that loops in the 
>> python script instead of repeating the same things lots and lots of times 
>> as seen at that link
>>
>> My fork can be found here: https://github.com/evilbunny2008/MQTTPublish
>>
>> Here's an example stanza for that extension 
>> https://github.com/evilbunny2008/MQTTPublish/blob/main/weewx-sample.conf
>>
>> However I shifted all the aggregate functionality into it's own extension 
>> so that values could be calculated once per archive interval and then all 
>> other extensions could access the values
>>
>> That extension can be found here 
>> https://github.com/evilbunny2008/AggregatedValues
>>
>> I'm half way through migrating the Inigo plugin to use the values 
>> calculated and so when the work on the Inigo plugin is complete both it and 
>> the MQTTPublish extension will do almost no DB lookups and I'm already 
>> seeing a significant reduction in the time to generate multiple reports.
>>
>> On Tue, 7 Jul 2026 at 23:13, [email protected] <[email protected]> wrote:
>>
>>> I'm having a heck of a time even finding an example of how to format the 
>>> stanza to publish topics under the [[MQTT]] section under the [StdRESTful] 
>>> section.  
>>>
>>> I have successfully installed this service and I see it load on startup:
>>> https://github.com/weewx-mqtt/publish
>>>
>>> I just wish there was a sample config to follow but that seems to be 
>>> non-existent.  I don't know where to nest things.  I'm posting individual 
>>> topics so can someone post an example that works?
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "weewx-user" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>> To view this discussion visit 
>>> https://groups.google.com/d/msgid/weewx-user/c3cc4816-4fbc-46c7-b793-33f89b48b53an%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/weewx-user/c3cc4816-4fbc-46c7-b793-33f89b48b53an%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/weewx-user/ed4cfa33-665c-4ade-b2bb-ca35d4692959n%40googlegroups.com.

Reply via email to