Skip to content

Commit

Permalink
Update to v2025.4
Browse files Browse the repository at this point in the history
- weather template/UI updates
- bugfixes, cleanup
  • Loading branch information
jazzyisj committed May 4, 2024
1 parent 236ff9b commit 044fb6a
Show file tree
Hide file tree
Showing 20 changed files with 166 additions and 82 deletions.
2 changes: 1 addition & 1 deletion custom_templates/weather.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{%- endmacro -%}

{%- macro uv_risk(index) -%}
{%- if is_number(index) and index > 0 %}
{%- if is_number(index) and index >= 0 %}
{%- if index >= 11 %} Extreme
{%- elif index >= 8 %} Very High
{%- elif index >= 6 %} High
Expand Down
4 changes: 1 addition & 3 deletions logging/recorder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ include:
- sensor.sulphur_dioxide
- sensor.particulate_matter_2_5
- sensor.fire_index
- sensor.atmospheric_smoke

# ~~~~ Other Weather Sensors ~~~~ # graphs
- sensor.outdoor_temperature_daily_average
Expand Down Expand Up @@ -174,9 +175,6 @@ include:
- sensor.windsor_normal_high_temperature
- sensor.windsor_normal_low_temperature

# ~~~~ Pirateweather ~~~~ # graphs
- sensor.pirateweather_smoke #TODO to template

# ~~~~ Shelly Devices ~~~~
- sensor.indoor_sump_count # history stats
- sensor.outdoor_sump_count # history stats
Expand Down
5 changes: 0 additions & 5 deletions packages/weather/waqi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@ homeassistant:
alert.waqi_connected:
entity_picture: !secret WAQI_ICON
category: weather

sensor.waqi_windsor:
icon: mdi:smog
sensor.waqi_windsor_downtown_ontario_canada:
icon: mdi:smog
sensor.waqi_windsor_west_ontario_canada:
icon: mdi:smog

