This is a question about writing records to 3rd party databases such as 
Meteotemplate.  

In addition to WeeWX I have a site running Meteotemplate with it's own 
MySQL database.  The normal way of filling the Meteotemplate database is 
through clientraw.txt or realtime.txt and cron jobs, but I decided to write 
a service that automatically populates the Meteotemplate database on each 
archive period of WeeWX.  

This is all working but I had to do a few workarounds be able to write to 
the database and I am wondering if there are better ways to do it.

1.   The meteotemplate database uses a type datetime primary key, rather 
than unix epoch.  I could not get addRecord to work in that circumstance so 
I ended up using a getsql function to write the record to meteotemplate.

2.   I had to add a usUnit column to the meteotemplate database because 
weewx does a unit check and wont allow to post a new record unless the 
usUnits column match.  This is not a big deal, but is there a way around 
that?  In particular, the individual records in the meteotemplate database 
can be any combination of units - which makes a single unit indicator 
irrelevant, apart from making the database write possible

3.   The  standard db_manager = 
self.engine.db_binder.get_manager(data_binding='name_of_binding', 
initialize=True)   function insists on adding day summary tables, and when 
I set initialize to false and delete the unnecessary tables it gives an 
error that the tables are missing.  Is there a way to eliminate the 
creation of the day summary tables?

-- 
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