Skip to content

Commit

Permalink
Update to 2024.12.3
Browse files Browse the repository at this point in the history
- update unavailable entities package
- update mobile notification channels
- expected precipitation type sensor
- update weather templates
- update weather ui
- bugfixes
  • Loading branch information
jazzyisj committed Dec 15, 2024
1 parent 700fd4c commit 4a37778
Show file tree
Hide file tree
Showing 95 changed files with 1,125 additions and 907 deletions.
2 changes: 1 addition & 1 deletion .HA_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024.12.0b4
2024.12.3
13 changes: 11 additions & 2 deletions automations/climate/climate_fireplace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
HVAC Mode: {{ states('climate.thermostat') }}
HVAC State: {{ state_attr('climate.thermostat', 'hvac_action') }}
Temperature: {{ states('sensor.indoor_temperature', with_unit=true) }}
Target: {{ states('input_number.thermostat_target_temperature', with_unit=true) }}
Target: {{ states('sensor.indoor_temperature_target', with_unit=true) }}
data:
tag: fireplace_emergency_on
group: Alert
channel: Urgent
channel: alarm_stream
notification_icon: mdi:fireplace
icon_url: !secret FIREPLACE_ICON
ledColor: !secret WARNING_COLOR
Expand Down Expand Up @@ -80,6 +80,12 @@
- Night
- Away
- Vacation

- trigger: event
id: notification
event_type: mobile_app_notification_action
event_data:
action: fireplace_off
conditions:
- condition: state
entity_id: switch.fireplace
Expand All @@ -94,6 +100,9 @@
entity_id: alert.indoor_low_temperature
state: "idle"

- condition: template
value_template: "{{ trigger.id == 'notification' }}"

- condition: template
alias: "Occupancy override is off if occupancy trigger"
value_template: >
Expand Down
2 changes: 1 addition & 1 deletion automations/climate/climate_temperature_alert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
HVAC Mode: {{ states('climate.thermostat') }}
HVAC State: {{ state_attr('climate.thermostat', 'hvac_action') }}
Temperature: {{ states('sensor.indoor_temperature', with_unit=true) }}
Target: {{ states('input_number.thermostat_target_temperature', with_unit=true) }}
Target: {{ states('sensor.indoor_temperature_target', with_unit=true) }}
data:
tag: emergency_heat
group: Alert
Expand Down
2 changes: 1 addition & 1 deletion automations/climate/climate_thermostat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
{% set temp = state_attr('climate.thermostat', 'temperature') %}
{% set high = state_attr('climate.thermostat', 'target_temp_high') %}
{% set low = state_attr('climate.thermostat', 'target_temp_low') %}
{% set stored = states('input_number.thermostat_target_temperature') %}
{% set stored = states('sensor.indoor_temperature_target') %}
{% set outdoor = states('sensor.outdoor_temperature') %}
{% if hvac in ['heat', 'cool'] %}{{ temp | int if is_number(temp) else stored }}
{% elif hvac == 'heat_cool' %}
Expand Down
26 changes: 16 additions & 10 deletions automations/hass/hass_log_error.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@
description: "Notify on HASS log errors."
mode: single
variables:
error: >
{% set message = trigger.event.data.message[0] %}
{% set exception = trigger.event.data.exception %}
{% if 'Missing device owner or root rights to reboot the device' in message %}
Fully Kiosk - Missing device owner or root rights to reboot the device.
log_error: >
{% set message = '' %}
{% set exception = '' %}
{% if trigger.event.data.message[0] is defined %}
{% set message = trigger.event.data.message[0] %}
{% endif %}
{% if trigger.event.data.exception is defined %}
{% set exception = trigger.event.data.exception %}
{% endif %}
{% if 'Missing device owner or root rights to reboot the device' in exception %}
Fully Kiosk Error - Missing device owner or root rights to reboot the device.
{% else %} {{ none }}
{% endif %}
triggers:
Expand All @@ -21,18 +27,18 @@
level: ERROR
conditions:
- condition: template
value_template: "{{ error != none }}"
value_template: "{{ log_error != none }}"
actions:
- action: browser_mod.notification
data:
duration: 10000
message: "{{ error }}"
message: "{{ log_error }}"

- action: persistent_notification.create
data:
title: "HASS Log Error"
message: "{{ error }}"
notification_id: kiosk_reboot
message: "{{ log_error }}"
notification_id: log_error

