Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Severe weather alert #37

Closed
bigwoof opened this issue Nov 17, 2020 · 29 comments
Closed

Severe weather alert #37

bigwoof opened this issue Nov 17, 2020 · 29 comments
Labels
enhancement New feature or request

Comments

@bigwoof
Copy link

bigwoof commented Nov 17, 2020

Hi @Brenor,
It would great to have some sort of binary sensor for current weather warnings for example in Brisbane the bom product ID is IDQ21035 and the images on the ftp site are
IDQ21047.png
IDQ21041.png

Do you think that there is a way to be able to get this info into the custom component?

I have a simple script that looks for the file on the ftp server and use that to check for warnings but it may be more efficient to pull it all into one component. And it may be helpful to other users too, eg roll up the blinds before a storm.

@bremor
Copy link
Owner

bremor commented Nov 17, 2020

Thanks for the suggestion, https://weather.bom.gov.au/ does have weather warnings so i'm sure I could include this. I will have a crack at this in the next couple of weeks.

@pkeymeruu
Copy link

Thanks for looking into it!

@bigwoof
Copy link
Author

bigwoof commented Nov 27, 2020

I just noticed that some parts of Australia have a storm tracker, probably only around capital cities, for example, SEQ:
http://www.bom.gov.au/qld/forecasts/brisbane-thunderstorms.shtml

not sure if this is helpful information particularly since it is only for a small section of the country.

PS: the 0.9 update looks like it will add a lot of useful features! will update shortly

@bremor
Copy link
Owner

bremor commented Dec 28, 2020

Just documenting my findings here...

https://api.weather.bom.gov.au/v1/locations/r3gx2f/warnings

{"metadata":{"response_timestamp":"2020-12-28T05:02:19Z"},"data":[{"id":"NSW_PW005_IDN21033","type":"severe_thunderstorm_warning","title":"Severe Thunderstorm Warning for Sydney Metropolitan forecast district","short_title":"Severe Thunderstorm Warning","state":"NSW","warning_group_type":"major","issue_time":"2020-12-28T04:55:48Z","expiry_time":"2020-12-28T10:55:48.000Z","phase":"update"},{"id":"NSW_ME017_IDN21035","type":"severe_thunderstorm_warning","title":"Severe Thunderstorm Warning for New South Wales","short_title":"Severe Thunderstorm Warning","state":"NSW","warning_group_type":"major","issue_time":"2020-12-28T04:00:40Z","expiry_time":"2020-12-28T06:00:40.000Z","phase":"update"},{"id":"NSW_MW009_IDN20400","type":"marine_wind_warning","title":"Marine Wind Warning for New South Wales","short_title":"Marine Wind Warning","state":"NSW","warning_group_type":"major","issue_time":"2020-12-27T23:20:40Z","expiry_time":"2020-12-28T07:20:40.000Z","phase":"update"}]}

@devonuto
Copy link

What happened to this? Seems like an excellent inclusion for announcing warnings over smart devices/ shutting roller shutters/ garage doors.

@nixmaster2000
Copy link

Would definitely like to see a severe weather alert entity.

@StormyKnight17
Copy link

StormyKnight17 commented Feb 22, 2022

+1 for a severe weather alert entity

https://api.weather.bom.gov.au/v1/locations/r3gx2f/warnings
r3gx2f is the geohash for Sydney area.
Use http://geohash.co/ to enter gps coordinates & set to 6 digits to find the geohash for your area.

Once you have the response, you then need to be able to scrape the provided warning page to see if your town is mentioned (or a close major town). Some warning areas are quite big so a warning may not apply to you without the town information.

@Makin-Things Makin-Things added the enhancement New feature or request label Apr 6, 2022
@glenn20
Copy link
Contributor

glenn20 commented May 16, 2022

PR #125 collects data from the warnings API and presents it through an optional "warnings" sensor. The state of the sensor is the number of warnings returned and the warnings data is available as a list from the "warnings" attribute on the sensor.

