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

Fire Index #119

Open
jazzyisj opened this issue Sep 8, 2023 · 19 comments
Open

Fire Index #119

jazzyisj opened this issue Sep 8, 2023 · 19 comments
Labels
enhancement New feature or request keep

Comments

@jazzyisj
Copy link

jazzyisj commented Sep 8, 2023

Possible to provide a fire index sensor? This is currently provided by the Tomorrow.io integration, and is the only sensor I use from that integration. It would be great to have it in Pirateweather so I can ditch Tomorrow.io.

https://docs.tomorrow.io/reference/data-layers-fire

I believe the data from Ontario comes from here.

https://www.lioapplications.lrc.gov.on.ca/ForestFireInformationMap/index.html?viewer=FFIM.FFIM

@cloneofghosts cloneofghosts added enhancement New feature or request Needs Review labels Nov 14, 2023
@cloneofghosts cloneofghosts changed the title [Feature Request] Fire Index Fire Index Nov 14, 2023
@alexander0042
Copy link
Collaborator

I started out typing a reply explaining how this might be impossible, but after I looked into it a little more, I think it might be doable! When you say fire index, does something like this look right: https://rapidrefresh.noaa.gov/hrrr/HRRR/displayMapUpdated.cgi?keys=hrrr_ncep_jet:&runtime=2023111417&plot_type=firewx_full_sfc&fcst=000&time_inc=60&num_times=49&model=hrrr&ptitle=Forecast%20Graphics&maxFcstLen=48&fcstStrLen=-1&domain=full:hrrr&adtfn=1.

If so, then it means it's already calculated as part of the HRRR-Smoke model, which I'm hoping to add in conjunction with an air quality index (highly requested feature) in V2.0 of the API. It won't happen for a couple months, but should be possible once this data source is added in!

@jazzyisj
Copy link
Author

jazzyisj commented Nov 15, 2023

That is exactly what I was getting at! I think the fire index is becoming more and more relevant with the crazy wildfires that have been happening the last few years. We have to keep an eye on it here and avoid having outdoor fires when the index is too high. I think this is the Natural Resources Canada version of the NOAA link above.

https://cwfis.cfs.nrcan.gc.ca/maps/fw?type=fwi

@alexander0042
Copy link
Collaborator

Great. It's been added to the roadmap for V2.0, so I'll keep you posted!

@cloneofghosts cloneofghosts transferred this issue from Pirate-Weather/pirate-weather-ha Nov 19, 2023
@cloneofghosts cloneofghosts added this to the Pirate Weather 2.0 milestone Dec 12, 2023
@alexander0042
Copy link
Collaborator

Dug into this as part of V2, and frustratingly, while this is an output graphic, it's not one of the parameters that the model produces. As far as I can tell, it's a calculated parameter based on temperature, humidity, etc, but until I can find out what the calculation is, I can't think of a way to incorporate it.

One of my longer term objectives is to start ingesting some of the Canadian models (RDPS, GDPS), and since those seem to have a fire index, I'm going to look into integrating this that way

@cloneofghosts
Copy link
Collaborator

@alexander0042 NBM does have some Fire Weather Elements available which might be what he's looking for? While not global it is available for Alaska, Puerto Rico, Hawaii and Continental America. https://vlab.noaa.gov/web/mdl/nbm-weather-elements-v4.1#nbm-v4-1-fire-weather-elements

I think Tomorrow.io is using the Fosberg Index which NBM does have available.

@cloneofghosts
Copy link
Collaborator

cloneofghosts commented Apr 11, 2024

Beta version 2.0k released this morning adds a fireIndex field which can be enabled using the version=2 parameter. I'm going to leave this one open as there is no fireIndex data for regions outside of the US.

Oops tried to mark this as closed in the milestone but it closed the issue. I removed it instead.

@cloneofghosts cloneofghosts removed this from the Pirate Weather 2.0 milestone Apr 11, 2024
@cloneofghosts cloneofghosts reopened this Apr 11, 2024
@jazzyisj
Copy link
Author

