UV Monitor, app to alert about sun danger


I wanted to share the app that I wrote. It’s kind of handy in the summer. It will alert you if UV index is dangerously high.

Feel free to modify and share the code.



I made minor changes to validate UV value, since sometimes the WU returns -1 for UV.

I installed this yesterday but I’m getting seemingly random alerts. I haven’t looked at the code but I assume no configuration is needed?

Earlier today it was alerting to UV 5, then 4, then around 9 an hour later.

Incidentally, it’s been cloudy here all day so I’m not sure the UV index is that high.

That’s right, no configuration is needed.

The app checks UV report of Weather Underground based on your home’s location every 15 minutes. If UV reading is grater than 5 (high), it will alert you. You will not get any alerts until the value changes. Once the UV rating gets below 5, you will not get any more notifications until it gets above 5 again.

If you had broken clouds all day, it’s possible that the UV rating greatly fluctuated throughout the day.

I compared readings from Weather Underground’s website and ones reported by my app. They seem to match.

I also subscribed to UV alerts from IFTTT, but Yahoo weather reports rather different UV ratings. Maybe it’s because IFTTT uses city’s official report. Weather Underground has a weather station right next to my house, so their weather report is always slightly different than city center’s.


I’ll look at the UV report from WU and compare.

Check app properties in the IDE. It saves last reported value.

Let me know if you find something interesting.

1 Like

Nothing outrageous… it seems to match the reports from WU, so maybe I’m the one underestimating the UV value :smile:

I did notice a typo where Extreme was incorrectly spelled Extreame though but that’s minor :smile:

The one thing that I was going to edit and figured I’d point out as a request instead is to have a customizable schedule, rather than a preset 60 minute interval for “announcements” of the UV index. That way you could set it as every 3-4 hours or once a day or something to that effect.

I updated the app to take settings for refresh interval, minimum UV threshold and change quantity.

This app even scores some WAF points from my wife :smile: who has fare skin. She is warming up to seeing notifications from ST.

I also created a UV Sensor device type that might be useful on a dashboard. It should be used with something like Pollster to refresh it periodically.

1 Like