Comments and suggestions are welcome. Is this sufficient to address the request? It is not obvious what more to do with the data at this point.

@Makin-Things
Copy link
Collaborator

@glenn20 thanks for the PR. I merged it and then found a small problem. If I untick observation sensors I get an error.
image
I don't use the observation sensors as I get that data by other means.

@glenn20
Copy link
Contributor

glenn20 commented May 17, 2022

Ah - I thought I tested that - obviously not. Fix coming.

@glenn20
Copy link
Contributor

glenn20 commented May 17, 2022

OK - PR #126 has a bugfix. It appears I must have accidentally deleted a few important lines after testing and before commit. The config dialog for the forecast sensors should work now.

@Makin-Things
Copy link
Collaborator

It has been merged and now works as expected. Now to wait for some warnings to be issued for around here.

@glenn20
Copy link
Contributor

glenn20 commented May 17, 2022

Note that this PR makes the warnings data available (based on geohash location as described above). However, there is currently no logic to filter by phase, warning_group_type or type. That can be done with an automation or template sensors, etc... Some filter logic could be added to the integration, but it would be complicated to construct an intuitive and easy config_flow to do that at config time. Any suggestions welcome.

Data is collected from the BoM warnings API. The state of the sensor is the number of warnings and the warnings data is stored as a list in the "warnings" attribute of the sensor, eg:

sensor.melbourne_forecast_warnings:
- state: 1
- Attributes:
      response_timestamp: 2022-05-16T13:03:47Z
      copyright: This Application Programming Interface (API) is owned by the Bureau of Meteorology (Bureau). 
          You must not use, copy or share this API without express permission from the Bureau. Please contact us for more 
          information. Follow this link http://www.bom.gov.au/inside/contacts.shtml to view our contact details.
      attribution: Data provided by the Australian Bureau of Meteorology
      warnings: 
      - id: VIC_MW005_IDV20600
        type: marine_wind_warning
        title: Marine Wind Warning for Victoria
        short_title: Marine Wind Warning
        state: VIC
        warning_group_type: minor
        issue_time: '2022-05-16T12:00:00Z'
        expiry_time: '2022-05-16T19:00:00Z'
        phase: cancelled
      friendly_name: Melbourne Forecast Warnings

@Makin-Things
Copy link
Collaborator

I have just released 1.1.8b which is a pre-release with this feature included. Would love to get some feedback.
Thanks to @glenn20 for creating the PR for it.

@StormyKnight17
Copy link

StormyKnight17 commented May 17, 2022

Downloading 1.1.8b & will test.
BTW - I was stuck on 1.1.3 as any update failed to download. I had other integrations fail too, but some worked fine. Solution was to turn off IPv6 in the HA settings. It also fixed my Google Calendars which needed to be re authenticated & that would fail too.

@StormyKnight17
Copy link

Ok, warnings seem to work ok. I added Thredbo since they currently have a severe weather warning & I was able to see the warning text. I created a simple custom:mushroom-template-card

{{ state_attr('sensor.thredbo_warnings', 'warnings')[0]["short_title"] }} - {{ state_attr('sensor.thredbo_warnings', 'warnings')[0]["phase"] | upper }}

Output> Severe Weather Warning - NEW

Will have to see the phase options as they appear. I know of new & cancelled so far.

Since a location could have multiple warnings I need to work on stepping through the list provided & filter on what I want to see etc....& create a template sensor to suit.

@nixmaster2000
Copy link

A few active warnings in QLD at the moment to see the output. I've got phases "renewal", "final" and "cancelled" at the moment.