- if:
- condition: state
Expand All @@ -43,4 +49,4 @@
then:
- action: notify.kiosk_tts
data:
message: "{{ error }}"
message: "{{ log_error }}"
2 changes: 1 addition & 1 deletion automations/hass/hass_update_group_entities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
| 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', 'in', state_attr('group.ignored_unavailable_entities', 'entity_id') | default([]))
| rejectattr('entity_id', 'in', state_attr('group.ignored_unavailable_entities', 'entity_id'))
| rejectattr('entity_id', 'contains', 'garage_inside')
| rejectattr('entity_id', 'contains', 'front_door_lock')
| rejectattr('entity_id', 'contains', '_next_cycle')
Expand Down
28 changes: 17 additions & 11 deletions automations/media/alarm_clock/alarm_clock_turn_on.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,29 @@
entity_id: input_boolean.alarm_clock_skip_next
else:
- if:
- condition: state #TEST
- condition: state
entity_id: input_select.occupancy_mode
state:
- Home
- Guest
- Night

- condition: template #TEST
value_template: "{{ iif(trigger.id == 'wake', is_state('input_select.occupancy_mode', 'Night'), true) }}"
then:
- action: switch.turn_on
target:
entity_id: "switch.alarm_clock_{{ trigger.id }}"
- if:
- condition: template
value_template: >
{{ iif(trigger.id == 'wake',
is_state('input_select.occupancy_mode', 'Night'), true) }}
then:
- action: notify.jason #VERIFY
data:
title: "Alarm Clock"
message: "Wake alarm clock was scheduled but the house is already awake!"
else:
- action: switch.turn_on
target:
entity_id: "switch.alarm_clock_{{ trigger.id }}"
else:
- action: notify.jason #TEST
- action: notify.jason
data:
title: "Alarm Clock"
message: "Alarm clock scheduled but nobody home!"


message: "Alarm clock was scheduled but nobody is home!"
4 changes: 2 additions & 2 deletions automations/notify/notify_alert_announcements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
{%- elif t == 'alert.precipitation' %}
{%- from 'weather.jinja' import precipitation_text %}
Attention! {{- precipitation_text() }}
Make sure you get Charlie walked!
Check the Jeep windows and make sure you get Charlie walked!
{%- elif t == 'alert.wind' %}
Hang on to yer hats people! It's getting a little windy out there!
Wind speed is {{ states('sensor.wind_speed') | int('unknown') }} kilometers per hour, with gusts approaching {{ states('sensor.wind_gust') | int('unknown') }} kilometers per hour.
Expand Down Expand Up @@ -221,7 +221,7 @@
for:
minutes: 60
actions:
- if: "{{ tts_repeat }}"
- if: "{{ tts_repeat and tts_timeout > 0 }}"
then:
- repeat:
sequence:
Expand Down
2 changes: 1 addition & 1 deletion automations/schedule/commute/commute_before_work.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
{%- set start = states('sensor.precipitation_start') %}
{%- set time = state_attr('sensor.precipitation_start', '12hour') %}
{%- set type = iif(precip, states('sensor.precipitation_type'),
state_attr('sensor.precipitation_start', 'type')) %}
states('sensor.precipitation_type_expected')) %}
{%- if precip or (has_value('sensor.precipitation_start')
and start | as_datetime - now() < timedelta(hours=9)) %}
{{ iif(type == 'snow', 'Bundle up', 'Bring an umbrella') }}
Expand Down
48 changes: 5 additions & 43 deletions automations/weather/precipitation_alert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@
max_exceeded: silent
triggers:
- trigger: state
id: alert
entity_id: alert.precipitation
to: "on"

