Hello Dan, If you talk about my code, answer is NO ! :-) just kidding ! my code is just a modificaton of Bill code which is a modifcation of the fileparser which is free sofware
from my side, feel free to use ! if you see some improvements that can be done, let me know ! Best regards, Le jeudi 16 mars 2017 14:21:01 UTC+1, Dan Verbus a écrit : > > Would you mind if I used your code as a basis for a weewx service that > will augment loop packets from an existing weather station with information > from an MQTT queue? I'm working on that now and would be happy to share > when I'm done. > > Thanks, > > Dan > > > On Wednesday, March 15, 2017 at 6:19:03 PM UTC-4, Wysiwyg wrote: >> >> That's great! Thanks for the information! >> >> So I don't see much more to say, any opinions about the code? I'm a noob >> in python and may have missed some important stuff. >> >> >> So far I was considering to clear the "receive buffer" right after data >> = self.receive_buffer >> Then if a mqtt message arrives during the processing of loop packet, it >> will be processed on next loop. >> >> Also I think poll interval does not mean so much now, it should be >> smaller than the quicker sensor to avoid missing some data. And at the end, >> loop packet rate will more or less follows the quickest sensor. >> >> Best regards, >> >> >> Le 12 mars 2017 11:49 AM, "Wysiwyg" <[email protected]> a écrit : >> >>> Hi, >>> >>> I have a question: >>> >>> If I use a mqtt topic that does not exist in label_map, it will anyway >>> put it in the LOOP packet. >>> >>> For example, I tried to publish a mqtt "weewx/baro" with 1015 inside >>> I get it in the LOOP like this: >>> >>> LOOP: 2017-03-12 11:41:15 CET (1489315275) altimeter: None, appTemp: >>> None, baro: 1015.0, barometer: None, cloudbase: None, dateTime: >>> 1489315275, dewpoint: None, heatindex: None, humidex: None, inDewpoint: >>> None, maxSolarRad: None, pressure: None, rainRate: 0, usUnits: 1, >>> windchill: None >>> >>> >>> This has no meaning and I guess it would be better to filter. >>> also it may happens that some mqtt topics may be not for weewx but for >>> other personnal use. >>> >>> I would like to check if a key is existing in weewx schema before put it >>> in the packet, but no clue how to do that. >>> >>> I mean, as far as I understood, it's easy to check if a key exist in >>> dictionnary : >>> >>> if 'key1' in dict.keys(): >>> >>> >>> But what's the name of the weewx expected dictionnary? (I assume it may >>> exist a dictionnary matching the database schema? >>> >>> Best regards, >>> >>> >>> >>> >>>