`response_timestamp: '2022-05-17T11:52:37Z'
copyright: >-
This Application Programming Interface (API) is owned by the Bureau of
Meteorology (Bureau). You must not use, copy or share this API without express
permission from the Bureau. Please contact us for more information. Follow
this link http://www.bom.gov.au/inside/contacts.shtml to view our contact
details.
attribution: Data provided by the Australian Bureau of Meteorology
warnings:

  • id: QLD_RC097_IDQ20805
    type: flood_warning
    title: Flood Warning for Brisbane River downstream of Wivenhoe Dam
    short_title: Flood Warning
    state: QLD
    warning_group_type: major
    issue_time: '2022-05-17T06:51:24Z'
    expiry_time: '2022-05-18T09:51:24Z'
    phase: renewal
  • id: QLD_RC099_IDQ20815
    type: flood_warning
    title: Flood Warning for Logan River downstream of Yarrahappini
    short_title: Flood Warning
    state: QLD
    warning_group_type: major
    issue_time: '2022-05-16T23:49:51Z'
    expiry_time: '2022-05-18T02:49:51Z'
    phase: final
  • id: QLD_PW015_IDQ21033
    type: severe_thunderstorm_warning
    title: Severe Thunderstorm Warning for Southeast Coast forecast district
    short_title: Severe Thunderstorm Warning
    state: QLD
    warning_group_type: major
    issue_time: '2022-05-17T08:04:44Z'
    expiry_time: '2022-05-17T14:04:44Z'
    phase: cancelled
    friendly_name: Springfield Warnings`

@StormyKnight17
Copy link

Using Brisbane as the location as it currently has 2 flood alerts....

`response_timestamp: 2022-05-18T00:11:45Z
copyright: This Application Programming Interface (API) is owned by the Bureau of Meteorology (Bureau). You must not use, copy or share this API without express permission from the Bureau. Please contact us for more information. Follow this link http://www.bom.gov.au/inside/contacts.shtml to view our contact details.
attribution: Data provided by the Australian Bureau of Meteorology
warnings:

  • id: QLD_RC097_IDQ20805
    type: flood_warning
    title: Flood Warning for Brisbane River downstream of Wivenhoe Dam
    short_title: Flood Warning
    state: QLD
    warning_group_type: major
    issue_time: '2022-05-17T22:51:08Z'
    expiry_time: '2022-05-19T01:51:08Z'
    phase: renewal
  • id: QLD_RC099_IDQ20815
    type: flood_warning
    title: Flood Warning for Logan River downstream of Yarrahappini
    short_title: Flood Warning
    state: QLD
    warning_group_type: major
    issue_time: '2022-05-16T23:49:51Z'
    expiry_time: '2022-05-18T02:49:51Z'
    phase: final

friendly_name: Brisbane Warnings`

This will list all warnings...

{%- for state in state_attr('sensor.brisbane_warnings', 'warnings') -%}
{{state.phase | upper}} - {{ state.title}}
{% endfor %}

RENEWAL - Flood Warning for Brisbane River downstream of Wivenhoe Dam
FINAL - Flood Warning for Logan River downstream of Yarrahappini

This will list only those that match a particular string in the title in this case. I have chosen "Brisbane" to distinguish the two, but you could search instead for "Thunderstorm" or choose another attribute to match by e.g. warning_group_type.

{% for state in state_attr('sensor.brisbane_warnings', 'warnings') -%}
{%- if 'Brisbane' in state.title %}
{{state.phase | upper}} - {{ state.title}}
{%- endif -%}
{%- endfor -%}

RENEWAL - Flood Warning for Brisbane River downstream of Wivenhoe Dam

Below is a Template Sensor. It shows "No Warning" if there is no matching warnings, & lists the warnings if they match. This one checks for a match of "Thunderstorm" in the title. Make sure you fix the indenting. :)

  • sensor:
    • name: Brisbane_Thunderstorm_Warning
      state: >
      {%- set ns = namespace(result=[]) -%}
      {% for state in state_attr('sensor.brisbane_warnings', 'warnings') -%}
      {%- if 'Thunderstorm' in state.title %}
      {% set ns.result = ns.result + [state.title + "\n"] %}
      {%- endif -%}
      {%- endfor -%}
      {% if ns.result|count == 0 %}
      {{"No Warnings"}}
      {% else %}
      {{ ns.result | list | join() }}
      {% endif %}

@Makin-Things
Copy link
Collaborator

