Apixu.com worldwide weather data with outside lux. No PWS or server setup

could do that … but would need user input from a range of locations to get to the right scale. :slight_smile:

the polling/refresh is probably happening correctly unless there are errors in the log. think apixu only updates their data hourly … at least for the free plan.

Gotcha! So polling every 30 minutes really doesn't do anything eh?

it does … not knowing exactly when apixu updates their data for your location … it keeps the wait down to a max of 29 minutes instead of a max 59 minutes.

with that in mind … polling every 5 mins is fine so long as you are using that api key for only one location.

1 Like

Thank you for putting this together. Just want to share my current weather dashboard and the code I used to create it. I just put this together. Need to create some html to go full screen when clicking the on the radar map.

    in Metadata
    attribute "mytile", "string"

    at the end of poll()
def mytext =obs.location.name + ', ' + obs.location.region
mytext+='<br>' + '<img src=https:' + obs.current.condition.icon + '>'
if (isFahrenheit)
	{
	mytext+='<br>' + "${Math.round(obs.current.temp_f)}" + '&deg;F ' + obs.current.humidity + '%'
	mytext+='<br>' + localSunrise + ' - ' + localSunset
	mytext+='<br>' + obs.current.wind_dir + ' ' + "${Math.round(obs.current.wind_mph)}" +'mph'
	}
else
	{
	mytext+='<br>' + obs.current.temp_c + '&deg;C ' + obs.current.humidity + '%'
	mytext+='<br>' + localSunrise + ' - ' + localSunset
	mytext+='<br>' + obs.current.wind_dir + ' ' + obs.current.wind_kph +'kph'
	}
sendEvent(name: "mytile", value: mytext, isStateChange: true, displayed: true)

The USA radar map is from http://www.intellicast.com/

  • radar --> current loops
  • select your location --> play animation
  • copy the image location of the animated map then use in an image tile

4 Likes

Thanks for all ot the work on this--just tried it and it seems to work well. One huge plus for me over OpenWeatherMap is that it actually reports weather for my town whereas OWM was giving me weather conditions for a city located over 15 miles away.

One question though; is there a way get notifications based on a certain temp threshold such as "Notify me if temp drops below 32 degrees"?

1 Like

Updated mytile, resized the image to get back some space, added current forecast text. You will have to adjust the dashboard's font size, or set the tile size, to fit the text into the tile.

Update: there appears to be an issue with the tile's font-size not following the page setting. When the page is set to fontsize 12 generates the following html. At fontsize 8 it is 24px.

<span class="attribute resize mytile mid" style="font-size: 36px;">
Warren, New Jersey<br>37°F 64%<br>06:55 <img style="height:1em" src="https://cdn.apixu.com/weather/64x64/day/122.png"> 16:34<br>NE 7mph<br>Moderate or heavy snow showers
</span>v

def mytext =obs.location.name + ', ' + obs.location.region
if (isFahrenheit)
	{
	mytext+='<br>' + "${Math.round(obs.current.temp_f)}" + '&deg;F ' + obs.current.humidity + '%'
	mytext+='<br>' + localSunrise + ' <img style="height:1em" src=https:' + obs.current.condition.icon + '> ' + localSunset
	mytext+='<br>' + obs.current.wind_dir + ' ' + "${Math.round(obs.current.wind_mph)}" +'mph'
	mytext+='<br>' + obs.forecast.forecastday[0].day.condition.text
	}
else
	{
	mytext+='<br>' + obs.current.temp_c + '&deg;C ' + obs.current.humidity + '%'
	mytext+='<br>' + localSunrise + ' <img style="height:1em" src=https:' + obs.current.condition.icon + '> ' + localSunset
	mytext+='<br>' + obs.current.wind_dir + ' ' + obs.current.wind_kph +'kph'
	mytext+='<br>' + obs.forecast.forecastday[0].day.condition.text
	}
sendEvent(name: "mytile", value: mytext, isStateChange: true, displayed: true)

image

1 Like

Message Central will send or speak a message triggered by temperature threshold.

Andy

use WATO? :slight_smile:

you can even use rises and drops to get notification if there is sudden rise or drop of X degrees as well as above or below a temperature value.

@cobra and @bangali: thanks--I'll give these a try.

1 Like

This is a really nice driver and looks nice. One thing that I was wondering is if it would be possible to get wind speed in meters per second (m/s) instead of kph ? It seems ApiXU does not provide this by default, so it would have to be calculated.

I believe that what is needed is to divide kph by 3.6.

1 Like

thank you. the wind is also published in mph … does that not work?

image

Not really. Meters per second is the norm here in my country and it is difficult to do the math every time as the factor is /3.6 from kph and god knows what from mph :wink:

This is how it would look like for 5.6 m/s. I have also run into this from other weatherstation sites. I think that most of Europe uses m/s for wind speed.

image

I want make all the data in the original https get available to another app, so I placed the entire obs data into attribute "rawdata". That works, but I get errors attempting to use the rawdata obs in the other app. Any ideas?

In Apixu
sendEvent(name: "rawdata", value: obs, isStateChange: true, displayed: true)

In the other app
def obs = [:]
then this fails
obs << apixuDTH.currentValue('rawdata')

Truncated screen shot of rawdata in device api

I like what you are doing here, but I can´t find any reference to MyTile. How do I create such a thing ?

EDIT: Ok, I think I understand how to enable it within the driver itself, but not sure how to pull out the mytile in the dashboard.

I pasted your example into the driver and the mytile code in line 178. However, I can´t see the attribute mytile.

Can you tell me where I am going wrong ?

got it. so 9.0 kph is 2.5 ms?

Yes, exactly. If my information about the conversion is correct :slight_smile:

if you update to the latest from github it should be there now.

did you define an attribute named rawdata up top?

fails how? nothing is returned or error in the logs?

Yes ! I can now see a reasonable Metres per second number and the tile from @arnb is now visible. :grin:

Superb assistance and much appreciated. I am just learning the ropes around here and hope to be up and running soon. Trying to make all the pieces fit in the puzzle.

EDIT: I do see the mytile, but it is no longer in the code (obviously, since I copied 4.0.3 from Github), so how can this be ? Is this residual and left over from the previous code ? There is no attribute: mytile in the current 4.0.3 that I copied. Strange ?

1 Like

refreshed the dashboard?