[weewx-user] Re: [ANNOUNCE] weewx-aqi: A Plugin for Air Quality Index Calculations

2019-12-27 Thread jonathan koren
weewx-aqi actually doesn’t talk to sensors, it reads from databases that 
whatever sensor plugins walked to. So in that sense it should work with 
whatever. The configuration lets you define which column from which 
database corresponds to what reading. I’ve used this with Purple Air and 
helped someone with a bespoke sensor setup.  If you need help, let me know.

-- 
jonathan

On Sunday, December 22, 2019 at 9:19:47 AM UTC-6, Muireadach O Connor wrote:
>
> Thanks very much for taking the time to write this.
> Does the current version support the Luftdaten.info type sensors out of 
> the box so to speak?, I had a read of the instructions on Github for using 
> with other sensors and I'm not really sure i'd know where to start though 
> I'd certainly give it a go once I see what the generated data looks like. 
>
> Many thanks,
>
> Muireadach.
>
> On Thursday, May 17, 2018 at 7:48:16 AM UTC+1, jonathan koren wrote:
>>
>>
>> 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:
>>
>> * Canada's Air Quality Health Index
>> * India's National Air Quality Index
>> * Mexico's Índice Metropolitano de la Calidad del Aire
>> * United Kingdom's Daily Air Quality Index
>> * United States's Air Quality Index
>> * United States's NowCast Air Quality Index
>>
>> Download link: 
>> https://github.com/jonathankoren/weewx-aqi/releases/tag/v1.0.0
>>
>> I personally use this plugin with my Purple Air sensor to calculate a PM 
>> 2.5 NowCast AQI. I hope others find this interesting and/or useful. I 
>> especially would like to hear from anyone that has an air quality sensor 
>> integrated into WeeWx that is not a Purple Air, as the plugin is written to 
>> be as sensor agnostic as possible. Finally, requests for additional AQIs 
>> are welcome. (Coming soon, the European Air Quality Index.)
>>
>> Thanks.
>>
>> --
>> jonathankoren
>>
>

-- 
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/a274f9df-9a1a-4320-96f2-3a92a2085048%40googlegroups.com.


[weewx-user] Re: [ANNOUNCE] weewx-aqi: A Plugin for Air Quality Index Calculations

2019-12-22 Thread Muireadach O Connor
Thanks very much for taking the time to write this.
Does the current version support the Luftdaten.info type sensors out of the 
box so to speak?, I had a read of the instructions on Github for using with 
other sensors and I'm not really sure i'd know where to start though I'd 
certainly give it a go once I see what the generated data looks like. 

Many thanks,

Muireadach.

On Thursday, May 17, 2018 at 7:48:16 AM UTC+1, jonathan koren wrote:
>
>
> 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:
>
> * Canada's Air Quality Health Index
> * India's National Air Quality Index
> * Mexico's Índice Metropolitano de la Calidad del Aire
> * United Kingdom's Daily Air Quality Index
> * United States's Air Quality Index
> * United States's NowCast Air Quality Index
>
> Download link: 
> https://github.com/jonathankoren/weewx-aqi/releases/tag/v1.0.0
>
> I personally use this plugin with my Purple Air sensor to calculate a PM 
> 2.5 NowCast AQI. I hope others find this interesting and/or useful. I 
> especially would like to hear from anyone that has an air quality sensor 
> integrated into WeeWx that is not a Purple Air, as the plugin is written to 
> be as sensor agnostic as possible. Finally, requests for additional AQIs 
> are welcome. (Coming soon, the European Air Quality Index.)
>
> Thanks.
>
> --
> jonathankoren
>

-- 
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/3fd038a6-811b-4af4-b651-2f2535cfad8b%40googlegroups.com.


[weewx-user] Re: [ANNOUNCE] weewx-aqi: A Plugin for Air Quality Index Calculations

2019-06-10 Thread jonathan koren
Must have been a missed check in .

in standards.py, replace interpret_aqi_index() with

