[weewx-user] Re: Cannot decode reading of 'None' for gauge 'windDir'

2020-07-13 Thread Andrej B.
Hello,

Thanks. Look like this improvement works!


Andrej

2020 m. birželis 24 d., trečiadienis 22:37:29 UTC+3, Pat rašė:
>
> I'm not the maintainer of this extension, and I don't use it so I'm purely 
> guessing here.  
>
> But based on the information you've given, try replacing the section 
> you've pasted with this. Maintain a backup copy in case you need to revert 
> back. 
>
> try:
> history = int(plot_options.get('history'))
> except:
> pass
> else:
> history_list = []
> windspeed_history_list = []
>
>
> batch_records = 
> self.db_manager.genBatchRecords(self.lastGoodStamp 
> - history * 60 * 60, self.lastGoodStamp)
>
>
> for rec in batch_records:
> db_value_tuple = weewx.units.as_value_tuple(rec, 
> columnname)
> history_value = weewx.units.convert(db_value_tuple, 
> target_unit)[0]
>
>
> try:
> if history_value is not None:
> history_list.append(float(history_value))
> else:
> continue
> except:
> syslog.syslog(syslog.LOG_DEBUG, "GaugeGenerator: 
> Cannot decode reading of '%s' for gauge '%s'"
>   % (history_value, gaugename))
>
>
>
> On Wednesday, June 24, 2020 at 12:15:36 PM UTC-4, Andrej B. wrote:
>>
>> Good afternoon,
>>
>> I use Bootstrap theme with Nick gauges (dajda.net). Weewx ver. 4.1 under 
>> python 2.7 (Debian Buster)
>> In my syslog every archive interval I see hundreds messages like: 
>> GaugeGenerator: Cannot decode reading of 'None' for gauge 'windDir'
>> This is only happens when wind speed is not None. Below is logfile part:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *Jun 24 19:00:15 weewxpi weewxd: GaugeGenerator: outTemp reading = 25.5 
>> degree_CJun 24 19:00:15 weewxpi weewxd: GaugeGenerator: inTemp reading = 
>> 24.11 degree_CJun 24 19:00:15 weewxpi weewxd: GaugeGenerator: 
>> barometer reading = 1022.58763232 mbarJun 24 19:00:15 weewxpi weewxd: 
>> GaugeGenerator: outHumidity reading = 49.0 percentJun 24 19:00:15 weewxpi 
>> weewxd: GaugeGenerator: inHumidity reading = 56.0 percentJun 24 19:00:16 
>> weewxpi weewxd: GaugeGenerator: windSpeed reading = 2.68224 
>> meter_per_secondJun 24 19:00:16 weewxpi weewxd: GaugeGenerator: windGust 
>> reading = 6.25856 meter_per_secondJun 24 19:00:16 weewxpi weewxd: 
>> GaugeGenerator: windDir reading = 0.0 degree_compassJun 24 19:00:16 weewxpi 
>> weewxd: GaugeGenerator: Cannot decode reading of 'None' for gauge 
>> 'windDir'Jun 24 19:00:16 weewxpi weewxd: GaugeGenerator: Cannot decode 
>> reading of 'None' for gauge 'windDir'Jun 24 19:00:16 weewxpi weewxd: 
>> GaugeGenerator: Cannot decode reading of 'None' for gauge 'windDir'*
>>
>> This is part of code responsible for this:
>>
>> try:
>> history = int(plot_options.get('history'))
>> except:
>> pass
>> else:
>> history_list = []
>> windspeed_history_list = []
>>
>> batch_records = 
>> self.db_manager.genBatchRecords(self.lastGoodStamp - history * 60 * 60, 
>> self.lastGoodStamp)
>>
>> for rec in batch_records:
>> db_value_tuple = weewx.units.as_value_tuple(rec, 
>> columnname)
>> history_value = weewx.units.convert(db_value_tuple, 
>> target_unit)[0]
>>
>> try:
>> history_list.append(float(history_value))
>> except:
>> syslog.syslog(syslog.LOG_DEBUG, "GaugeGenerator: 
>> Cannot decode reading of '%s' for gauge '%s'"
>>   % (history_value, gaugename))
>>
>>
>> Why this happens when wind speed has reading?
>>
>> Thanks
>>
>

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/2e048a89-84e0-42c9-b37e-bc76989da9f7o%40googlegroups.com.


