My little MinuteCast®

Hi People started to work on my own ideas for a custom weather widget and i really liked the weather alerts from accuweather so i made a small shell script that can be used to show alerts and i thought i share it with you guys.

SET_AGENT="Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0"

weather_alert () {

curl -A "$SET_AGENT" -s $SET_URL |\
         perl -wne 'print if /<div class="mc-summary/ .. /<\/div>/' |\
         perl -wne 'print if /<p>/ .. /<\/p>/' |\
         sed 's/<\/p>//' | sed 's/<p>//' | grep -oE "[A-Z].*"


looks like this when you add it as a command line sensor


hope that someone will get some usage outta this :slight_smile:

there is how it looks under lovelace



Thanks for sharing :slight_smile:

1 Like

updated script above so it works better


Thanks for posting this.

1 Like

will update the script as time goes on with missing weather conditions

a little update again to make it all easier for me to maintain :slight_smile:

an update again no more regexp, using perl to just get the status so it catches everything now from the statusline :slight_smile:


This is great! I’ve been looking for a way to create a lightning alert (being in florida) that I could use to sound an alarm or TTS notification to get out of the pool or something… This seems like a great step in that direction!

1 Like


sorry for the noob question.

I’ve created a in my HA default folder and then the command line sensor below:

  - platform: command_line
    name: Allerta Meteo
    command: 'bash /volume1/docker/homeassistant/'

But I can’t see nothing on reboot. Where is the error?

Thank you in advance!

any errors in the log ?


Just a generic error:

Mon Jul 16 2018 08:25:56 GMT+0200 (Ora legale dell’Europa centrale)

Command failed:

so make it executeable chmod +x /volume1/docker/homeassistant/ and make sure that ha has access to the file and it should work.

1 Like

It worked!

But now it appears as a round. How can I show it as a box and how can I set an automation an alert when status change?

all that is simple and its all in the docs :wink:

1 Like

Ok next step.

Did anyone knows how to setup an automation like:

If status contains rain then notify on telegram.

For me it doesn’t work.
-create +x)
platform: command_line
name: Meteo
command: ‘sh /usr/share/hassio/homeassistant/scripts/’

get error: Command failed: sh /usr/share/hassio/homeassistant/scripts/

-with terminal $ sh /usr/share/hassio/homeassistant/scripts/
no rain for 120min

Why not just use the scrape sensor?

1 Like

select: ??? for scrape sensor

The value for “select” will be the CSS selector you want to grab from the page.

For the Accuweather Minutecast page, the select value would be “.mc-summary p” - meaning the text inside the <p> tag that is inside the tag with the “mc-summary” class.

nop…it doesn’t work…