Hello, On Thursday, May 14, 2020 at 8:56:39 AM UTC-4, mwall wrote: > > > > On Wednesday, May 13, 2020 at 11:13:49 PM UTC-4, Ryan Stasel wrote: >> >> And thinking I should just look at making a driver that will query my >> Meteobridge Nano for data. I know this is possible via it's cgi-bin >> directory (I already have a Hubitat app doing this). >> >> Something like: http://ip-of-meteobridge/cgi-bin/livedataxml.cgi >> <http://www.google.com/url?q=http%3A%2F%2Fip-of-meteobridge%2Fcgi-bin%2Flivedataxml.cgi&sa=D&sntz=1&usg=AFQjCNEVQ8WKWtZz8zrjxnJqauVbkt6YBA> >> >> Anyone have an example driver they could point me to that might be a >> decent start? >> > > the rainwise ip100 driver uses http queries to get data: > > https://github.com/matthewwall/weewx-ip100 >
I used this driver as the basis as a driver for the Columbia MicroServer and it worked out very well. Thanks Matthew! The only thing is this version is for WeeWX 3.x and Python 2. Not aware if anyone has ported it yet to WeeWX 4 and Python 3. In the process of implementing the Columbia driver, I ported it to WeeWX 4 and Python 3 but tried to keep it backwards compatible with WeeWX 3.9 and Python 2. You can find the Columbia driver at: https://github.com/bburton/weewx-columbia-ms (select the tag for v0.1.0) The following should be noted: - A value for "rain" is not returned as the hardware does not return a delta value, only totals and rainRate. The IP-100 driver returns rain value directly from the hardware. Many or most drivers need to calculate a delta value for rain[1]. - Exception handling is improved over the IP-100 driver. The Columbia hardware would sometimes return truncated XML so the driver detects that and if parsing still fails, will propagate the exeption correctly. - There are some porting loose ends in for the main() function since I don't fully understand the logging. [1] Many drivers have to calculate the rain delta themselves to correctly return the value for "rain". A common way to do that is with this helper method like the following: def __init__(...): ... self.last_rain_total = None ... def _calculate_rain_delta(self, packet): """Convert from rain total to rain delta.""" packet['rain'] = weewx.wxformulas.calculate_rain(packet['rainTotal' ], self.last_rain_total) self.last_rain_total = packet['rainTotal'] The above assumes that packet['rainTotal'] is some cumulative rain total whether for a day, week or month, etc. returned by the hardware. When called in the genLoopPacket() method before the yield, the method will return the rain delta in packet['rain']. The next version of the Columbia MicroServer driver uses the above method to calculate rain but is not on github.com yet. If you search for "calculate_rain" in the bin/weewx/drivers folder, you can find many drivers that use the same helper method. Hope this helps, -Bill -- You received this message because you are subscribed to the Google Groups "weewx-development" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/fe7bf65d-d52e-45ba-ba00-d76bca49b9d9%40googlegroups.com.