alert:
air_quality:
Expand Down
9 changes: 4 additions & 5 deletions scripts/weather/weather_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,18 @@ weather_report:
Today's high temperature will be {{ plural_qty('degree', high_temp, false) }} and the over night low will be {{ low_temp }}.
{%- endif %}
{%- if show_normal_high or show_normal_low %}
{%- if show_normal_high %} The high will be about {{ plural_qty('degree', normal_high_diff | abs, false) }} {{ 'lower' if normal_high_diff < 0 else 'higher' }}{% endif %}
{%- if show_normal_high %} The high temperature will be {{ plural_qty('degree', normal_high_diff | abs, false) }} {{ 'lower' if normal_high_diff < 0 else 'higher' }}{% endif %}
{%- if show_normal_high and show_normal_low %} and the {% elif show_normal_low %}Today's {% endif %}
{%- if show_normal_low %}low will be {{ plural_qty('degree', normal_low_diff | abs, false) }} {{ 'lower' if normal_low_diff < 0 else 'higher' }} {% endif -%}
than normal.
{%- endif %}
The current humidity level is {{ humidity }} percent.
{%- if wind_max > 15 %}
It will get {{ 'rather' if wind_max < 25 else 'very' }} windy, with wind speeds approaching {{ wind_max }} kilometers per hour.
{%- endif %}
{%- if precipitation_today %}
{%- if not precip_now %}
There is a {{ pop }} percent chance of {{ precip_type }} today
There is {{ iarticle(pop) }} percent chance of {{ precip_type }} today
{%- if precip_start != none %}, starting around {{ precip_start }}{% endif -%}
{%- endif %}.
{%- if expected_precip > 0 %}
Expand All @@ -115,10 +116,8 @@ weather_report:
{%- if fog > 25 %}
There is {{ iif(precipitation_today, 'also', 'however,') }} {{ iarticle(fog) }} percent chance of fog.
{%- endif %}
{%- if wind_max > 15 %}
It will get {{ 'rather' if wind_max < 25 else 'very' }} windy, with wind speeds approaching {{ wind_max }} kilometers per hour.{% endif %}
{%- if states('sensor.uv_risk_today') | lower in ['medium', 'medium-high', 'high', 'very high'] %}
Do your best to keep all your pastey red-headed step children indoors today, the forecasted UV risk is {{ states('sensor.uv_risk_today') -}}.
Do your best to keep all your pastey red-headed step children indoors, the forecasted UV risk is {{ states('sensor.uv_risk_today') -}}.
{%- endif %}
{%- if not states('sensor.aqi_risk_level') | lower in ['good', 'unknown','unavailable'] %}
The air quality index is {{ states('sensor.aqi_risk_level') }}, so be prepared to choke on a little smog out there.
Expand Down
56 changes: 28 additions & 28 deletions templates/hass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,34 +87,34 @@
state: >
{% set entities = state_attr(this.entity_id, 'entity_id') %}
{{ entities | count if entities != none else -1 }}
# attributes: #STATES
# #TEMP exclude garage_inside_frigate - cam not working
# #TEMP exclude disabled chromecast sensors
# #TEMP exclude front_door_lock - lock not working
# entity_id: >
# {% set ignore_seconds = 60 %}
# {% set ignored = state_attr('group.ignored_unavailable_entities', 'entity_id') %}
# {% set ignore_ts = (now().timestamp() - ignore_seconds) | as_datetime %}
# {% set entities = states
# | selectattr('state', 'in', ['unknown', 'unavailable'])
# | rejectattr('domain','in',['button', 'device_tracker', 'event', 'group', 'image', 'input_button', 'input_text', 'remote', 'tts', 'scene', 'stt'])
# | rejectattr('entity_id', 'in', integration_entities('browser_mod'))
# | rejectattr('entity_id', 'in', integration_entities('fully_kiosk'))
# | rejectattr('entity_id', 'in', integration_entities('hassio'))
# | rejectattr('entity_id', 'in', integration_entities('dlna_dmr'))
# | rejectattr('entity_id', 'search', '_door_lock_intrusion|_door_lock_lock_jammed|_door_lock_keypad_temporary_disabled|_door_lock_system_hardware_failure')
# | rejectattr('entity_id', 'contains', 'garage_inside_frigate')
# | rejectattr('entity_id', 'contains', 'front_door_lock')
# | rejectattr('entity_id', 'in', ['sensor.deck_chromecast', 'sensor.office_chromecast'])
# | rejectattr('entity_id', 'contains', 'daily_energy_consumption')
# | rejectattr('entity_id', 'contains', 'jason_laptop_media_player')
# | rejectattr('entity_id', 'contains', 'jason_phone_media_player')
# | rejectattr('entity_id', 'contains', 'jason_tablet_media_player')
# | rejectattr('entity_id', 'search', 'charlie_crate_camera|charlie_crate_frigate|living_room_camera|living_room_frigate')
# | rejectattr('entity_id', 'search', 'jphone_app|jtablet_app|jlaptop_chrome|jwork_chrome|_dlna|_timers|_alarms|_next_alarm')
# | rejectattr('last_changed', 'ge', ignore_ts) %}
# {% set entities = entities | rejectattr('entity_id', 'in', ignored) if ignored != none else entities %}
# {{ entities | map(attribute='entity_id') | list | sort }}
attributes: #STATES
#TEMP exclude garage_inside_frigate - cam not working
#TEMP exclude disabled chromecast sensors
#TEMP exclude front_door_lock - lock not working
entity_id: >
{% set ignore_seconds = 60 %}
{% set ignored = state_attr('group.ignored_unavailable_entities', 'entity_id') %}
{% set ignore_ts = (now().timestamp() - ignore_seconds) | as_datetime %}
{% set entities = states
| selectattr('state', 'in', ['unknown', 'unavailable'])
| rejectattr('domain','in',['button', 'conversation', 'device_tracker', 'event', 'group', 'image', 'input_button', 'input_text', 'remote', 'tts', 'scene', 'stt'])
| rejectattr('entity_id', 'in', integration_entities('browser_mod'))
| rejectattr('entity_id', 'in', integration_entities('fully_kiosk'))
| rejectattr('entity_id', 'in', integration_entities('hassio'))
| rejectattr('entity_id', 'in', integration_entities('dlna_dmr'))
| rejectattr('entity_id', 'search', '_door_lock_intrusion|_door_lock_lock_jammed|_door_lock_keypad_temporary_disabled|_door_lock_system_hardware_failure')
| rejectattr('entity_id', 'contains', 'garage_inside_frigate')
| rejectattr('entity_id', 'contains', 'front_door_lock')
| rejectattr('entity_id', 'in', ['sensor.deck_chromecast', 'sensor.office_chromecast'])
| rejectattr('entity_id', 'contains', 'daily_energy_consumption')
| rejectattr('entity_id', 'contains', 'jason_laptop_media_player')
| rejectattr('entity_id', 'contains', 'jason_phone_media_player')
| rejectattr('entity_id', 'contains', 'jason_tablet_media_player')
| rejectattr('entity_id', 'search', 'charlie_crate_camera|charlie_crate_frigate|living_room_camera|living_room_frigate')
| rejectattr('entity_id', 'search', 'jphone_app|jtablet_app|jlaptop_chrome|jwork_chrome|_dlna|_timers|_alarms|_next_alarm')
| rejectattr('last_changed', 'ge', ignore_ts) %}
{% set entities = entities | rejectattr('entity_id', 'in', ignored) if ignored != none else entities %}
{{ entities | map(attribute='entity_id') | list | sort }}
- binary_sensor:
- name: "Github Connected Alert"
Expand Down
23 changes: 19 additions & 4 deletions templates/weather/weather.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@
- name: "Lightning Distance"
unique_id: lightning_distance
icon: mdi:lightning-bolt
device_class: distance
state_class: measurement
unit_of_measurement: km
state: >
Expand Down Expand Up @@ -1038,7 +1038,7 @@
- name: "Lightning Last Strike"
unique_id: lightning_last_strike
icon: mdi:lightning-bolt
icon: mdi:clock-star-four-points
device_class: timestamp
state: "{{ states('sensor.home_sensors_time_of_last_lightning_strike') }}"
availability: "{{ has_value('sensor.home_sensors_time_of_last_lightning_strike') }}"
Expand All @@ -1051,6 +1051,7 @@