def interpret_aqi_index(self, aqi_index):
'''Returns the color and category name associated with the pollutant
with the aqi_index (not aqi value).'''
return {
'color': self.colors[aqi_index],
'category': self.categories[aqi_index]

Or just download the new version (v1.1.2)



On Sunday, June 9, 2019 at 11:11:50 AM UTC-7, Hartmut Schweidler wrote:
>
> Hallo Jonathan,
>
> the test for the weekend
> Der Wocheendtest, aber nur Fehler   bei aqiColor und aqicategory
>
> in my "indexAir.htmk.tmpl" the code
>
> 
> $current($data_binding='aqi_binding').aqi_pm2_5   ---> "Result is 
> right 3,0 µg/m³" 
> $aqi($current($data_binding='aqi_binding').aqi_pm2_5_category).category
> 
>
> 
> $current($data_binding='aqi_binding').aqi_pm10_0> "Result is 
> right 21,0 µg/m³" 
> $aqi($current($data_binding='aqi_binding').aqi_pm10_0_category).category
> 
>
> it does not work right
>
> 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 ''
> 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 ''
> 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
>
> i have in default 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
>
>
> and  in skins 
>
> [CheetahGenerator]
> search_list_extensions = user.aqi.service.AqiSearchList
>
>
> Result no color no category
>  
>
>> Thank you
>> Hartmut
>>
>>

-- 
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/d4bb20f9-b81d-44a1-abd0-b4038e8cb6b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: [ANNOUNCE] weewx-aqi: A Plugin for Air Quality Index Calculations

2019-06-09 Thread Hartmut Schweidler
Hallo Jonathan,

the test for the weekend
Der Wocheendtest, aber nur Fehler   bei aqiColor und aqicategory

in my "indexAir.htmk.tmpl" the code


$current($data_binding='aqi_binding').aqi_pm2_5   ---> "Result is 
right 3,0 µg/m³" 
$aqi($current($data_binding='aqi_binding').aqi_pm2_5_category).category



$current($data_binding='aqi_binding').aqi_pm10_0> "Result is 
right 21,0 µg/m³" 
$aqi($current($data_binding='aqi_binding').aqi_pm10_0_category).category


it does not work right

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

i have in default 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


and  in skins 

[CheetahGenerator]
search_list_extensions = user.aqi.service.AqiSearchList


Result no color no category
 

> Thank you
> Hartmut
>
>

-- 
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/e50f81b5-347b-4553-b19b-0c3f52cf9898%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: [ANNOUNCE] weewx-aqi: A Plugin for Air Quality Index Calculations

2019-06-03 Thread Hartmut Schweidler

thank you for the information.

I will test it on the weekend

Thank you
Hartmut

-- 
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/8ab638a7-e3f8-4764-9823-c68f84f3f06b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: [ANNOUNCE] weewx-aqi: A Plugin for Air Quality Index Calculations

2019-06-03 Thread jonathan koren
Actually, you should use this one: 
https://github.com/jonathankoren/weewx-aqi/archive/v1.1.1.tar.gz

On Sunday, June 2, 2019 at 11:06:46 PM UTC-7, jonathan koren wrote:
>
>
> I had to push version but the solution is pretty easy. You can download 
> the new version from 
> https://github.com/jonathankoren/weewx-aqi/archive/v1.1.0.tar.gz
>
> You can either reinstall the whole thing, but the two files that got 
> modified were service.py and calculators.py, so you can just drop those in 
> if you want. Nothing else changed beyond the README.md . 
>
> Inside your skin.conf you'll need to add a new SearchList:
>
> [CheetahGenerator]
> search_list_extensions = user.aqi.service.AqiSearchList
>
>
> Then, inside your index.html.tmpl. you can use the new $aqi template to 
> get the color and description out.
>
>
> The AQI value (e.g. "9"): 
> $current($data_binding='aqi_binding').aqi_pm2_5
>
> The AQI category: 
>
> $aqi($current($data_binding='aqi_binding').aqi_pm2_5_category).category
>
>
> The AQI category's color in hex:
>
> $aqi($current($data_binding='aqi_binding').aqi_pm2_5_category).color;
>
>
>
> Putting everything together, you can do something like:
>
> 
> $current($data_binding='aqi_binding').aqi_pm2_5 
> $aqi($current($data_binding='aqi_binding').aqi_pm2_5_category).category
> 
>
>
> Sorry this took a code change, but your email did give the motivation I 
> needed to fix this.
>
> I guess, I should wrap up the EU AQI calculator, even if I'm having 
> trouble getting it to download CAMS data to fill in missing values.
>
> On Friday, May 31, 2019 at 1:00:36 AM UTC-7, jonathan koren wrote:
>>
>>
>> Honestly, that’s pretty hard to get that to work if I remember correctly. 
>> It’s not very cheetah template friendly. I haven’t looked at this in a 
>> while, but let me take a look at it this weekend.
>>
>> On Thursday, May 30, 2019 at 1:20:15 AM UTC-7, Hartmut Schweidler wrote:
>>>
>>> Hallo,
>>>
>>> I'm looking for an example in aqi.html.tmpl
>>>
>>> like "AQIs have categorical labels associated with the AQI values. The 
>>> index of the current category is available via 
>>> $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)"
>>>
>>> ich suche nach einem Beispiel für die Verwendung der Farben in einer 
>>> AQI-Seite
>>>
>>> Hartmut
>>>
>>

