Another FilePile question

72 views
Skip to first unread message

Colin Larsen

unread,
May 12, 2019, 5:15:38 PM5/12/19
to weewx-user
Hi all

I am successfully using FilePile to gather some air quality data and add it to my Weewx database. Upon using the tag $current.AQICO2 it returns the value in the database with 6 decimal points after it, in the database it is just a whole number of 672. I know I've something in the formatting somewhere but can't quite figure it out

Here is how the data is displayed using my test tag

  • Test AQM Co2 level is 672.000000
 Thanks
Colin

Colin Larsen

unread,
May 12, 2019, 6:43:13 PM5/12/19
to weewx-user
I finally managed to wrap my head around this I think (well it's working!) I looked back at an email I'd seen about this recently and this is the result that I have in my filepile.py. The bit I couldn't wrap my head around until just now was the link between defining the groups and units and connecting them to the database recordings - which was this

weewx.units.obs_group_dict['AQI25'] = 'group_dust'

weewx.units.obs_group_dict['AQI100'] = 'group_dust'

weewx.units.obs_group_dict['AQICO2'] = 'group_gas_concentration'


Anyway problem solved, hopefully this is the right place for it?


import syslog

import weewx

import weewx.units

from weewx.wxengine import StdService

from weeutil.weeutil import to_float


weewx.units.USUnits['group_gas_concentration'] = 'ppm'

weewx.units.MetricUnits['group_gas_concentration'] = 'ppm'

weewx.units.MetricWXUnits['group_gas_concentration'] = 'ppm'

weewx.units.default_unit_format_dict['ppm']  = '%.0f'

weewx.units.default_unit_label_dict['ppm']  = ' ppm'


weewx.units.USUnits['group_dust'] = 'microgramm_per_meter_cubic'

weewx.units.MetricUnits['group_dust'] = 'microgramm_per_meter_cubic'

weewx.units.MetricWXUnits['group_dust'] = 'microgramm_per_meter_cubic'

weewx.units.default_unit_format_dict['microgramm_per_meter_cubic']  = '%.1f'

weewx.units.default_unit_label_dict['microgramm_per_meter_cubic']  = ' \xce\xbcg/m\xc2\xb3'


weewx.units.obs_group_dict['AQI25'] = 'group_dust'

weewx.units.obs_group_dict['AQI100'] = 'group_dust'

weewx.units.obs_group_dict['AQICO2'] = 'group_gas_concentration'

Reply all
Reply to author
Forward
0 new messages