It is currently September 25th, 2020, 9:53 am

Alert Ready / EAS Implementation?

General topics related to Rainmeter.
JasperHF
Posts: 5
Joined: May 29th, 2020, 1:53 am

Alert Ready / EAS Implementation?

Post by JasperHF »

Hello, I was wondering if there could be a widget made that can detect if an alert was made in your area via the Alert Ready system (Canada), or EAS System (US) and display the warning type, and flash to get your attention. I have a weather monitoring setup using an old desktop, and rainmeter. If my phone fails to alert me, then it would be nice to have my monitor in my livingroom alert me to any emergency alerts sent by Alert Ready. Then the only way to silence it is to manually click it, and hit "Understood". It doesn't have to play the tone, but it should have a red flashing alert box to draw attention, and then show you the type of alert for your area, and then stop flashing when you've clicked "understood", unless an update to the alert was sent out.

Sorry for long msg, and sorry if I'm in the wrong area. Stay safe out there!

-Jasper
User avatar
Yincognito
Posts: 2612
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Alert Ready / EAS Implementation?

Post by Yincognito »

JasperHF wrote: May 29th, 2020, 2:01 am Hello, I was wondering if there could be a widget made that can detect if an alert was made in your area via the Alert Ready system (Canada), or EAS System (US) and display the warning type, and flash to get your attention. I have a weather monitoring setup using an old desktop, and rainmeter. If my phone fails to alert me, then it would be nice to have my monitor in my livingroom alert me to any emergency alerts sent by Alert Ready. Then the only way to silence it is to manually click it, and hit "Understood". It doesn't have to play the tone, but it should have a red flashing alert box to draw attention, and then show you the type of alert for your area, and then stop flashing when you've clicked "understood", unless an update to the alert was sent out.

Sorry for long msg, and sorry if I'm in the wrong area. Stay safe out there!

-Jasper
Well, since no one answered your post till now (and I was browsing other sections of the forum in the meantime), I will.

First of all, there is no way, as far as I know, to make alerts sent to phones or other non-computer devices appear or be received in a Rainmeter skin.

That being said, upon visiting https://www.alertready.ca/, it seems the alerts there are received from The Weather Network, or rather its Alert section. After exploring further, it appears that the "critical" alerts for a specific location can be found at URL addresses that look like https://www.theweathernetwork.com/ca/alerts/high-alert/<district>/<city> - for example the critical alerts for Ottawa are displayed at https://www.theweathernetwork.com/ca/alerts/high-alert/ontario/ottawa.

So, since now we have a webpage where we can gather data from (something that Rainmeter can do), the issue just became "solvable". One just has to investigate the page source of that URL address in the browser, design a regex that parses the page source and "extracts" the info regarding the alerts, in order to display them in a skin, using whatever bells and whistles he wants to use.
JasperHF
Posts: 5
Joined: May 29th, 2020, 1:53 am

Re: Alert Ready / EAS Implementation?

Post by JasperHF »

Thank you for replying! I'm not sure how to code, but I'm thinking of learning to at some point. I have my desktop in the livingroom 24/7, and I'm hoping I (or if anyone else wants to) make an app for rainmeter, it could add to the system display that everyone can see every morning, incase they need to alter travel plans

Have a great day, and stay safe
User avatar
Yincognito
Posts: 2612
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Alert Ready / EAS Implementation?

Post by Yincognito »

JasperHF wrote: July 11th, 2020, 5:36 am Thank you for replying! I'm not sure how to code, but I'm thinking of learning to at some point. I have my desktop in the livingroom 24/7, and I'm hoping I (or if anyone else wants to) make an app for rainmeter, it could add to the system display that everyone can see every morning, incase they need to alter travel plans

Have a great day, and stay safe
Skin requests are not what this forum is about, but I will post a basic sample skin doing some of what you want today. Then, it'll depend on you to further polish it and add more stuff - and you can obviously ask for help on that here on the forum. ;-)
JasperHF
Posts: 5
Joined: May 29th, 2020, 1:53 am

Re: Alert Ready / EAS Implementation?

Post by JasperHF »

Thank you so much!! I'll be on later today. Have a great day/night!
User avatar
Yincognito
Posts: 2612
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Alert Ready / EAS Implementation?

Post by Yincognito »