There was an interesting update to the BoM mobile app yesterday. You can now configure push notifications for warnings. I haven't investigated how they are doing this yet and it will be painful to investigate as they use tls and to look at decrypted versions of that requires a rooted phone.
Unfortunately they haven't included the same feature in the desktop version of the app as yet, which is a lot easier to reverse engineer.

@Daneish
Copy link

Daneish commented May 27, 2022

The BOM integration on my HA doesn’t have a reconfigure button, so I added another BOM instance to add the warning sensor. Is that the best way to do it currently?

@Makin-Things
Copy link
Collaborator

That may work, but also might result in multiple sensors. Possibly the best way is to delete all of them and the add the one back you want. As long as you don't change the name everything will continue to work as before

@Daneish
Copy link

Daneish commented May 27, 2022

Thanks!

@Makin-Things
Copy link
Collaborator

@StormyKnight17 @nixmaster2000 any update on how you are using the warning data? I am interested as I am currently doing a major update (rewriting) the BoM Weather Card and I am thinking about how to include an option warning section.

@StormyKnight17
Copy link

I have just created a template sensor that I use to show the current warning if any. I also have a speaker & phone notification triggered as well.

I search for thunderstorm at the moment to limit it from other warnings.

Not many warnings in my area till spring. I did add Brisbane during testing & that worked well as it had flood warnings at the time.

@StormyKnight17
Copy link

StormyKnight17 commented May 29, 2022

So overnight we got two warnings generated,
Sheep Graziers Warning - which is self explanatory
Severe Weather Warning - which I'm not sure is.

The second has further details once you view the warning text on the bureau website.
"for DAMAGING WINDS"

Is there any way to get this data?

Current Warning http://www.bom.gov.au/products/IDN21037.shtml

Cheers

@nixmaster2000
Copy link

@StormyKnight17 @nixmaster2000 any update on how you are using the warning data? I am interested as I am currently doing a major update (rewriting) the BoM Weather Card and I am thinking about how to include an option warning section.

I'm using the template sensors that @StormyKnight17 made above. I'm using one on my weather page listing all the current weather warnings with the template in a markdown card that's visible conditional on the warnings sensor being above 0. And then for the storm warning sensor I have that setup to show on my main dashboard when a storm warning is issued along with phone notifications. Haven't seen that one in action yet.

@Makin-Things
Copy link
Collaborator

Closing now as I don't think there is anything else to do here. Let me know if I am wrong.

@Makin-Things
Copy link
Collaborator

Just a heads up for those interested in warning info. I have added a doc to the repo that has the start of a reference for the BoM api's.

https://github.com/bremor/bureau_of_meteorology/blob/main/api%20doc/API.md

At the bottom I have started collecting values for a couple of fields type and phase. These lists are not complete, so feel free to submit a PR if you observe other values.

@MankiniChykan
Copy link

MankiniChykan commented Mar 25, 2024

Thanks @StormyKnight17 I thought I would place a few examples down on how I used your template examples. It actually took me a number of years to find, as this post does not come up easily in Google Search. This have made this post https://community.home-assistant.io/t/how-to-extract-weather-warning-data-other-text-from-bom-australia-intergration/708467?u=chykan in the home assistant forum to help point to Severe Weather Alert Issue #37

Thanks @StormyKnight17 I thought I would place a few examples down on how I used your template examples. It actually took me a number of years to find, as this post does not come up easily in Google Search. This post has been made to help others point to the closed Severe Weather Alert Issue #37