- name: "Nearest Storm Direction"
unique_id: nearest_storm_direction
icon: mdi:compass
state: >
{% from 'speech.jinja' import full_cardinal_direction %}
{{ full_cardinal_direction(states('sensor.nearest_storm_bearing') | int(-1)) }}
Expand Down Expand Up @@ -1448,13 +1449,27 @@
or (is_state('binary_sensor.pirateweather_connected', 'on')
and is_number(states('sensor.pirateweather_visibility'))) }}
- name: "Atmospheric Smoke"
unique_id: atmospheric_smoke
icon: mdi:smoke
state_class: measurement
state: "{{ states('sensor.pirateweather_smoke') | int }}"
availability: "{{ is_number(states('sensor.pirateweather_smoke')) }}"

- name: "Fire Index"
unique_id: fire_index
icon: mdi:fire
state_class: measurement
state: "{{ states('sensor.pirateweather_fire_index') | int }}"
availability: "{{ is_number(states('sensor.pirateweather_fire_index')) }}"

- name: "Fire Risk"
unique_id: fire_risk
icon: mdi:fire
state: >
{% from 'weather.jinja' import fire_risk %}
{{ fire_risk(states('sensor.pirateweather_fire_index') | int ) }}
availability: "{{ is_number(states('sensor.pirateweather_fire_index')) }}"
{{ fire_risk(states('sensor.fire_index') | int ) }}
availability: "{{ is_number(states('sensor.fire_index')) }}"

