Author Topic: Alt Dashboard V6.53 and AQI Problem  (Read 2579 times)

0 Members and 1 Guest are viewing this topic.

Offline azkiwi

  • Senior Contributor
  • ****
  • Posts: 160
    • Maricopa, Sonoran Desert, Arizona
Alt Dashboard V6.53 and AQI Problem
« on: April 27, 2012, 08:05:32 PM »
I've been hard at it over the last week, working on oops's, issues and routines as I slowly implement Alt Dashboard 6 on my test system.

Most of the issues thus far have been fixed, or id'd in the to-be-fixed list, with one exeption - AQI.

I've looked at quite a number of Alt Dash sites, and see that the AQI is working on them, so I know it's possible.

I'm limited in my city /county because they no longer post actual readings, only the day1, day2 forecasts.   So my approach has been to use the vanilla code in alt-dashboard and in get-aqi-rss.php, which seems to have 9, or Baltimore as it's default. No changes.  I've looked at the gov. site, thru the url used, and data is being posted, so it should be there.   I've got the switch  to true to useAQI.  But... It's not working / processing properly, as my AQI display  does show 'Data not Available' and the 'no update received' image.  I'd hoped to get it working, before I started figuring out of I can use 'forecast' data in lieu of the 'actuals'.

I'm wondering if I have the most current get-aqi-rss.php file.  The author is no longer supporting scripts, so I've no way of telling.

I'm hoping some knowledgable helper can take a look and perhaps id the problem, or problems for me.  I am NOT a coder, and it's kinda hard to find the details of 'wrongness' with my skill set.

Have attached  the get-aqi-rss.php I currently have, plus a snippet of the AQI processing from within Alt Dashboard 6.

Thanks

Ken
test.azkiwis.net

Offline Silversword

  • --Stan Y.
  • Forecaster
  • *****
  • Posts: 560
    • Up Country Maui Weather
Re: Alt Dashboard V6.53 and AQI Problem
« Reply #1 on: April 28, 2012, 04:00:53 PM »
Hi Ken,

Where are you located?  If you are in Arizona you might want to take a look at this site and select the location that is nearest to you at this url http://airnow.gov/index.cfm?action=airnow.local_state&stateid=3&tab=0 for starters.  Look that the Current tab and see if that is what you are looking for. Then you will be able to see the code that you might want to select. Put this url in this area of your get-aqi.php file:

<?php

$url = "http://airnow.gov/index.cfm?action=airnow.local_city&cityid=45";
 
$html = implode(' ', file($url));
   
//Start Searching for the Current AQI Numerical Value
preg_match('|<td class="AQDataLg".* |Uis', $html, $air_quality);

This is where mine is set as...Use it as an example.

Then go to this url http://feeds.enviroflash.info/ chose your state. Then use this info in this area of your wxaqirss.php file.

//ini_set('display_errors', 1);
//error_reporting(E_ALL);

//Select your URLs at the following location http://feeds.enviroflash.info/
//Forecast URL
$urlForecast = "http://feeds.enviroflash.info/rss/forecast/483.xml";  //Kihei, HI
//Action Day URL
$urlActionDay = "http://feeds.enviroflash.info/rss/actionDay/483.xml";  //Kihei, HI
//Current Air Quality URL
$urlRealtime = "http://feeds.enviroflash.info/rss/realtime/483.xml";  //Kihei, HI
// Your City, State Name
$cityname= "Maui, Hawaii";
// Images Directory (may not be needed, remove the // if needed)
// $imagesDir = "./ajax-images";

// Images can be found here:  http://www.airnow.gov (find your city)

Again this is what I have for my settings.

You might want to also check your wxaqi.php and get-aqi-rss files to see if those are in order.

Hope that this will be a start for my suggestions that might help you with this area of the altdashboard.

It is kinda complicated but it is a learning process that I went through a couple of years ago and my memory is not as good back then.

--Stan Y.
   Maui, Hawaii

Stan Y. - KH6HHG - Maui, Hawaii
 --- Blitzortung ID: 993
 --- FlightRadar24 ID: F-PHOG1

WDL 6.05
MS Windows 7 Pro
Dell Optiplex GX280-Intel Pentium 4 CPU 3.00GHz, 4 GB RAM
Davis Vantage Pro 2+ Wireless
Webcam: Axis 211

Offline azkiwi

  • Senior Contributor
  • ****
  • Posts: 160
    • Maricopa, Sonoran Desert, Arizona
Re: Alt Dashboard V6.53 and AQI Problem
« Reply #2 on: April 29, 2012, 10:13:33 AM »
Thank you Stan, for the advice and the code snippets.   When I'm home and at the test system I'll pull them off and modify them to my city code etc.

Interestingly, you referred to the wxaqi.php, for me it's wxaqirss.php - and it works.  I use the link in my air quality page under forecasts.  I have commented out the get actuals - no actuals are posted - and I have no problem in displaying the forecasts for day1, day2.  It's just in the get-aqi-rss.php include in the dashboard6 that's seemingly not working.  I changed the city code to 9, Baltimore (Michael's home town) and I know that it does show actuals and forecasts on the airnow /enviroflash sites, but no joy, so I know it's either obsolete code or I've got a parm or more set wrong.

I'm going to move your info to the test machine, and print off everything I can find for aqi and go thru line by line and see if anything jumps out at me.   plus I'm going to make a few 'test' routines and play with them, so I don't make my 'originals' any worse than they are.

Again, I appreciate the input and the code.

Ken