-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simultaneously support different MQTT payload formats (regular, as well as JSON) #224
Comments
As of release 2.1, there is a construct.
For more information see, https://github.com/bellrichm/WeeWX-MQTTSubscribe/wiki/Common-Options#the-message-sections |
Thanks a lot. A couple of questions: a) Is "individual" supported as a type, or only "keyword", "topic" and "json"? b) The examples here imply a different hierarchy than what is in your reply. With only 3 square brackets for message, then a list of topics for that type. Like this:
Can you please clarify? |
I got the json topics working, because it is obvious what their fields are. Like this:
All the above works as intended, with data flowing through from the weather station through MQTT to Weewx. But for the other MQTT format (type = individual), I can't figure out what the field name should be? I have it currently like this, with no field name, because individual does not have a field name like json.
And no data comes through for the inTemp. How should I proceed with this? |
Yeah, |
Oh I think I see it. Try this. It might work. I might have to do some experimenting.
|
That worked! Thank you so much. It is best if the the above config snippets go into the Wiki. |
Good to hear. |
Another suggestion: In the documentation, mention that this global configuration part is no longer recommended (i.e. will still work, but should be replaced by the topic message syntax):
Then in all the examples, add the following syntax for each topic.
Or
That should work for all the new configurations, while those who use the older global type syntax will be unaffected. |
In the reference documentation, https://github.com/bellrichm/WeeWX-MQTTSubscribe/wiki/Common-Options, there is no mention of |
I have been using MQTTSubscribe for a few years, so many thanks for a valuable component that enables Weewx to work with any weather sensor.
There is a limitation that the message type must apply to all sensors, like so:
That worked well when my outdoor and indoor sensors were both JSON.
My outdoor station is Acurite, and it feeds JSON data Home Assistant.
My indoor sensor was a custom one based on a BME280 connected to an ES32.
Then, I replaced the indoor sensor with an AirThings Wave Plus and its MQTT format is like this:
Now it is impossible to feed indoor data to MQTTSubscribe, because the message type is defined globally, and applies to all topics/sensors.
Is it possible to define the message type per topic, or per sensor?
The text was updated successfully, but these errors were encountered: