Re: [weewx-user] Re: aqi_backfill gives error

2020-07-03 Thread jonathan koren

It creates a weewx engine.StdEngine to get handles to the databases to 
query. So no, it does not talk to any devices, but the device is getting 
opened as part of the engine startup, 

I have not seen anything like this with the Vantage driver. Have you tried 
shutting down weewx before running aqi_backfill?


On Thursday, July 2, 2020 at 9:28:14 PM UTC-7, Rahul Bedi wrote:
>
> Yes. Works with no issues outside of the script.
>
> It's not clear to me as to why this script is even trying to talk to the 
> weather station. Shouldn't it be just be moving data from one database to 
> the other ?
>
>
> On Fri, 3 Jul, 2020, 9:45 am jonathan koren,  > wrote:
>
>> It appears that weewx can't talk to whatever device is on your USB. Are 
>> you sure you have the WMR 200 configured correctly? Is it plugged in?
>>
>> These errors aren't even happening in the AQI code.
>>
>> On Wednesday, July 1, 2020 at 11:36:39 PM UTC-7, Rahul Bedi wrote:
>>>
>>> Tried and gives the following message and it hangs:
>>>
>>> pi@PrideWeatherStation:/var/lib/weewx $ sudo 
>>> /usr/share/weewx/aqi_backfill --start_time 1592634016 --end_time 1593670517 
>>> /etc/weewx/weewx.conf
>>> Starting backfill from 1592634016 2020-06-20 11:50:16
>>> No handlers could be found for logger "weewx.drivers.wmr200"
>>> Exception in thread Thread-2:
>>> Traceback (most recent call last):
>>>   File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
>>> self.run()
>>>   File "/usr/share/weewx/weewx/drivers/wmr200.py", line 1229, in run
>>> _ = self.usb_device.read_device()
>>>   File "/usr/share/weewx/weewx/drivers/wmr200.py", line 259, in 
>>> read_device
>>> raise weewx.WeeWxIOError(msg)
>>> WeeWxIOError: read_device() USB Error Reason:[Errno 110] Operation timed 
>>> out
>>>
>>> On Thu, Jul 2, 2020 at 11:33 AM jonathan koren <
>>> spam-...@robotmonkeys.net> wrote:
>>>
>>>> There's a new weewx-aqi release (1.3) 
>>>> https://github.com/jonathankoren/weewx-aqi/releases/tag/v1.3 so make 
>>>> sure you get that. It has some changes that effect aqi_backfill, including 
>>>> the fix for this.
>>>>
>>>> Be aware, aqi_backfill  pretty temperamental. 
>>>>
>>>>
>>>> On Wednesday, July 1, 2020 at 3:57:10 AM UTC-7, Rahul Bedi wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> I tried running the "aqi_backfill" script which is part of the aqi 
>>>>> extension on a weewx 4.1.1 install and get the following error.
>>>>>
>>>>> Looks like way to pull the config seems to have changes since the time 
>>>>> this script was written.
>>>>>
>>>>> Any ideas?
>>>>>
>>>>> - Rahul
>>>>>
>>>>>
>>>>> pi@PrideWeatherStation:/usr/share/weewx $ sudo ./aqi_backfill 
>>>>> weewx.conf
>>>>> Traceback (most recent call last):
>>>>>   File "./aqi_backfill", line 34, in 
>>>>> config = weewx.engine.getConfiguration(args.config_file)
>>>>> AttributeError: 'module' object has no attribute 'getConfiguration'
>>>>>
>>>>>
>>>>>
>>>>> pi@PrideWeatherStation:/usr/share/weewx $ sudo ./aqi_backfill 
>>>>> /etc/weewx/weewx.conf
>>>>> Traceback (most recent call last):
>>>>>   File "./aqi_backfill", line 34, in 
>>>>> config = weewx.engine.getConfiguration(args.config_file)
>>>>> AttributeError: 'module' object has no attribute 'getConfiguration'
>>>>>
>>>>> -- 
>>>> You received this message because you are subscribed to a topic in the 
>>>> Google Groups "weewx-user" group.
>>>> To unsubscribe from this topic, visit 
>>>> https://groups.google.com/d/topic/weewx-user/K6drNzzE5vs/unsubscribe.
>>>> To unsubscribe from this group and all its topics, send an email to 
>>>> weewx...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/weewx-user/cc941830-184c-4006-9aff-65071baa3d29o%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/weewx-user/cc941830-184c-4006-9aff-65071baa3d29o%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "weewx-user" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/weewx-user/K6drNzzE5vs/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> weewx...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/de4581a0-cfe4-4e4c-b13c-eeba41e209a1o%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/weewx-user/de4581a0-cfe4-4e4c-b13c-eeba41e209a1o%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/98d1270f-98f5-47f9-924e-b9fc566558eco%40googlegroups.com.


