I searched the topics, and I did not found anything about that topic, so I 
try to ask.

I am new to Weewx, and I am new to Python. So have mercy, if I do something 
stupid.

I wanted to upload data to Wetternetz-Sachsen. There was no driver, so I 
tried to adapt an existing one. The example I used was the "Windy" driver. 
And I am glad to say it works. 

All is fine so far.

But they want the user to upload some aggregate values such as minimum 
temperature and maximum temperature, too. The record variable contains the 
data of the "archive" table, only. But there are additional tables such as 
"archive_day_outTemp". They are used in reports, but I found no way to 
access them.

What did not work was that:

def get_record(self, record, dbmanager): 

    # run parent class 
    _datadict = super(WnsThread,self).get_record(record,dbmanager) 
    # actual time stamp 
    _time_ts = _datadict['dateTime'] 

    try:

        if 'outTempDayMax' not in _datadict:

            _result = dbmanager.getSql(
                "SELECT min,max FROM %s "
                "WHERE dateTime = ?"
                % "archive_day_outTemp", (_time_ts))
            if _result is not None:
                _datadict['outTempDayMin']=_result[0]
                _datadict['outTempDayMax']=_result[1]
    except weedb.OperationalError as e:
        log.debug("%s: Database OperationalError '%s'",self.protocol_name,e)
    return _datadict

If I replace "archive_day_outTemp" by dbmanager.table_name, then no 
exception is raised any more, but the "archive" table is read instead of 
the table I want to read. So I see the problem is within the getSql() 
statement. But I have no clue.


-- 
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/52938325-6cb2-41b6-b7cc-1349e78fbbbbn%40googlegroups.com.

Reply via email to