mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-15 21:36:52 +00:00
Update environment_canada.markdown (#37541)
This commit is contained in:
parent
815c7085cf
commit
4c33a1bacf
@ -132,9 +132,46 @@ template:
|
||||
|
||||
{% endraw %}
|
||||
|
||||
The configuration snippet below adds a template sensor containing the current forecast information as attributes and the text summary of the forecast for the current day.
|
||||
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
- trigger:
|
||||
- platform: time_pattern
|
||||
hours: "/4"
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
- platform: event
|
||||
event_type: event_template_reloaded
|
||||
action:
|
||||
- service: environment_canada.get_forecasts
|
||||
target:
|
||||
entity_id: weather.ottawa_kanata_orleans_forecast
|
||||
response_variable: forecasts
|
||||
sensor:
|
||||
- name: Weather Forecast Daily
|
||||
unique_id: weather_forecast_daily
|
||||
state: "{{ states('weather.ottawa_kanata_orleans_forecast') }}"
|
||||
attributes:
|
||||
daily: "{{ forecasts['weather.ottawa_kanata_orleans_forecast']['daily_forecast'] }}"
|
||||
hourly: "{{ forecasts['weather.ottawa_kanata_orleans_forecast']['hourly_forecast'] }}"
|
||||
summary: "{{ forecasts['weather.ottawa_kanata_orleans_forecast']['daily_forecast'][0]['text_summary'] }}"
|
||||
temperature_unit: "{{ state_attr('weather.ottawa_kanata_orleans_forecast', 'temperature_unit') }}"
|
||||
```
|
||||
|
||||
{% endraw %}
|
||||
|
||||
## Actions
|
||||
|
||||
### Action `environment_canada.get_forecasts`
|
||||
|
||||
Get the raw forecast data from Environment Canada. Returns both the `daily_forecast` and the `hourly_forecast` data.
|
||||
|
||||
| Data attribute | Optional | Description |
|
||||
| ---------------------- | -------- | ----------- |
|
||||
| `entity_id` | yes | Weather entity to get forecast for.
|
||||
|
||||
### Action `environment_canada.set_radar_type`
|
||||
|
||||
Sets the type of radar to retrieve for the camera.
|
||||
|
Loading…
x
Reference in New Issue
Block a user