On Wednesday, September 14, 2016 at 10:56:56 AM UTC-4, jmltech wrote:
>
> What would be a good example to follow for creating a new driver and 
> service?


joe,

first of all, you should decide whether to do a driver or a service.  a 
driver is the primary source of data when you run weewx.  a service can 
augment data obtained by a driver.  so if you just want to collect data 
from the inverter, implement a driver.  if you want to add data from the 
inverter to data you are already collecting from a weather station, 
implement a service.

the cmon extension is pretty complicated.  it contains both driver and 
service implementations, plus it contains a bunch of platform-specific code.

for the simplest example, look at the fileparse driver in the extensions 
directory of the weewx distribution.  you'll want to replace the file 
reading with http get requests, and replace the name-value parsing with 
json parsing.  see this thread for some examples:

https://groups.google.com/forum/#!topic/weewx-development/B9KMyT5DtAc

for a driver similar to what you want to do, take a look at the swb driver:

https://github.com/matthewwall/weewx-swb

the airmar driver can get data from http or serial:

https://github.com/fullergalway/weewx-airmar-150wx-driver

m

Reply via email to