Re: [weewx-user] Re: aqi_backfill gives error

2020-07-02 Thread jonathan koren
It appears that weewx can't talk to whatever device is on your USB. Are you 
sure you have the WMR 200 configured correctly? Is it plugged in?

These errors aren't even happening in the AQI code.

On Wednesday, July 1, 2020 at 11:36:39 PM UTC-7, Rahul Bedi wrote:
>
> Tried and gives the following message and it hangs:
>
> pi@PrideWeatherStation:/var/lib/weewx $ sudo /usr/share/weewx/aqi_backfill 
> --start_time 1592634016 --end_time 1593670517 /etc/weewx/weewx.conf
> Starting backfill from 1592634016 2020-06-20 11:50:16
> No handlers could be found for logger "weewx.drivers.wmr200"
> Exception in thread Thread-2:
> Traceback (most recent call last):
>   File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
> self.run()
>   File "/usr/share/weewx/weewx/drivers/wmr200.py", line 1229, in run
> _ = self.usb_device.read_device()
>   File "/usr/share/weewx/weewx/drivers/wmr200.py", line 259, in read_device
> raise weewx.WeeWxIOError(msg)
> WeeWxIOError: read_device() USB Error Reason:[Errno 110] Operation timed 
> out
>
> On Thu, Jul 2, 2020 at 11:33 AM jonathan koren  > wrote:
>
>> There's a new weewx-aqi release (1.3) 
>> https://github.com/jonathankoren/weewx-aqi/releases/tag/v1.3 so make 
>> sure you get that. It has some changes that effect aqi_backfill, including 
>> the fix for this.
>>
>> Be aware, aqi_backfill  pretty temperamental. 
>>
>>
>> On Wednesday, July 1, 2020 at 3:57:10 AM UTC-7, Rahul Bedi wrote:
>>>
>>> Hi,
>>>
>>> I tried running the "aqi_backfill" script which is part of the aqi 
>>> extension on a weewx 4.1.1 install and get the following error.
>>>
>>> Looks like way to pull the config seems to have changes since the time 
>>> this script was written.
>>>
>>> Any ideas?
>>>
>>> - Rahul
>>>
>>>
>>> pi@PrideWeatherStation:/usr/share/weewx $ sudo ./aqi_backfill weewx.conf
>>> Traceback (most recent call last):
>>>   File "./aqi_backfill", line 34, in 
>>> config = weewx.engine.getConfiguration(args.config_file)
>>> AttributeError: 'module' object has no attribute 'getConfiguration'
>>>
>>>
>>>
>>> pi@PrideWeatherStation:/usr/share/weewx $ sudo ./aqi_backfill 
>>> /etc/weewx/weewx.conf
>>> Traceback (most recent call last):
>>>   File "./aqi_backfill", line 34, in 
>>> config = weewx.engine.getConfiguration(args.config_file)
>>> AttributeError: 'module' object has no attribute 'getConfiguration'
>>>
>>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "weewx-user" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/weewx-user/K6drNzzE5vs/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> weewx...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/cc941830-184c-4006-9aff-65071baa3d29o%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/weewx-user/cc941830-184c-4006-9aff-65071baa3d29o%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/de4581a0-cfe4-4e4c-b13c-eeba41e209a1o%40googlegroups.com.


[weewx-user] Re: aqi_backfill gives error

2020-07-01 Thread jonathan koren
There's a new weewx-aqi release (1.3) 
https://github.com/jonathankoren/weewx-aqi/releases/tag/v1.3 so make sure 
you get that. It has some changes that effect aqi_backfill, including the 
fix for this.

Be aware, aqi_backfill  pretty temperamental. 