[weewx-user] Re: Cannot decode reading of 'None' for gauge 'windDir'

2020-06-24 Thread Pat
I'm not the maintainer of this extension, and I don't use it so I'm purely 
guessing here.  

But based on the information you've given, try replacing the section you've 
pasted with this. Maintain a backup copy in case you need to revert back. 

try:
history = int(plot_options.get('history'))
except:
pass
else:
history_list = []
windspeed_history_list = []


batch_records = self.db_manager.genBatchRecords(self.lastGoodStamp 
- history * 60 * 60, self.lastGoodStamp)


for rec in batch_records:
db_value_tuple = weewx.units.as_value_tuple(rec, columnname)
history_value = weewx.units.convert(db_value_tuple, 
target_unit)[0]


try:
if history_value is not None:
history_list.append(float(history_value))
else:
continue
except:
syslog.syslog(syslog.LOG_DEBUG, "GaugeGenerator: Cannot 
decode reading of '%s' for gauge '%s'"
  % (history_value, gaugename))



On Wednesday, June 24, 2020 at 12:15:36 PM UTC-4, Andrej B. wrote:
>
> Good afternoon,
>
> I use Bootstrap theme with Nick gauges (dajda.net). Weewx ver. 4.1 under 
> python 2.7 (Debian Buster)
> In my syslog every archive interval I see hundreds messages like: 
> GaugeGenerator: Cannot decode reading of 'None' for gauge 'windDir'
> This is only happens when wind speed is not None. Below is logfile part:
>
>
>
>
>
>
>
>
>
>
>
> *Jun 24 19:00:15 weewxpi weewxd: GaugeGenerator: outTemp reading = 25.5 
> degree_CJun 24 19:00:15 weewxpi weewxd: GaugeGenerator: inTemp reading = 
> 24.11 degree_CJun 24 19:00:15 weewxpi weewxd: GaugeGenerator: 
> barometer reading = 1022.58763232 mbarJun 24 19:00:15 weewxpi weewxd: 
> GaugeGenerator: outHumidity reading = 49.0 percentJun 24 19:00:15 weewxpi 
> weewxd: GaugeGenerator: inHumidity reading = 56.0 percentJun 24 19:00:16 
> weewxpi weewxd: GaugeGenerator: windSpeed reading = 2.68224 
> meter_per_secondJun 24 19:00:16 weewxpi weewxd: GaugeGenerator: windGust 
> reading = 6.25856 meter_per_secondJun 24 19:00:16 weewxpi weewxd: 
> GaugeGenerator: windDir reading = 0.0 degree_compassJun 24 19:00:16 weewxpi 
> weewxd: GaugeGenerator: Cannot decode reading of 'None' for gauge 
> 'windDir'Jun 24 19:00:16 weewxpi weewxd: GaugeGenerator: Cannot decode 
> reading of 'None' for gauge 'windDir'Jun 24 19:00:16 weewxpi weewxd: 
> GaugeGenerator: Cannot decode reading of 'None' for gauge 'windDir'*
>
> This is part of code responsible for this:
>
> try:
> history = int(plot_options.get('history'))
> except:
> pass
> else:
> history_list = []
> windspeed_history_list = []
>
> batch_records = 
> self.db_manager.genBatchRecords(self.lastGoodStamp - history * 60 * 60, 
> self.lastGoodStamp)
>
> for rec in batch_records:
> db_value_tuple = weewx.units.as_value_tuple(rec, 
> columnname)
> history_value = weewx.units.convert(db_value_tuple, 
> target_unit)[0]
>
> try:
> history_list.append(float(history_value))
> except:
> syslog.syslog(syslog.LOG_DEBUG, "GaugeGenerator: 
> Cannot decode reading of '%s' for gauge '%s'"
>   % (history_value, gaugename))
>
>
> Why this happens when wind speed has reading?
>
> Thanks
>

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/5328740c-4e91-4b66-bc9c-b1423327971fo%40googlegroups.com.