JasperHF wrote: May 29th, 2020, 2:01 am Hello, I was wondering if there could be a widget made that can detect if an alert was made in your area via the Alert Ready system (Canada), or EAS System (US) and display the warning type, and flash to get your attention. I have a weather monitoring setup using an old desktop, and rainmeter. If my phone fails to alert me, then it would be nice to have my monitor in my livingroom alert me to any emergency alerts sent by Alert Ready. Then the only way to silence it is to manually click it, and hit "Understood". It doesn't have to play the tone, but it should have a red flashing alert box to draw attention, and then show you the type of alert for your area, and then stop flashing when you've clicked "understood", unless an update to the alert was sent out.

Sorry for long msg, and sorry if I'm in the wrong area. Stay safe out there!

-Jasper
Ok, here is a 95% complete "prototype" of what I think you want:

Code: Select all

[Variables]
District=Ontario
City=Ottawa
Cleaner="(?:^\s+|\s+$)":"","(?:^[^_].*|.*[^_]$)":"","(?:^_|_$)":"","(?:^\\\d+|\\\d+$)":""
Alert=<div class="individual.*">.*<\/div>\s*<\/div>\s*<\/div>
Title=<h3 class="title">.*<span>(.*)<\/span>.*<\/h3>
Subtitle=<span class="sub-title">(.*)<\/span>
SummaryTitle=<strong class="sub-title">(.*)<\/strong>
Summary=<p(?: style=".*"|)>(.*)<\/p>
Index=0
IndexCount=5
Width=220
HeightTop=30
HeightBottom=350
StrokeColor=255,255,0,255
Color0=255,0,0,255
Color1=255,255,255,255
Color2=32,0,0,255
Color3=160,160,160,255
UnderstoodLeaveColor=0,64,128,255
UnderstoodOverColor=0,96,160,255
UnderstoodPushColor=0,32,96,255
UnderstoodColor=#UnderstoodLeaveColor#
HPadding=5
VPadding=2
CheckedUnderstood=0

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

---Measures---