On Wednesday, July 1, 2020 at 3:57:10 AM UTC-7, Rahul Bedi wrote:
>
> Hi,
>
> I tried running the "aqi_backfill" script which is part of the aqi 
> extension on a weewx 4.1.1 install and get the following error.
>
> Looks like way to pull the config seems to have changes since the time 
> this script was written.
>
> Any ideas?
>
> - Rahul
>
>
> pi@PrideWeatherStation:/usr/share/weewx $ sudo ./aqi_backfill weewx.conf
> Traceback (most recent call last):
>   File "./aqi_backfill", line 34, in 
> config = weewx.engine.getConfiguration(args.config_file)
> AttributeError: 'module' object has no attribute 'getConfiguration'
>
>
>
> pi@PrideWeatherStation:/usr/share/weewx $ sudo ./aqi_backfill 
> /etc/weewx/weewx.conf
> Traceback (most recent call last):
>   File "./aqi_backfill", line 34, in 
> config = weewx.engine.getConfiguration(args.config_file)
> AttributeError: 'module' object has no attribute 'getConfiguration'
>
>

-- 
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/cc941830-184c-4006-9aff-65071baa3d29o%40googlegroups.com.


[weewx-user] ANNOUCE: WeeWX-AQI 1.2

2020-05-09 Thread jonathan koren
WeeWX AQI is an extension that calculates air quality indices from raw air 
quality sensor data.  It can calculate the following indices:

   - 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

This version supports WeeWX 4.0, and improves support for sensors beyond 
Purple Air.

Download it from: 
https://github.com/jonathankoren/weewx-aqi/releases/tag/v1.2

-- 
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/25b7c18f-2bc5-41c6-9471-ebc8af0174b5%40googlegroups.com.