[weewx-user] Re: Cannot decode reading of 'None' for gauge 'windDir'

2020-06-24 Thread Andrej B.
If wind speed is 0, then "cannot decode" message is not seen:

Jun 24 22:20:16 weewxpi weewxd: GaugeGenerator: windSpeed reading = 0.0 
meter_per_second
Jun 24 22:20:16 weewxpi weewxd: GaugeGenerator: windGust reading = 0.0 
meter_per_second
Jun 24 22:20:16 weewxpi weewxd: GaugeGenerator: windDir has no reading 
(None)
Jun 24 22:20:16 weewxpi weewxd: GaugeGenerator: radiation reading = 0.0 
watt_per_meter_squared
Jun 24 22:20:16 weewxpi weewxd: GaugeGenerator: UV reading = 0.0 uv_index


2020 m. birželis 24 d., trečiadienis 19:15:36 UTC+3, Andrej B. rašė:
>
> Good afternoon,
>
> I use Bootstrap theme with Nick gauges (dajda.net). Weewx ver. 4.1 under 
> python 2.7 (Debian Buster)
> In my syslog every archive interval I see hundreds messages like: 
> GaugeGenerator: Cannot decode reading of 'None' for gauge 'windDir'
> This is only happens when wind speed is not None. Below is logfile part:
>
>
>
>
>
>
>
>
>
>
>
> *Jun 24 19:00:15 weewxpi weewxd: GaugeGenerator: outTemp reading = 25.5 
> degree_CJun 24 19:00:15 weewxpi weewxd: GaugeGenerator: inTemp reading = 
> 24.11 degree_CJun 24 19:00:15 weewxpi weewxd: GaugeGenerator: 
> barometer reading = 1022.58763232 mbarJun 24 19:00:15 weewxpi weewxd: 
> GaugeGenerator: outHumidity reading = 49.0 percentJun 24 19:00:15 weewxpi 
> weewxd: GaugeGenerator: inHumidity reading = 56.0 percentJun 24 19:00:16 
> weewxpi weewxd: GaugeGenerator: windSpeed reading = 2.68224 
> meter_per_secondJun 24 19:00:16 weewxpi weewxd: GaugeGenerator: windGust 
> reading = 6.25856 meter_per_secondJun 24 19:00:16 weewxpi weewxd: 
> GaugeGenerator: windDir reading = 0.0 degree_compassJun 24 19:00:16 weewxpi 
> weewxd: GaugeGenerator: Cannot decode reading of 'None' for gauge 
> 'windDir'Jun 24 19:00:16 weewxpi weewxd: GaugeGenerator: Cannot decode 
> reading of 'None' for gauge 'windDir'Jun 24 19:00:16 weewxpi weewxd: 
> GaugeGenerator: Cannot decode reading of 'None' for gauge 'windDir'*
>
> This is part of code responsible for this:
>
> try:
> history = int(plot_options.get('history'))
> except:
> pass
> else:
> history_list = []
> windspeed_history_list = []
>
> batch_records = 
> self.db_manager.genBatchRecords(self.lastGoodStamp - history * 60 * 60, 
> self.lastGoodStamp)
>
> for rec in batch_records:
> db_value_tuple = weewx.units.as_value_tuple(rec, 
> columnname)
> history_value = weewx.units.convert(db_value_tuple, 
> target_unit)[0]
>
> try:
> history_list.append(float(history_value))
> except:
> syslog.syslog(syslog.LOG_DEBUG, "GaugeGenerator: 
> Cannot decode reading of '%s' for gauge '%s'"
>   % (history_value, gaugename))
>
>
> Why this happens when wind speed has reading?
>
> Thanks
>

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/fb695639-e5dd-4f0f-b27b-1fd5d68adf07o%40googlegroups.com.