-- 
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/3bdce2c4-3f3e-46b7-aad9-d95f6a63f579%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: [ANNOUNCE] weewx-aqi: A Plugin for Air Quality Index Calculations

2019-06-03 Thread jonathan koren

I had to push version but the solution is pretty easy. You can download the 
new version from 
https://github.com/jonathankoren/weewx-aqi/archive/v1.1.0.tar.gz

You can either reinstall the whole thing, but the two files that got 
modified were service.py and calculators.py, so you can just drop those in 
if you want. Nothing else changed beyond the README.md . 

Inside your skin.conf you'll need to add a new SearchList:

[CheetahGenerator]
search_list_extensions = user.aqi.service.AqiSearchList


Then, inside your index.html.tmpl. you can use the new $aqi template to get 
the color and description out.


The AQI value (e.g. "9"): 
$current($data_binding='aqi_binding').aqi_pm2_5

The AQI category: 

$aqi($current($data_binding='aqi_binding').aqi_pm2_5_category).category


The AQI category's color in hex:

$aqi($current($data_binding='aqi_binding').aqi_pm2_5_category).color;



Putting everything together, you can do something like:


$current($data_binding='aqi_binding').aqi_pm2_5 
$aqi($current($data_binding='aqi_binding').aqi_pm2_5_category).category



Sorry this took a code change, but your email did give the motivation I 
needed to fix this.

I guess, I should wrap up the EU AQI calculator, even if I'm having trouble 
getting it to download CAMS data to fill in missing values.

On Friday, May 31, 2019 at 1:00:36 AM UTC-7, jonathan koren wrote:
>
>
> Honestly, that’s pretty hard to get that to work if I remember correctly. 
> It’s not very cheetah template friendly. I haven’t looked at this in a 
> while, but let me take a look at it this weekend.
>
> On Thursday, May 30, 2019 at 1:20:15 AM UTC-7, Hartmut Schweidler wrote:
>>
>> Hallo,
>>
>> I'm looking for an example in aqi.html.tmpl
>>
>> like "AQIs have categorical labels associated with the AQI values. The 
>> index of the current category is available via 
>> $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)"
>>
>> ich suche nach einem Beispiel für die Verwendung der Farben in einer 
>> AQI-Seite
>>
>> Hartmut
>>
>

-- 
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/5b6932ab-dff2-406e-ba21-f4c20a9476aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: [ANNOUNCE] weewx-aqi: A Plugin for Air Quality Index Calculations

2019-05-31 Thread jonathan koren

Honestly, that’s pretty hard to get that to work if I remember correctly. 
It’s not very cheetah template friendly. I haven’t looked at this in a 
while, but let me take a look at it this weekend.

On Thursday, May 30, 2019 at 1:20:15 AM UTC-7, Hartmut Schweidler wrote:
>
> Hallo,
>
> I'm looking for an example in aqi.html.tmpl
>
> like "AQIs have categorical labels associated with the AQI values. The 
> index of the current category is available via 
> $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)"
>
> ich suche nach einem Beispiel für die Verwendung der Farben in einer 
> AQI-Seite
>
> Hartmut
>

-- 
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/ca2ecd38-8352-45c4-80c4-2dbb046cb196%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Re: [ANNOUNCE] weewx-aqi: A Plugin for Air Quality Index Calculations

2019-05-30 Thread Hartmut Schweidler
Hallo,

I'm looking for an example in aqi.html.tmpl

like "AQIs have categorical labels associated with the AQI values. The 
index of the current category is available via 
$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)"

ich suche nach einem Beispiel für die Verwendung der Farben in einer 
AQI-Seite

Hartmut

-- 
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/dc708df1-348b-456f-bd17-f780294c7c9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.