Component to get swedish outdoors fire risks for Home Assistant.
The custom compontnet will, while using the supplied position, get fire risks and fire prohibition information from MSB's Brandrisk Ute API. The plugin supplies three different sensors:
- Current risk
- 3 days forecast
- Fire prohibition
- Install this component by creating a
custom_components
folder in the same folder as your configuration.yaml is, if you don't already have one. - Inside that folder, create another folder named
brandriskute
. Put thesensor.py
file in there (if you copy and paste the code, make sure you do it from the raw version of the file). - Add the configuration to your
configuration.yaml
using the config options below. - You will need to restart after installation for the component to start working.
Configuration variables:
key | type | description |
---|---|---|
platform (Required) | string | brandriskute |
latitude (Optional) | string | The latitude of the position from which the sensor should look for fire risks messages. Default home zone latitude |
longitude (Optional) | string | The longitude of the position from which the sensor should look for fire risks messages. Default home zone longitude |
name (Optional) | string | Custom name for the sensor. Default Brandrisk Ute . |
verbose (Optional) | boolean | Use full information or the the basics only. Default True |
forecast (Optional) | boolean | Use forecast sensor. Default True |
prohibition (Optional) | boolean | Use prohibition sensor. Default True |
Example minimal configuration.yaml
sensor:
- platform: brandriskute
Example configuration.yaml using latitude/longitude from secrets
sensor:
- platform: brandriskute
latitude: !secret lat_coord
longitude: !secret long_coord
forecast: false
prohibition: true
verbose: false
Example automation using prohibition change
alias: 'Eldningsförbud Alert'
initial_state: 'on'
trigger:
- platform: state
entity_id: sensor.brandriskute_prohibition
action:
- service: notify.mobile_app_user
data:
message: "{{ states('sensor.brandriskute_prohibition') }} {{ state_attr('sensor.brandriskute_prohibition', 'startDate') }} {{ state_attr('sensor.brandriskute_prohibition', 'description') }}