- name: "Fire Risk Today"
unique_id: fire_risk_today
Expand Down
1 change: 1 addition & 0 deletions ui-kiosk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ views:
- !include /config/ui/dashboard/subview/weather/wind_radar.yaml
- !include /config/ui/dashboard/subview/weather/envcan_alerts.yaml
- !include /config/ui/dashboard/subview/weather/envcan_lightning.yaml
- !include /config/ui/dashboard/subview/weather/blitzortung_lightning.yaml
- !include /config/ui/dashboard/subview/weather/pressure_radar.yaml
- !include /config/ui/dashboard/subview/weather/humidity_radar.yaml
- !include /config/ui/dashboard/subview/weather/temperature_radar.yaml
Expand Down
1 change: 1 addition & 0 deletions ui-lovelace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ views:
- !include /config/ui/dashboard/subview/weather/fire.yaml
- !include /config/ui/dashboard/subview/weather/wind_radar.yaml
- !include /config/ui/dashboard/subview/weather/envcan_lightning.yaml
- !include /config/ui/dashboard/subview/weather/blitzortung_lightning.yaml
- !include /config/ui/dashboard/subview/weather/envcan_alerts.yaml
- !include /config/ui/dashboard/subview/weather/pressure_radar.yaml
- !include /config/ui/dashboard/subview/weather/humidity_radar.yaml
Expand Down
1 change: 1 addition & 0 deletions ui-mobile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ views:
- !include /config/ui/dashboard/subview/weather/wind_radar.yaml
- !include /config/ui/dashboard/subview/weather/envcan_alerts.yaml
- !include /config/ui/dashboard/subview/weather/envcan_lightning.yaml
- !include /config/ui/dashboard/subview/weather/blitzortung_lightning.yaml
- !include /config/ui/dashboard/subview/weather/pressure_radar.yaml
- !include /config/ui/dashboard/subview/weather/humidity_radar.yaml
- !include /config/ui/dashboard/subview/weather/temperature_radar.yaml
Expand Down
6 changes: 3 additions & 3 deletions ui/button/weather/lightning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ tap_action:
action: navigate
navigation_path: lightning
double_tap_action:
action: url
url_path: !secret ENVCAN_LIGHTNING
action: navigate
navigation_path: envcan-lightning
hold_action:
action: navigate
navigation_path: storm-radar
navigation_path: blitz-lightning
26 changes: 22 additions & 4 deletions ui/card/hass/glances_monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,27 @@ entities:
- !include /config/ui/bar/glances_ram_temp_entity.yaml
- !include /config/ui/bar/glances_swap_use_entity.yaml
- !include /config/ui/bar/glances_disk_use_entity.yaml
- sensor.glances_running
- sensor.glances_sleeping
- sensor.glances_thread
- sensor.glances_total

- entity: sensor.glances_containers_active
name: "Containers Active"
- entity: sensor.glances_containers_cpu_used
name: "Containers CPU Usage"
- entity: sensor.glances_containers_ram_used
name: "Containers Memory Used"

- entity: sensor.glances_running
name: "Running"

- entity: sensor.glances_sleeping
name: "Sleeping"

- entity: sensor.glances_thread
name: "Threads"

- entity: sensor.glances_total
name: "Total"

- entity: sensor.localhost_uptime
name: "Uptime"
card_mod:
class: basic
6 changes: 3 additions & 3 deletions ui/card/weather/current_conditions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -284,18 +284,18 @@ entities:
{% from 'weather.jinja' import aqi_index_icon %}
{{ aqi_index_icon(states('sensor.particulate_matter_2_5') | int(-1)) }}
- entity: sensor.pirateweather_smoke
- entity: sensor.atmospheric_smoke
name: "Smoke"
card_mod:
style: >
{% from 'weather.jinja' import smoke_level_icon %}
{{ smoke_level_icon(states('sensor.pirateweather_smoke') | int(-1)) }}
{{ smoke_level_icon(states('sensor.atmospheric_smoke') | int(-1)) }}
- type: custom:template-entity-row
entity: sensor.fire_risk
name: "Fire Risk"
state: "{{ states('sensor.fire_risk') }}"
secondary: "Fire Index: {{ states('sensor.pirateweather_fire_index') }}"
secondary: "Fire Index: {{ states('sensor.fire_index') }}"
card_mod:
style: >
{% from 'weather.jinja' import fire_risk_icon %}
Expand Down
4 changes: 2 additions & 2 deletions ui/card/weather/pirateweather_sensors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ entities:
- entity: sensor.pirateweather_visibility
- entity: sensor.pirateweather_alerts