[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 
>> <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fjonathankoren%2Fweewx-aqi%2Freleases&sa=D&sntz=1&usg=AFQjCNFBUV2HXkP4peP_NgPFxJqfdrsHmA>.
>>  
>> weewx-aqi calculates various air quality indices using data from a linked 
>> air quality sensor, such as weewx-purpleair 
>> <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fbakerkj%2Fweewx-purpleair&sa=D&sntz=1&usg=AFQjCNEco2LGDlALxkjPF92Ez-zxhNTw3g>.
>>  
>> 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-06-09 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-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-02 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: Cheetah SearchList And Data Bindnigs

2018-11-11 Thread jonathan koren
Thanks for the link. For some reason I couldn’t find it in the manual.

Just in case someone searches the archive, the correct line is:

$current($data_binding=‘aqi_binding’).aqi_pm2_5


On Sunday, November 11, 2018 at 1:07:48 AM UTC-8, Andrew Milner wrote:
>
> according to the customisation guide 
> http://weewx.com/docs/customizing.htm#Using_multiple_bindings
>
> I think the tag format is something like:
>
> $niculskinLabels.conditions.aqi_pm2_5($data_binding='aqi_binding').current.aqi_pm2_5
>
>
> On Sunday, 11 November 2018 09:14:35 UTC+2, jonathan koren wrote:
>>
>> I'm trying to modify my templates to display data from a new data 
>> binding, but I'm confused about how to do that. It seems like all I need to 
>> do is pass CheetahGenerator a new data binding, but it's not obvious how 
>> you would do that while keeping the default data binding active as well. 
>> This isn't a problem when drawing charts, but filling in HTML templates, it 
>> seems pretty difficult. There might be a way to do this with 
>> search_list_objs, but it's not clear how you actually instantiate those 
>> objects with a data binding that isn't from CheetahGenerator. I'm kind of 
>> at a loss.
>>
>> For reference, here's a broken snippet from my index.html.tmpl
>>
>> 
>> $niculskinLabels.conditions.out_temp$current.outTemp
>> 
>> $niculskinLabels.conditions.aqi_pm2_5$aqi_binding.current.aqi_pm2_5
>>
>> This doesn't work because aqi_binding, isn't defined in the 
>> CheetahGenerator search list.
>>
>> From what I can tell, I only need to do is change the binding everything 
>> will just work, but getting two bindings to work with one template, is not 
>> clear at all.
>>
>> Any thoughts on how to do this?
>>
>>
>>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Cheetah SearchList And Data Bindnigs

2018-11-10 Thread jonathan koren
I'm trying to modify my templates to display data from a new data binding, 
but I'm confused about how to do that. It seems like all I need to do is 
pass CheetahGenerator a new data binding, but it's not obvious how you 
would do that while keeping the default data binding active as well. This 
isn't a problem when drawing charts, but filling in HTML templates, it 
seems pretty difficult. There might be a way to do this with 
search_list_objs, but it's not clear how you actually instantiate those 
objects with a data binding that isn't from CheetahGenerator. I'm kind of 
at a loss.

For reference, here's a broken snippet from my index.html.tmpl


$niculskinLabels.conditions.out_temp$current.outTemp

$niculskinLabels.conditions.aqi_pm2_5$aqi_binding.current.aqi_pm2_5

This doesn't work because aqi_binding, isn't defined in the 
CheetahGenerator search list.

>From what I can tell, I only need to do is change the binding everything 
will just work, but getting two bindings to work with one template, is not 
clear at all.

Any thoughts on how to do this?


-- 
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.
For more options, visit https://groups.google.com/d/optout.


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

2018-05-16 Thread jonathan koren


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.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Air quality sensors?

2018-01-15 Thread jonathan koren
That appears to have been the problem.

I'm really happy how easy this has been to integrate into my local setup.

Thanks

On Monday, January 15, 2018 at 9:59:16 PM UTC-8, Glenn McKechnie wrote:
>
> Hi jonathon 
>
> There is a typo in the install script which I installed using 
> wee_extension, ie: 'wee_extension --install master.zip' 
>
> process_services='user.cmon.PurpleAirMonitor', 
>
> should be... 
>
> process_services='user.purpleair.PurpleAirMonitor', 
>
>
> You can change it directly in weewx.conf and restart weewx (stop weewx 
> first, then start it as it maybe a bit messed up from the hard crash - 
> at least for me it was) 
>
> It creates the database with archive_day  tables so that may satisfy 
> the day summary complaint? 
>
> I can't test it any further as there is nothing to query here - I 
> don't have one. 
>
> Good luck! 
>
>
>
> Cheers 
>  Glenn 
>
> rorpi - read only raspberry pi & various weewx addons 
> https://github.com/glennmckechnie 
>
>
> On 16 January 2018 at 15:48, gjr80 > 
> wrote: 
> > Hi, 
> > 
> > I'm not familiar with weewx-purpleair and I am not sure if the stack 
> trace 
> > you posted is with a manually created database or not, but one 
> suggestion if 
> > I may. If the weewx-purpleair is supposed to create its own database 
> then I 
> > would be trying to work through that issue rather than manually creating 
> the 
> > database. In my experience when weeWX related databases are manually 
> created 
> > and you subsequently have errors you then need to work out if the errors 
> are 
> > due to the manually created database having some defect/shorfall or is 
> it 
> > due to an error in the extension/driver/code you are running. You are 
> > usually far better to let the weeWX API maintain the databases, when 
> things 
> > don't work it takes one variable out of the equation. 
> > 
> > Gary 
> > 
> > 
> > On Tuesday, 16 January 2018 13:54:24 UTC+10, jonathan koren wrote: 
> >> 
> >> Apologies for the double post. I accidentally sent the message before I 
> >> was ready. 
> >> 
> >> Here's the stack trace. 
> >> Traceback (most recent call last): 
> >>   File "/usr/share/weewx/weewx/reportengine.py", line 239, in run 
> >> obj.start() 
> >>   File "/usr/share/weewx/weewx/reportengine.py", line 273, in start 
> >> self.run() 
> >>   File "/usr/share/weewx/weewx/imagegenerator.py", line 32, in run 
> >> self.genImages(self.gen_ts) 
> >>   File "/usr/share/weewx/weewx/imagegenerator.py", line 72, in 
> genImages 
> >> archive = self.db_binder.get_manager(binding) 
> >>   File "/usr/share/weewx/weewx/manager.py", line 857, in get_manager 
> >> self.manager_cache[data_binding] = open_manager(manager_dict, 
> >> initialize) 
> >>   File "/usr/share/weewx/weewx/manager.py", line 1009, in open_manager 
> >> manager_dict['table_name']) 
> >>   File "/usr/share/weewx/weewx/manager.py", line 104, in open 
> >> dbmanager = cls(connection, table_name) 
> >>   File "/usr/share/weewx/weewx/manager.py", line 1149, in __init__ 
> >> raise weedb.OperationalError("No day summary schema for table '%s' 
> in 
> >> database '%s'" % (self.table_name, connection.database_name)) 
> >> OperationalError: No day summary schema for table 'archive' in database 
> >> 'purpleair.sdb' 
> >> Jan 15 19:44:52 raspberrypi wee_reports[14415]: copygenerator: copied 8 
> >> files to /var/www/html/weewx 
> >> 
> >> It looks likes it's something with the user.purpleair.schema not being 
> >> passed through correctly or sometthing. 
> >> 
> >> Any suggestions? This is v0.2 release from github. 
> >> 
> >> Thanks. 
> >> 
> >> On Monday, January 15, 2018 at 7:45:10 PM UTC-8, jonathan koren wrote: 
> >>> 
> >>> I just installed my purple air sensor, and am trying out 
> weewx-purpleair, 
> >>> but I'm having all sorts of problems getting the purpleair.sdb to be 
> created 
> >>> correctly. 
> >>> 
> >>> Originally, purpleair.sdb wasn't created, so I created it along with 
> the 
> >>> archive table, but it still isn't working. It's now complaining about 
> >>> OperationalError: No day

Re: [weewx-user] Re: Air quality sensors?

2018-01-15 Thread jonathan koren
Apologies for the double post. I accidentally sent the message before I was 
ready.

Here's the stack trace.
Traceback (most recent call last):
  File "/usr/share/weewx/weewx/reportengine.py", line 239, in run
obj.start()
  File "/usr/share/weewx/weewx/reportengine.py", line 273, in start
self.run()
  File "/usr/share/weewx/weewx/imagegenerator.py", line 32, in run
self.genImages(self.gen_ts)
  File "/usr/share/weewx/weewx/imagegenerator.py", line 72, in genImages
archive = self.db_binder.get_manager(binding)
  File "/usr/share/weewx/weewx/manager.py", line 857, in get_manager
self.manager_cache[data_binding] = open_manager(manager_dict, 
initialize)
  File "/usr/share/weewx/weewx/manager.py", line 1009, in open_manager
manager_dict['table_name'])
  File "/usr/share/weewx/weewx/manager.py", line 104, in open