# Template Weather Warning Phase Text - Act as trigger for lovelace conditional card
Note: to prevent early execution of 'elif' statement:

  • (new and renewal) may need to change to (new and wal). or just (new)
  • (upgrade and downgrade) may need to change to (up and down) or just (grade)
  - platform: template
    sensors:
      weather_warning_phase:
        entity_id: sensor.devonport_warnings
        friendly_name: "Weather Warning Phase"
        value_template: >-
          {%- for state in state_attr('sensor.devonport_warnings', 'warnings') -%}
          {%- if 'new' in state.phase %}
          {{state.phase | upper}}
          {%- elif 'renewal' in state.phase %}
          {{state.phase | upper}}
          {%- elif 'update' in state.phase %}
          {{state.phase | upper}}
          {%- elif 'upgrade' in state.phase %}
          {{state.phase | upper}}
          {%- elif 'downgrade' in state.phase %}
          {{state.phase | upper}}
          {%- elif 'final' in state.phase %}
          {{state.phase | upper}}
          {%- elif 'cancelled' in state.phase %}
          {{state.phase | upper}}
          {%- endif -%}
          {%- endfor -%}

THE FOUR SENSORS BELOW MAKE ONE FULL WEATHER REPORT.

I did have it as one complete code in my configuration.yaml but it kept breaking, I had to divide it up. (obviously too long to parse)

Combining all templates in a Custom: Mushroom Template Card results in the below. This will parse as a complete code.

image|690x72

NOTE: sensor.text_dewpoint_comfort_outside is created using Weather Word Descriptions from Dew Point, Temperature, VOC & Tado (Simple Air Comfort Card)

Template to place in Mushroom Template Card shown above:

  {{-('Currently it is ')-}}
  {{- states('sensor.netatmo_devonport_tas_indoor_outdoor_temperature', with_unit=true) -}}              
  {{-(' but feels ')-}}
  {{- states('sensor.text_dewpoint_comfort_outside', with_unit=true)  | lower-}}
  {{-(' and ')-}}
  {{- states('sensor.devonport_airport_temp_feels_like', with_unit=true)  | lower-}}
  {{-(' outside, the ')-}}
  {{- states('sensor.devonport_now_now_label', with_unit=true) -}}
  {{-(' is ')-}}
  {{- states('sensor.devonport_now_temp_now', with_unit=true) -}}
  {{-(', ')-}}
  {{- states('sensor.devonport_now_later_label', with_unit=true) -}}
  {{-(' will be ')-}}
  {{- states('sensor.devonport_now_temp_later', with_unit=true) -}}
  {{-('. Conditions are ')-}}
  {{- states('sensor.devonport_extended_text_0') -}}
  {%- if is_state('sensor.devonport_rain_chance_0', '0') %}
  {{-(' There is No Rain Forecast, with ')-}}
  {{- states('sensor.devonport_airport_rain_since_9am', with_unit=true) -}}
  {{-(' since 9am. ')-}}
  {%- else %}
  {{-(' There is a ')-}}
  {{- states('sensor.devonport_rain_chance_0', with_unit=true) -}}
  {{-(' chance of ')-}}
  {{- states('sensor.devonport_rain_amount_range_0', with_unit=true) -}}
  {{-(' mm rain, with ')-}}
  {{- states('sensor.devonport_airport_rain_since_9am', with_unit=true) -}}
  {{-(' since 9am. ')-}}
  {%- endif -%}
  {%- if is_state('sensor.devonport_fire_danger_0', 'unknown') %}
  {{-(' Fire Danger is LOW, ')-}}
  {%- else -%}
  {{-(' Fire Danger Rating is ')-}}
  {{- states('sensor.devonport_fire_danger_0') | upper -}}
  {%- endif -%}
  {%- if is_state('sensor.devonport_uv_category_0', 'unknown') %}
  {{-(' and NO UV ')-}}
  {%- else %}
  {{-(' and UV is ')-}}
  {{- states('sensor.devonport_uv_category_0') | upper -}}
  {%- endif -%}
  {%- for state in state_attr('sensor.devonport_warnings', 'warnings') %}
  {%- if 'cancelled' in state.phase %}
  {{-(' NO WEATHER WARNINGS ')-}}
  {%- elif 'minor' in state.warning_group_type -%}
  {{-('. ')-}}
  {{state.warning_group_type | upper}} {{ state.title | upper}}
  {%- elif 'major' in state.warning_group_type -%}
  {{-('. ')-}}
  {{state.warning_group_type | upper}} {{ state.title | upper}}
  {%- endif -%}
  {%- endfor -%}

