To further my WeeWX/MQTT/Python knowledge,  I have written a WeeWX 
multi-threaded service. One thread receives the MQTT messages and puts them on 
a queue. In the other thread, when a NEW_ARCHIVE_RECORD event is received, it 
process the queue and updates the archive record with the data.
Currently, processing of the queue means - take the last element and use its 
data to update the archive record. My next big education will be to develop 
some type of accumulation of these (essentially software generation). 
Also, the MQTT payload is expected to be json. I am hoping that other formats 
can easily be supported by creating a subclass and overriding the function that 
maps the MQTT payload to a WeeWX like dictionary.
Being a proof of concept, documentation is lacking, error handling is minimal, 
limited functionality, no install support, etc.  But, I thought even in this 
form it might be useful/educational. 
If interested, it can be found here, 
https://github.com/bellrichm/weewx-addons/blob/master/user/MQTTSubscribeService.py
- Rich

-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to