matthewwall / weewx-netatmo

weewx driver for netatmo weather station
GNU General Public License v3.0
7 stars 16 forks source link

Updates to Netatmo driver #2

Closed scottgrey closed 8 years ago

scottgrey commented 8 years ago

I had to make some updates to the driver to give me more accurate results in weewx as well as when it was uploading to pwsweather and wunderground. A few problems I had to fix:

  1. Calculate rain changes like other drivers where it creates the 'rain' field in the packet based on the old total and the new total.
  2. Change confeditor_loader to not take a parameter since this wasn't working for me.
  3. Added in the battery status for the outdoor module and the rain gauge. I don't have a wind gauge yet, so I didn't fool around with that part at all.
  4. Changed the timing of the loops from 600 seconds to 300 seconds to more closely mimic how often the data is updated at netatmo.
  5. Fixed an issue where if it received a 502 from netatmo, it would essentially just die. I haven't had a chance to make sure this is actually working in practice, but I think in the try except in collect_data it would issue one 502 error and then never continue to try again. So I added the actual time.sleep and then a continue and I think this should allow it to retry. This is the only part I'm not 100% comfortable with yet.

Take a look and let me know what you think or if you think I need to change anything with this.

matthewwall commented 8 years ago

scott, could you re-do the pull request against the latest master, but only if your changes are actually necessary?

i incorporated some of your changes. the most notable exception is the handling of rain. i think the firmware in my netatmo does not report the sum_rain_24 and sum_rain_1 fields.

could you test rain in particular.

also test the battery voltages. my firmware uses battery_vp, not battery_percent. i updated the fields so both should work, but it needs to be tested.

thank you for the pr!

scottgrey commented 8 years ago

I manually pulled in all of your changes to my repo and will let this run on mine for a bit to see how it goes. One thing I did notice, and it could be that you are using the sniff version, but I never saw the conversion methods actually being run. I noticed you had updated the rain conversion method.

I've always been doing the cloud version of the driver. With that in mind, I also went ahead and left in my rain calculation(augment packet), as I found that it allowed the daily rain total to drive changes in rain as opposed to what Netatmo was reporting (in case they do or do not report rain accurately since the last loop record as it's just pinging their services).

Anyhow, I found it fun to fiddle around with what it was doing, and just figured I'd share with you the updates I made since you put in all the hard work of getting this up and running.

Scott