It's great you guys are working on this! I wish I could help more but most of it is over my head. I can't really test it out until Canadian data is available, but I'm watching the progress. Just wanted to say thanks.

@cloneofghosts
Copy link
Collaborator

There are parts of Canada which do have Fire Index data available but it doesn't cover the whole country. From your initial post it sounds like you're located in Ontario which should have Fire Index data available. I'm located in Ottawa, ON and I see Fire Index data and I've done a test for a location just north of Edmonton, AB and it also has data available.

@jazzyisj
Copy link
Author

I'm in Windsor. I'll check it out when I get a chance then.

@jazzyisj
Copy link
Author

Hate to ask a dumb question but I've looked around and can't find the answer.
How do I install Beta version 2.0k mentioned above and enable the version=2 parameter?
I'm running v1.4.6-v2-endpoint right now which obviously predates the changes made here.

@cloneofghosts
Copy link
Collaborator

Version 2.0k is referring to the version number of the API in the flags block. The beta release of HA which you are referring to is the latest version of the HA release just configured to use the development endpoint.

Currently the only way to view the fireIndex is to query the development endpoint in your browser. The URL to do so is: https://dev.pirateweather.net/forecast/[API KEY]/[LAT],[LONG]?units=ca&version=2. At the moment there is no currently fireIndex but it will be added to the next beta version (or release if there is no more beta versions).

Once API Version 2.0 releases a Fire Index sensor will likely be added. I don't see an issue in the HA repository yet so feel free to create an issue for it if you'd like.

@cloneofghosts
Copy link
Collaborator

cloneofghosts commented Apr 26, 2024

Not sure if you get pinged about a linked issue but API version 2.0.1 is now out I created a issue in the HA repository so a sensor can get created to display this data.

@jazzyisj
Copy link
Author

Just checked it out - the current fire index is bang on with the value reported by Tommorrow.io. And it looks like there is a fire index forecast as well! Very cool. This is great! Thanks for the effort getting this in there. I'm sure a lot of people will find it useful.

@cloneofghosts
Copy link
Collaborator

Hi @jazzyisj I've just released a beta version of the integration with sensors for all the version 2 data points. If you want to try it out and make sure everything is working as expected that would be great.

@jazzyisj
Copy link
Author

jazzyisj commented Apr 29, 2024

On v1.5 now and fire index is working as expected! Smoke index too! Very cool.

@cloneofghosts
Copy link
Collaborator

Good to know the sensor is working for you! I'm going to keep this issue open as a reminder to @alexander0042 to integrate more models to setup a global fire index.

@alexander0042
Copy link
Collaborator

Yup! The data is out there, just need to get it plugged in

@cloneofghosts
Copy link
Collaborator

I think I remember seeing that some more Canadian models were added to herbie. Not sure if it's been released yet though.

@jazzyisj
Copy link
Author

jazzyisj commented May 1, 2024

I've been monitoring the data and it's been bang on. It's even picking up that I'm in a small higher risk pocket!

image

One addition that might be useful is a fire risk level sensor, or maybe that value can just be included as an attribute to the fire index sensors. Most people won't understand how the fire index correlates to the more meaningful risk level. I suppose this could be covered in the docs as well so one could just create their own template sensor if needed.

image

The OpenUV integration does something similar.

image

I've already done it in a template for myself.

template:
  - sensor:
      - name: "Fire Risk Level"
        unique_id: fire_risk_level
        icon: mdi:fire
        state: >
          {% set level = states('sensor.pirateweather_fire_index') | int(-1) %}
          {% if level >= 30 %} Extreme
          {% elif level >= 20 %} Very High
          {% elif level >= 10 %} High
          {% elif level >= 5 %} Moderate
          {% else %} Low
          {% endif %}
        availability: "{{ is_number(states('sensor.pirateweather_fire_index')) }}"

This is how I end up displaying it in the HA ui.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request keep
Projects
Status: In Progress
Status: Done
Development

No branches or pull requests

3 participants