dbmanager = cls(connection, table_name)
  File "/usr/share/weewx/weewx/manager.py", line 1149, in __init__
raise weedb.OperationalError("No day summary schema for table '%s' in 
database '%s'" % (self.table_name, connection.database_name))
OperationalError: No day summary schema for table 'archive' in database 
'purpleair.sdb'
Jan 15 19:44:52 raspberrypi wee_reports[14415]: copygenerator: copied 8 
files to /var/www/html/weewx

It looks likes it's something with the user.purpleair.schema not being 
passed through correctly or sometthing.

Any suggestions? This is v0.2 release from github.

Thanks.

On Monday, January 15, 2018 at 7:45:10 PM UTC-8, jonathan koren wrote:
>
> I just installed my purple air sensor, and am trying out weewx-purpleair, 
> but I'm having all sorts of problems getting the purpleair.sdb to be 
> created correctly. 
>
> Originally, purpleair.sdb wasn't created, so I created it along with the 
> archive table, but it still isn't working. It's now complaining about 
> OperationalError: No day summary schema for table 'archive' in database 
> 'purpleair.sdb'
>
>
> On Wednesday, January 10, 2018 at 8:14:48 AM UTC-8, Kenneth Baker wrote:
>>
>> Hi Daniel, 
>>
>> Please give this a try: https://github.com/bakerkj/weewx-purpleair.  The 
>> installation procedure is untested at the moment.  Comments, suggestions, 
>> new 
>> feature requests are all welcome. 
>>
>> -- Ken 
>>
>>
>> P.S.  Matthew, I modeled this plugin on your cmon extension - 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.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Re: Air quality sensors?

2018-01-15 Thread jonathan koren
I just installed my purple air sensor, and am trying out weewx-purpleair, 
but I'm having all sorts of problems getting the purpleair.sdb to be 
created correctly. 

Originally, purpleair.sdb wasn't created, so I created it along with the 
archive table, but it still isn't working. It's now complaining about 
OperationalError: No day summary schema for table 'archive' in database 
'purpleair.sdb'


On Wednesday, January 10, 2018 at 8:14:48 AM UTC-8, Kenneth Baker wrote:
>
> Hi Daniel, 
>
> Please give this a try: https://github.com/bakerkj/weewx-purpleair.  The 
> installation procedure is untested at the moment.  Comments, suggestions, 
> new 
> feature requests are all welcome. 
>
> -- Ken 
>
>
> P.S.  Matthew, I modeled this plugin on your cmon extension - 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.
For more options, visit https://groups.google.com/d/optout.