For use in Node Red The state from the sensors below are recombined into the full weather report that can be sent to TTS.

image

# Template Weather Report Text- BOM Current Feel - Temp and Conditions Report - TTS Input

  - platform: template
    sensors:
      weather_report_conditions:
        entity_id: sensor.weather_report_conditions
        friendly_name: "Weather Report Conditions"
        value_template: >-
          Currently it is 
          {{ states('sensor.netatmo_devonport_tas_indoor_outdoor_temperature', with_unit=true) }}
            but feels 
          {{ states('sensor.text_dewpoint_comfort_outside',with_unit=true) }}
            and 
          {{ states('sensor.devonport_airport_temp_feels_like',with_unit=true) }}
            outside, the 
          {{ states('sensor.devonport_now_now_label', with_unit=true) }}
            is 
          {{ states('sensor.devonport_now_temp_now', with_unit=true) }}
            ,  
          {{ states('sensor.devonport_now_later_label', with_unit=true) }}
            will be  
          {{ states('sensor.devonport_now_temp_later', with_unit=true) }}
            . Conditions are 
          {{ states('sensor.devonport_extended_text_0') }}

# Template Weather Report Text - BOM Current rain and chance of rain - TTS Input

  - platform: template
    sensors:
      weather_report_rain:
        entity_id: sensor.weather_report_rain
        friendly_name: "Weather Report Rain"
        value_template: >-
          {%- if is_state('sensor.devonport_rain_chance_0', '0') %}
            There is No Rain Forecast, with 
          {{states('sensor.devonport_airport_rain_since_9am', with_unit=true) }}
            since 9am. 
          {%- else %}
            There is a 
          {{ states('sensor.devonport_rain_chance_0', with_unit=true) }}
            chance of 
          {{ states('sensor.devonport_rain_amount_range_0', with_unit=true) }}
            mm rain, with 
          {{ states('sensor.devonport_airport_rain_since_9am', with_unit=true) }}
            since 9am. 
          {%- endif -%}

# Template Weather Report Text - BOM Current Fire Danger and UV - TTS Input

  - platform: template
    sensors:
      weather_report_fire_uv:
        entity_id: sensor.weather_report_fire_uv
        friendly_name: "Weather Report Fire UV"
        value_template: >-
          {%- if is_state('sensor.devonport_fire_danger_0', 'unknown') %}
            Fire Danger is LOW, 
          {%- else %}
            Fire Danger Rating is 
          {{ states('sensor.devonport_fire_danger_0') | upper }}
          {%- endif -%}
          {%- if is_state('sensor.devonport_uv_category_0', 'unknown') %}
            and NO UV 
          {%- else %}
            and UV is 
          {{ states('sensor.devonport_uv_category_0') | upper }}
          {%- endif -%}

# Template Weather Report Text - BOM Current weather warnings - TTS Input

  - platform: template
    sensors:
      weather_report_warnings:
        entity_id: sensor.weather_report_warnings
        friendly_name: "Weather Report Warnings"
        value_template: >-
          {%- for state in state_attr('sensor.devonport_warnings', 'warnings') %}
          {%- if 'cancelled' in state.phase %}
            NO WEATHER WARNINGS 
          {%- elif 'minor' in state.warning_group_type%}
            . 
          {{ state.warning_group_type | upper}} {{ state.title | upper }}
          {%- elif 'major' in state.warning_group_type%}
            . 
          {{ state.warning_group_type | upper}} {{ state.title | upper }}
          {%- endif %}
          {%- endfor -%}

To enter all of the above sensors into your configuration.yaml file just copy the below. Ensure it is under the -platform: template section. You will have to change the sensor names to your own entities.
# ALL BOM TEXT SENSORS

  - platform: template
    sensors:
