Bootstrap - MQTT Filtering

125 views
Skip to first unread message

Michael

unread,
Jul 25, 2023, 2:17:58 PM7/25/23
to weewx-user
Hi,

is it possible to filter the input of the data via MQTT within the bootstrap skin for the live weather data?
There are multiple MQTT sources being queried, some of the data is being queried under the same name (outTemp, outHumidity, etc).
I have entered the following under /home/weewx/skins/Bootstrap/skin.conf:


[JSONGenerator]
    enabled = true
    timespan = 27
    [[MQTT]]
        [[[connections]]]
            [[[[public_mqtt]]]]
                            broker_connection = ws://192.168.xx.xx:9001
                            [[[[[topics]]]]]
                                  [[[[[[weather-stat1/loop]]]]]]
                                      type = JSON
                                  [[[[[[weather-stat2/loop]]]]]]
                                      type = JSON

both stations provide partial data for the same fields via MQTT.
I would like to exclude the input for outTemp for stat1, or define data field for data field what should be processed for the bootstrap live data.

In the file: /home/weewx/skins/Bootstrap/skin.conf I found the following. Could be exactly what I am looking for. Unfortunately I can't get along with the implementation....


            #Example
            #[[[[hiveMQ_public]]]]
            #    broker_connection = ws://broker.hivemq.com:8000/mqtt # unencrypted websocket connection without credentials
            #    [[[[[topics]]]]]
            #         # topic with type plain has just the value as payload, you have to specify a payload_key to match a gauge/chart dataset
            #         [[[[[[example/sensor/temp]]]]]]
            #             type = plain
            #             payload_key = outTemp_C # matches gauge outTemp and outTemp dataset in outTemp chart
            #         [[[[[[example/sensor/humi]]]]]]
            #             type = plain
            #             payload_key = outHumidity # matches gauge outHumidity and outHumidity dataset in outHumidity chart


Is filtering of the data possible?

Michael

michael.k...@gmx.at

unread,
Jul 25, 2023, 3:12:18 PM7/25/23
to weewx-user
No, currently filtering is not possible for messages with a JSON payload, at least none that I am aware of (and I am the author of this part). You can file an issue https://github.com/brewster76/fuzzy-archer/issues and I can take this as into account as a new feature for a future version. It makes sense to implement this feature.

I never had the need for such a feature, because I do filtering and mapping on the source side and I don't want to emit data from inside the house to the public.


vince

unread,
Jul 25, 2023, 3:22:20 PM7/25/23
to weewx-user
If you use MQTTSubscribe you can ignore fields within a subscribed topic.  Look at the examples on the extension's github site and look for "ignore = true" in the example files there.
Reply all
Reply to author
Forward
0 new messages