Aurora integration

Hi,
I slept through the recent aurora spectacle, so thought I would install the integration into HA to get an alert next time.

I live 60ºN (no real darkness in mid summer) where it is also frequently very cloudy, so I wanted to update the aurora alert accounting for daylight and cloud cover.

I found this formula to factor in the cloud coverage:

And then the sun should be 6º below the horizon

Combined

Putting this into a template I get the following:

{% set auroraChance = states('sensor.aurora_60_1')|int/100 %}
{% set cloudCoverage = (states('sensor.openweathermap_cloud_coverage')|int/100) %}
{% set skyClarity = 1-(states('sensor.openweathermap_cloud_coverage')|int/100) %}
{% set darkness = max(0,min(1,1-(state_attr('sun.sun','elevation')+6)/6)) %}

Aurora Chance: {{ (auroraChance * 100)|round(0) }}%
Cloud Coverage: {{ (cloudCoverage * 100)|round(0)}}%
Sky Clarity: {{ (skyClarity*100)|round(0) }}%
Darkness: {{ (darkness*100)|round(0) }}%
Chance = {{ (auroraChance * skyClarity * darkness * 100)|round(0) }}%

The output is

Aurora Chance: 0%
Cloud Coverage: 44%
Sky Clarity: 56%
Darkness: 0%
Chance = 0%

My intent is to set up a notification when it goes above a certain threshold - perhaps even wake me up if the value is significantly high.

How to validate this though?
Is this the right approach - does the formula make sense to you?

Steve

I like it. I even thought about doing something very similar, but I got lazy. My thought was, I don’t care if it notifies me during the day. Plus, that would give me time to plan for the evening. I don’t trust the cloud cover values in my forecast. In fact the first and only time I’ve seen aurora was this past storm, when the skies were supposed to be mostly cloudy. And they were, for a lot of the area. But not near me. So I just went with notifying me when it hit 75% probability of aurora, day or night, cloudy or not.

If you are interested, here is my mushroom template card to show the Aurora 30 minutes forecast taking the current sky conditions into account:

type: custom:mushroom-template-card
primary: >-
  {% set auroraChance = states('sensor.aurora_60_1')|int/100 %} {% set
  cloudCoverage = (states('sensor.openweathermap_cloud_coverage')|int/100) %} {%
  set skyClarity = 1-(states('sensor.openweathermap_cloud_coverage')|int/100) %}
  {% set darkness = max(0,min(1,1-(state_attr('sun.sun','elevation')+6)/6)) %}
  Aurora Chance = {{ (auroraChance * skyClarity * darkness * 100)|round(0) }}%,
  Base Chance = {{ (auroraChance * 100)|round(0) }}%
secondary: >-
  {% set auroraChance = states('sensor.aurora_60_1')|int/100 %} {% set
  cloudCoverage = (states('sensor.openweathermap_cloud_coverage')|int/100) %} {%
  set skyClarity = 1-(states('sensor.openweathermap_cloud_coverage')|int/100) %}
  {% set darkness = max(0,min(1,1-(state_attr('sun.sun','elevation')+6)/6)) %}
  Cloud Coverage: {{ (cloudCoverage * 100)|round(0)}}%, Sky Clarity: {{
  (skyClarity*100)|round(0) }}%, Darkness: {{ (darkness*100)|round(0) }}%
icon: mdi:wave-arrow-up
icon_color: pink
tap_action:
  action: url
  url_path: https://www.swpc.noaa.gov/products/aurora-30-minute-forecast

How can I turn an e.g. 70% chance into an Apple Watch alert and a 95% chance into an Alert that overrides do-not disturb?

Steve