[MeasureFillColor]
Measure=Calc
Formula=(#CheckedUnderstood#=0?(Abs(1-MeasureFillColor)):2)
RegExpSubstitute=1
Substitute="^0$":"#Color1#","^1$":"#Color0#","^2$":"#Color2#"
DynamicVariables=1

[MeasureFontColor]
Measure=Calc
Formula=(#CheckedUnderstood#=0?(Abs(1-MeasureFontColor)):2)
RegExpSubstitute=1
Substitute="^0$":"#Color0#","^1$":"#Color1#","^2$":"#Color3#"
DynamicVariables=1

[MeasureWeatherAlerts]
Measure=WebParser
URL="https://www.theweathernetwork.com/ca/alerts/high-alert/#District#/#City#"
RegExp=(?siU)<div class="column-container">(.*)<\/div>\s*<div class="column-container" id="alert-columns">
UpdateRate=600
FinishAction=[!UpdateMeasureGroup "WeatherAlertsGroup"][!UpdateMeter *][!Redraw]

[MeasureWeatherAlerts_Main]
Group=WeatherAlertsGroup
Measure=WebParser
URL=[MeasureWeatherAlerts]
StringIndex=1
UpdateDivider=-1

[MeasureWeatherAlerts_Main_Title]
Group=WeatherAlertsGroup
Measure=WebParser
URL=[MeasureWeatherAlerts]
StringIndex=1
RegExp=(?siU)<h2>.*<span>(.*)<\/span>.*<\/h2>
StringIndex2=1
UpdateDivider=-1

[MeasureWeatherAlert]
Group=WeatherAlertsGroup | WeatherAlertGroup
Measure=String
String=[MeasureWeatherAlerts_Main]
UpdateDivider=-1
RegExpSubstitute=1
Substitute='(?siU)^(?:.*#Alert#){#Index#}+.*(#Alert#).*$':"_\1_","#Cleaner#"
DynamicVariables=1

[MeasureWeatherAlert_Title]
Group=WeatherAlertsGroup | WeatherAlertGroup
Measure=String
String=[MeasureWeatherAlert]
UpdateDivider=-1
RegExpSubstitute=1
Substitute='(?siU)^.*#Title#.*$':"_\1_","#Cleaner#","(?:^$|^0$)":"No Alert"
DynamicVariables=1

[MeasureWeatherAlert_Subtitle]
Group=WeatherAlertsGroup | WeatherAlertGroup
Measure=String
String=[MeasureWeatherAlert]
UpdateDivider=-1
RegExpSubstitute=1
Substitute='(?siU)^.*#Subtitle#.*$':"_\1_","#Cleaner#","(?:^$|^0$)":"Never Issued"
DynamicVariables=1

[MeasureWeatherAlert_SummaryTitle]
Group=WeatherAlertsGroup | WeatherAlertGroup
Measure=String
String=[MeasureWeatherAlert]
UpdateDivider=-1
RegExpSubstitute=1
Substitute='(?siU)^.*#SummaryTitle#.*$':"_\1_","#Cleaner#","(?:^$|^0$)":"Summary"
DynamicVariables=1

[MeasureWeatherAlert_Summary]
Group=WeatherAlertsGroup | WeatherAlertGroup
Measure=String
String=[MeasureWeatherAlert]
UpdateDivider=-1
RegExpSubstitute=1
Substitute='(?siU)^.*#Summary#.*$':"_\1_","#Cleaner#","(?:<br(?:\s*\/|)>|\r|\n|\R)":"","(?:  +|\t+)":" ","\.(?!(?: |$))":". ","(?:^$|^0$)":"No Summary"
DynamicVariables=1

[MeasureFriendlyIndex]
Group=WeatherAlertsGroup | WeatherAlertGroup
Measure=Calc
Formula=(#Index#+1)
UpdateDivider=-1
DynamicVariables=1

---Styles---

[BaseStyle]
FontFace=Tahoma
FontColor=#Color1#
Padding=#HPadding#,#VPadding#,#HPadding#,#VPadding#
FontSize=8
StringEffect=Shadow
FontEffectColor=0,0,0,255
AntiAlias=1
Clipstring=2
Y=0R
W=(#Width#-#HPadding#*2)

---Meters---

[MeterBackgroundTop]
Group=TopGroup
Meter=Shape
AntiAlias=1
Shape=Rectangle 0,0,#Width#,#HeightTop#,12 | StrokeWidth 1 | Stroke Color #StrokeColor# | Fill Color [MeasureFillColor]
LeftMouseUpAction=[!ToggleMeterGroup "BottomGroup"][!Redraw]
DynamicVariables=1

[MeterWeatherAlertsMainTitle]
Group=TopGroup
Meter=STRING
MeterStyle=BaseStyle
FontSize=14
FontColor=[MeasureFontColor]
FontWeight=700
StringAlign=Center
X=(#Width#/2)
Y=0r
MeasureName=MeasureWeatherAlerts_Main_Title
Text="%1"
MouseScrollUpAction=[!SetVariable Index ((#IndexCount#+#Index#-1)%#IndexCount#)][!UpdateMeasureGroup "WeatherAlertGroup"][!UpdateMeter *][!Redraw]
MouseScrollDownAction=[!SetVariable Index ((#IndexCount#+#Index#+1)%#IndexCount#)][!UpdateMeasureGroup "WeatherAlertGroup"][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeterBackgroundBottom]
Group=BottomGroup
Meter=Shape
AntiAlias=1
Y=(#HeightTop#+#VPadding#*2)
Shape=Rectangle 0,0,#Width#,#HeightBottom#,12 | StrokeWidth 1 | Stroke Color #StrokeColor# | Fill Color 0,64,0,255
DynamicVariables=1

[MeterWeatherAlert_Title]
Group=BottomGroup
Meter=STRING
MeterStyle=BaseStyle
FontSize=9
FontWeight=700
Y=(#VPadding#*2)r
MeasureName=MeasureWeatherAlert_Title
MeasureName2=MeasureFriendlyIndex
Text="%2. %1"
DynamicVariables=1

[MeterWeatherAlert_Subtitle]
Group=BottomGroup
Meter=STRING
MeterStyle=BaseStyle
Y=(-#VPadding#*2)R
MeasureName=MeasureWeatherAlert_Subtitle
Text="%1"
DynamicVariables=1

[MeterWeatherAlert_SummaryTitle]
Group=BottomGroup
Meter=STRING
MeterStyle=BaseStyle
FontWeight=700
Y=(#VPadding#*2)R
MeasureName=MeasureWeatherAlert_SummaryTitle
Text="%1"
DynamicVariables=1

[MeterWeatherAlert_Summary]
Group=BottomGroup
Meter=STRING
MeterStyle=BaseStyle
H=250
MeasureName=MeasureWeatherAlert_Summary
Text="%1"
DynamicVariables=1

[MeterUnderstood]
Group=BottomGroup
Meter=Shape
AntiAlias=1
X=((#Width#-#Width#/2)/2)
Y=(#HeightTop#+#VPadding#*2+#HeightBottom#-30)
Shape=Rectangle 0,0,(#Width#/2),25,12 | StrokeWidth 1 | Stroke Color #StrokeColor# | Fill Color #UnderstoodColor#
MouseOverAction=[!SetVariable UnderstoodColor #UnderstoodOverColor#][!UpdateMeter MeterUnderstood][!Redraw]
MouseLeaveAction=[!SetVariable UnderstoodColor #UnderstoodLeaveColor#][!UpdateMeter MeterUnderstood][!Redraw]
LeftMouseDownAction=[!SetVariable UnderstoodColor #UnderstoodPushColor#][!UpdateMeter MeterUnderstood][!Redraw]
LeftMouseUpAction=[!SetVariable UnderstoodColor #UnderstoodOverColor#][!SetVariable CheckedUnderstood 1][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeterUnderstoodTitle]
Group=BottomGroup
Meter=STRING
MeterStyle=BaseStyle
FontSize=9
Y=(#VPadding#)r
X=(#Width#/2)
StringAlign=Center
Text="Understood"
DynamicVariables=1
Most of the things are adjustable from the [Variables] section, so you can already play with them and see if you like it. I set a "maximum" of 5 alerts that you can view by scrolling over the top rounded rectangle, but as pretty much everywhere in the skin, the number is adjustable and only slight modifications are required to make it work for the new value(s). It hides the bottom rounded rectangle when clicking on the top one and it stops toggling colors if you push the "Understood" button, as envisioned. For now (and this is the 5% left to do) the understood state and the details on the current alerts are not stored in order to be "persistent" if you refresh the skin, and the skin doesn't react to an alert update, that'll be a job for later tonight or tomorrow, as I'm in the mood for some relax time at the moment. If you're impacient, you can ask on the forum how to do it, but generally you'd need an .inc file to be @included in the skin and to which the current values of CheckedUnderstood and possibly some of the fields that can further be compared against the current values will have to be written.

So, for now have fun playing with it - I'll finish the job later on tonight or tomorrow.
User avatar
Yincognito
Posts: 2612
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Alert Ready / EAS Implementation?

Post by Yincognito »

JasperHF wrote: May 29th, 2020, 2:01 am Hello, I was wondering if there could be a widget made that can detect if an alert was made in your area via the Alert Ready system (Canada), or EAS System (US) and display the warning type, and flash to get your attention. I have a weather monitoring setup using an old desktop, and rainmeter. If my phone fails to alert me, then it would be nice to have my monitor in my livingroom alert me to any emergency alerts sent by Alert Ready. Then the only way to silence it is to manually click it, and hit "Understood". It doesn't have to play the tone, but it should have a red flashing alert box to draw attention, and then show you the type of alert for your area, and then stop flashing when you've clicked "understood", unless an update to the alert was sent out.

Sorry for long msg, and sorry if I'm in the wrong area. Stay safe out there!

-Jasper
And here is the updated skin, having the "understood status" persistent on skin refresh / measure updates, as well as reacting to whatever changes occur in the extracted data (not just alert updates, but also changing locations and possible changes in the webpage format):
WeatherAlerts_1.0.0.rmskin
Now, if you want other modifications, you'd probably have to start a specific thread in the Help: Rainmeter Skins section and ask for others' assistance as well. By the way, you can check the alerts for Canada at https://www.theweathernetwork.com/ca/alerts. :D
You do not have the required permissions to view the files attached to this post.
JasperHF
Posts: 5
Joined: May 29th, 2020, 1:53 am

Re: Alert Ready / EAS Implementation?

Post by JasperHF »

Thank you so so much! I will be installing this shortly
Have an amazing day!
User avatar
Yincognito
Posts: 2612
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Alert Ready / EAS Implementation?

Post by Yincognito »

JasperHF wrote: July 12th, 2020, 6:55 pm Thank you so so much! I will be installing this shortly
Have an amazing day!
You're welcome - have fun with it! ;-)
JasperHF
Posts: 5
Joined: May 29th, 2020, 1:53 am

Re: Alert Ready / EAS Implementation?

Post by JasperHF »

Update: Heat Warning was issued very recently for the area, and the widget worked as intended! Works well!