# notification after work - windows, walk dog etc.
# notification after work on days - windows, walk dog etc.
- trigger: template
value_template: >
{{ is_state('binary_sensor.precipitation_likely_next_24_hours', 'on')
and is_state('binary_sensor.work_today', 'on')
and is_state('sensor.work_shift_today', 'Days')
and states('sensor.time') == '15:50' }}
# notification before work - windows, walk dog etc.
# notification before work on afternoons, weekends - windows, walk dog etc.
- trigger: template
value_template: >
{{ is_state('binary_sensor.precipitation_likely_next_24_hours', 'on')
Expand All @@ -35,12 +36,8 @@
- condition: template
alias: "Only once every 2 hours"
value_template: >
{{ true if this.attributes.last_triggered == none
else now() - this.attributes.last_triggered > timedelta(hours=2) }}
- condition: state
entity_id: alert.precipitation
state: "on"
{{ trigger.id == 'alert' or (true if this.attributes.last_triggered == none
else now() - this.attributes.last_triggered > timedelta(hours=2)) }}
actions:
- variables:
file: >
Expand Down Expand Up @@ -73,38 +70,3 @@
actions:
- title: "Pause"
action: pause_alert_precipitation

###############################################################################
## Weather - Rain Announcement
###############################################################################
- id: weather_rain_announcement
alias: "[Weather] Rain Announcement"
description: "Announcement when it's about to rain or it starts raining."
triggers:
- trigger: state
entity_id: alert.precipitation
to: "on"
conditions:
- condition: state
entity_id: binary_sensor.freezing
state: "off"

- condition: state
entity_id: binary_sensor.jason_home
state: "on"

- condition: template
alias: "Only once every 4 hours"
value_template: >
{{ true if this.attributes.last_triggered == none
else now() - this.attributes.last_triggered > timedelta(hours=4) }}
actions:
- action: script.tts_play
data:
message: >
Hey Knucklehead!
{{ iif(is_state('sensor.precipitation_type', 'rain'), 'It is starting to rain.',
'It is probably going to start raining soon.') }}
Have you checked the Jeep windows yet?
quiet_play: true
save_message: "{{ is_state('binary_sensor.jason_home', 'on') }}"
2 changes: 1 addition & 1 deletion custom_templates/door.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{%- endif %}
{%- endmacro -%}

{%- macro door_color(entity) -%}
{%- macro door_icon_color(entity) -%}
{%- set alert_entity = entity ~ '_open_alert' %}
{%- set open = state_attr('alarm_control_panel.master', 'open_sensors')
if state_attr('alarm_control_panel.master', 'open_sensors') != none else '' %}
Expand Down
2 changes: 1 addition & 1 deletion custom_templates/lock.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{%- endif %}
{%- endmacro -%}

{%- macro lock_color(entity) -%}
{%- macro lock_icon_color(entity) -%}
{%- if not has_value(entity) %} grey
{%- elif is_state(entity, 'unlocked') %} yellow
{%- else %} white
Expand Down
25 changes: 23 additions & 2 deletions custom_templates/weather.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
{%- from 'speech.jinja' import plural_qty -%}
{%- from 'speech.jinja' import full_cardinal_direction -%}
{%- set current = states('sensor.precipitation_type') %}
{%- set type = state_attr('sensor.precipitation_start', 'type') %}
{%- set expected = states('sensor.precipitation_type_expected') %}
{%- set time = state_attr('sensor.precipitation_start', '12hour') %}
{%- set dist = states('sensor.nearest_storm_distance') | int(-1) %}
{%- set dir = full_cardinal_direction(states('sensor.nearest_storm_bearing')) %}
{%- if is_state('binary_sensor.precipitation_active', 'on') %}
It is {{ current }}ing right now.
{%- elif time != none %}
Possibility of {{ type }} around {{ time }}.
Possibility of {{ expected }} around {{ time }}.
{%- if dist > 0 %}
The storm is {{ iif(dist > 0,
plural_qty('kilometer', dist, false) ~ ' away', ' in the immediate vicinity') }}
Expand Down Expand Up @@ -128,6 +128,18 @@ The storm is {{ iif(dist > 0,
}
{%- endmacro -%}

{%- macro precipitation_color(precip) -%}
:host {
--paper-item-icon-color:
{% if precip in ['unknown', 'unavailable'] %} var(--entity-disabled-color)
{%- elif precip == 'rain' %} var(--entity-rain-color)
{%- elif precip == 'snow' %} var(--entity-snow-color)
{%- else %} var(--state-icon-color)
{%- endif %}
;
}
{%- endmacro -%}

{%- macro wind_color(wind) -%}
:host {
--paper-item-icon-color:
Expand Down Expand Up @@ -178,6 +190,15 @@ The storm is {{ iif(dist > 0,
}
{%- endmacro -%}

{%- macro cloud_icon(cloud) -%}
{%- set cloud = cloud | int(-1) %}
{%- if cloud < 20 %} mdi:cloud-outline
{%- elif cloud < 50 %} mdi:weather-partly-cloudy
{%- elif cloud < 80 %} mdi:clouds
{%- else %} mdi:cloud
{%- endif -%}
{%- endmacro -%}

{%- macro cloud_color(cloud) -%}
:host {
--paper-item-icon-color:
Expand Down
2 changes: 1 addition & 1 deletion custom_templates/window.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{%- endif %}
{%- endmacro -%}

{%- macro window_color(entity) -%}
{%- macro window_icon_color(entity) -%}
{%- set alert_entity = entity ~ '_open_alert' %}
{%- set open = state_attr('alarm_control_panel.master', 'open_sensors')
if state_attr('alarm_control_panel.master', 'open_sensors') != none else '' %}
Expand Down
Loading

0 comments on commit 4a37778

Please sign in to comment.