I'd like to announce a new plugin for WeeWx, weewx-aqi. weewx-aqi calculates various air quality indices using data from a linked air quality sensor, such as weewx-purpleair. An air quality index, is a government defined scaled that is meant to succinctly describe how safe the air is. weewx-aqi can currently calculate the following AQIs:
$latest('aqi_binding').aqi_pm2_5_category.
From this, the label and color category can be found via
(hex_color, category_label) = service.aqi_standard.interpret_aqi_index(index)"[CheetahGenerator]
search_list_extensions = user.aqi.service.AqiSearchList
$current($data_binding='aqi_binding').aqi_pm2_5$aqi($current($data_binding='aqi_binding').aqi_pm2_5_category).category$aqi($current($data_binding='aqi_binding').aqi_pm2_5_category).color;<div style="text-align: center; background-color: #$aqi($current($data_binding='aqi_binding').aqi_pm2_5_category).color;" >
$current($data_binding='aqi_binding').aqi_pm2_5 <br/>
$aqi($current($data_binding='aqi_binding').aqi_pm2_5_category).category
</div>
<div style="text-align: center; background-color: #$aqi($current($data_binding='aqi_binding').aqi_pm2_5_category).color;" > $current($data_binding='aqi_binding').aqi_pm2_5 <br/> ---> "Result is right3,0 µg/m³" $aqi($current($data_binding='aqi_binding').aqi_pm2_5_category).category </div><div style="text-align: center; background-color: #$aqi($current($data_binding='aqi_binding').aqi_pm10_0_category).color;" > $current($data_binding='aqi_binding').aqi_pm10_0 <br/> ----> "Result is rightit does not work right21,0 µg/m³" $aqi($current($data_binding='aqi_binding').aqi_pm10_0_category).category </div>
The Errors
Jun 9 19:50:29 wetter weewx-cmon[7576]: copygenerator: copied 0 files to /home/weewx/public_html
Jun 9 19:50:33 wetter OWFS[14428]: cheetahgenerator: Generate failed with exception '<class 'NameMapper.NotFound'>'
Jun 9 19:50:33 wetter OWFS[14428]: cheetahgenerator: **** Ignoring template /home/weewx/skins/Standard/indexAir.html.tmpl
Jun 9 19:50:33 wetter OWFS[14428]: cheetahgenerator: **** Reason: cannot find 'color' while searching for 'color'
Jun 9 19:50:33 wetter OWFS[14428]: **** Traceback (most recent call last):
Jun 9 19:50:33 wetter OWFS[14428]: **** File "/home/weewx/bin/weewx/cheetahgenerator.py", line 331, in generate
Jun 9 19:50:33 wetter OWFS[14428]: **** unicode_string = compiled_template.respond()
Jun 9 19:50:33 wetter OWFS[14428]: **** File "cheetah__home_weewx_skins_Standard_indexAir_html_tmpl_1560102633_0441406_65394.py", line 1105, in respond
Jun 9 19:50:33 wetter OWFS[14428]: **** NameMapper.NotFound: cannot find 'color' while searching for 'color'
Jun 9 19:50:33 wetter OWFS[14428]: cheetahgenerator: Generated 9 files for report StandardReport in 7.64 seconds
or / and
Jun 9 19:55:33 wetter OWFS[14428]: cheetahgenerator: Generate failed with exception '<class 'NameMapper.NotFound'>'
Jun 9 19:55:33 wetter OWFS[14428]: cheetahgenerator: **** Ignoring template /home/weewx/skins/Standard/indexAir.html.tmpl
Jun 9 19:55:33 wetter OWFS[14428]: cheetahgenerator: **** Reason: cannot find 'category' while searching for 'category'
Jun 9 19:55:33 wetter OWFS[14428]: **** Traceback (most recent call last):
Jun 9 19:55:33 wetter OWFS[14428]: **** File "/home/weewx/bin/weewx/cheetahgenerator.py", line 331, in generate
Jun 9 19:55:33 wetter OWFS[14428]: **** unicode_string = compiled_template.respond()
Jun 9 19:55:33 wetter OWFS[14428]: **** File "cheetah__home_weewx_skins_Standard_indexAir_html_tmpl_1560102933_0067816_68569.py", line 1106, in respond
Jun 9 19:55:33 wetter OWFS[14428]: **** NameMapper.NotFound: cannot find 'category' while searching for 'category'
Jun 9 19:55:33 wetter OWFS[14428]: cheetahgenerator: Generated 9 files for report StandardReport in 7.19 seconds
weewx.conf :[AqiService]
[[air_sensor]]
pm2_5 = pm_25
temp = tempAir
data_binding = air_binding
dateTime = dateTime
pressure = presAir
pm10_0 = pm_10
usUnits = usUnits
[[standard]]
data_binding = aqi_binding
standard = user.aqi.us.NowCast
[CheetahGenerator]
search_list_extensions = user.aqi.service.AqiSearchList
Thank youHartmut