- sensor.pirateweather_ice_accumulation_0d
- sensor.pirateweather_ice_accumulation_0d #TODO
- sensor.pirateweather_liquid_accumulation_0d
- sensor.pirateweather_smoke
- sensor.pirateweather_smoke_max_0d
- sensor.pirateweather_snow_accumulation_0d

- sensor.pirateweather_time
- sensor.pirateweather_time #TODO what?
- sensor.pirateweather_time_0d
- sensor.pirateweather_time_1d
card_mod:
Expand Down
16 changes: 9 additions & 7 deletions ui/dashboard/subview/weather/air_quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@ cards:
{% from 'weather.jinja' import aqi_index_icon %}
{{ aqi_index_icon(states('sensor.particulate_matter_2_5') | int(-1)) }}
- entity: sensor.pirateweather_smoke
name: "Smoke"
card_mod:
style: >
{% from 'weather.jinja' import smoke_level_icon %}
{{ smoke_level_icon(states('sensor.pirateweather_smoke') | int(-1)) }}
- type: conditional
conditions:
- entity: alert.air_quality
Expand All @@ -76,6 +69,15 @@ cards:
action: url
url_path: !secret AQI

- type: section

- entity: sensor.atmospheric_smoke
name: "Smoke"
card_mod:
style: >
{% from 'weather.jinja' import smoke_level_icon %}
{{ smoke_level_icon(states('sensor.atmospheric_smoke') | int(-1)) }}
- type: button
entity: sensor.aqi_risk_level
name: "Smoke Map"
Expand Down
32 changes: 32 additions & 0 deletions ui/dashboard/subview/weather/atmospheric_conditions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,36 @@ cards:
action: navigate
navigation_path: pressure-radar

- type: button
entity: sensor.cloud_coverage
name: "Ventusky Radar"
action_name: "VIEW"
tap_action:
action: navigate
navigation_path: cloud-radar-ventusky

- type: button
entity: sensor.cloud_coverage
name: "Cloud Radar"
action_name: "VIEW"
tap_action:
action: navigate
navigation_path: cloud-radar

- type: button
name: "Satellite"
icon: mdi:satellite
action_name: "VIEW"
tap_action:
action: navigate
navigation_path: ventusky-satellite

- type: button
name: "Zoom Satellite"
icon: mdi:satellite
action_name: "VIEW"
tap_action:
action: url
url_path: !secret ZOOM_SAT_LIVE

- !include /config/ui/graph/weather/atmospheric_conditions.yaml
10 changes: 10 additions & 0 deletions ui/dashboard/subview/weather/blitzortung_lightning.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
###############################################################################
## Blitzortung Lightning Subview
###############################################################################
title: "Blitzortung Lightning"
path: blitz-lightning
subview: true
panel: true
cards:
- type: iframe
url: !secret BLITZ_LIGHTNING
8 changes: 0 additions & 8 deletions ui/dashboard/subview/weather/envcan_alerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ cards:
- entity: sensor.windsor_watches
- entity: sensor.windsor_endings

- type: button
icon: mdi:fire
name: "Ontario Fire Map"
action_name: "VIEW"
tap_action:
action: navigate
navigation_path: fire

- !include /config/ui/card/weather/envcan_alert_detail.yaml

- type: iframe
Expand Down
Loading

0 comments on commit 044fb6a

Please sign in to comment.