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

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?

Probably not, but also not knowing how to do that, other than CTRL+F5 or something like that ? At least that is what I did, along with CTRL+R in chrome and I still have the mytile. Actually, I would like to have something like the mytile, but I will just have to put the code back in. It is just strange that the data seems to be stuck from the previous driver code.

To test this, I just removed the tile and tried to add it back and there it was again :slight_smile:

I feel there is a lot to learn in with regards to Hubitat. At least for me, coming from Vera. There may be a slightly lower learning curve for ST people ?

ok then the mytile attribtue is just getting left over from the previous version.

at least you found the right hub … this time. true. :slight_smile:

1 Like

Just wanted to say thank you for the driver.

2 Likes

you are welcome.

Where can I find the version of the code driver that contains the "mytile" attribute. I went here bangali/apixu-weather.groovy at master · adey/bangali · GitHub and searched the v4.0.3 code for "mytile" and can't find it anywhere.

BTW .. thanks for creating this driver as I'm just getting started automating my home and using Hubitat and really wanted a current weather widget on my dashboard to compare with my Ecobee dashboard widgets.

1 Like