# Template Weather Warning Phase Text - Act as trigger for lovelace conditional card
      weather_warning_phase:
        entity_id: sensor.devonport_warnings
        friendly_name: "Weather Warning Phase"
        value_template: >-
          {%- for state in state_attr('sensor.devonport_warnings', 'warnings') -%}
          {%- if 'new' in state.phase %}
          {{state.phase | upper}}
          {%- elif 'renewal' in state.phase %}
          {{state.phase | upper}}
          {%- elif 'update' in state.phase %}
          {{state.phase | upper}}
          {%- elif 'upgrade' in state.phase %}
          {{state.phase | upper}}
          {%- elif 'downgrade' in state.phase %}
          {{state.phase | upper}}
          {%- elif 'final' in state.phase %}
          {{state.phase | upper}}
          {%- elif 'cancelled' in state.phase %}
          {{state.phase | upper}}
          {%- endif -%}
          {%- endfor -%}
# Template Weather Report Text- BOM Current Feel - Temp and Conditions Report - TTS Input
      weather_report_conditions:
        entity_id: sensor.weather_report_conditions
        friendly_name: "Weather Report Conditions"
        value_template: >-
          Currently it is 
          {{ states('sensor.netatmo_devonport_tas_indoor_outdoor_temperature', with_unit=true) }}
            but feels 
          {{ states('sensor.text_dewpoint_comfort_outside',with_unit=true) }}
            and 
          {{ states('sensor.devonport_airport_temp_feels_like',with_unit=true) }}
            outside, the 
          {{ states('sensor.devonport_now_now_label', with_unit=true) }}
            is 
          {{ states('sensor.devonport_now_temp_now', with_unit=true) }}
            ,  
          {{ states('sensor.devonport_now_later_label', with_unit=true) }}
            will be  
          {{ states('sensor.devonport_now_temp_later', with_unit=true) }}
            . Conditions are 
          {{ states('sensor.devonport_extended_text_0') }}
# Template Weather Report Text - BOM Current rain and chance of rain - TTS Input
      weather_report_rain:
        entity_id: sensor.weather_report_rain
        friendly_name: "Weather Report Rain"
        value_template: >-
          {%- if is_state('sensor.devonport_rain_chance_0', '0') %}
            There is No Rain Forecast, with 
          {{states('sensor.devonport_airport_rain_since_9am', with_unit=true) }}
            since 9am. 
          {%- else %}
            There is a 
          {{ states('sensor.devonport_rain_chance_0', with_unit=true) }}
            chance of 
          {{ states('sensor.devonport_rain_amount_range_0', with_unit=true) }}
            mm rain, with 
          {{ states('sensor.devonport_airport_rain_since_9am', with_unit=true) }}
            since 9am. 
          {%- endif -%}
# Template Weather Report Text - BOM Current Fire Danger and UV - TTS Input
      weather_report_fire_uv:
        entity_id: sensor.weather_report_fire_uv
        friendly_name: "Weather Report Fire UV"
        value_template: >-
          {%- if is_state('sensor.devonport_fire_danger_0', 'unknown') %}
            Fire Danger is LOW, 
          {%- else %}
            Fire Danger Rating is 
          {{ states('sensor.devonport_fire_danger_0') | upper }}
          {%- endif -%}
          {%- if is_state('sensor.devonport_uv_category_0', 'unknown') %}
            and NO UV 
          {%- else %}
            and UV is 
          {{ states('sensor.devonport_uv_category_0') | upper }}
          {%- endif -%}
# Template Weather Report Text - BOM Current weather warnings - TTS Input
      weather_report_warnings:
        entity_id: sensor.weather_report_warnings
        friendly_name: "Weather Report Warnings"
        value_template: >-
          {%- for state in state_attr('sensor.devonport_warnings', 'warnings') %}
          {%- if 'cancelled' in state.phase %}
            NO WEATHER WARNINGS 
          {%- elif 'minor' in state.warning_group_type%}
            . 
          {{ state.warning_group_type | upper}} {{ state.title | upper }}
          {%- elif 'major' in state.warning_group_type%}
            . 
          {{ state.warning_group_type | upper}} {{ state.title | upper }}
          {%- endif %}
          {%- endfor -%}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

10 participants