Skip to content

Commit

Permalink
Update to 2025.1.2
Browse files Browse the repository at this point in the history
- update bluetooth ui, remove ble custom attributes
- nest protect reset wan automations
- add remaining charge time sensor
- bugfix in smoke_primary() in alarm.jinja
- charlie pebblebee bluetooth test
- bugfix media presets missing from mobile
- update weather templates
- update weather ui
- update camera object detction
- update indoor camera control
- bugfix commute before work (lights)
- add precipitation_intensity_color custom template
- dew point type comparison test
- add missing mobile media buttons
- update unavailable entities
  • Loading branch information
jazzyisj committed Jan 13, 2025
1 parent b501971 commit 85c9a90
Show file tree
Hide file tree
Showing 50 changed files with 474 additions and 494 deletions.
2 changes: 1 addition & 1 deletion .HA_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2025.1.0
2025.1.2
44 changes: 44 additions & 0 deletions automations/alarm/alarm_nest_protect_update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
###############################################################################
## Alarm - Nest Protect Update
## This automation updates entities from the Next Protect integration every
## 5 minutes as a heartbeat and update the last_reported attribute so we can
## determine if the integration is connected or not
###############################################################################
- id: alarm_nest_protect_update
alias: "[Alarm] Nest Protect Update"
description: "Update next protect entities."
triggers:
- trigger: time_pattern
minutes: "/1"
conditions:
- condition: state
entity_id:
- binary_sensor.nest_protect_integration_connected
- binary_sensor.wan
state: "on"
actions:
- action: homeassistant.update_entity
data:
entity_id: binary_sensor.nest_protect_upstairs_smoke_status

###############################################################################
## Alarm - Nest Protect WAN Reset
## This automation reloads the Nest Protect integration when the WAN
## goes offline to clear sensor values and then again when the WAN goes
## online to refresh the sensor values.
###############################################################################
- id: alarm_nest_protect_wan_reset
alias: "[Alarm] Nest Protect WAN Reset"
description: "Reset next protect when WAN status changes."
mode: restart
triggers:
- trigger: state
entity_id: binary_sensor.wan
to: "off"
not_from:
- unknown
- unavailable
actions:
- action: homeassistant.reload_config_entry
target:
entity_id: binary_sensor.nest_protect_upstairs_smoke_status
9 changes: 6 additions & 3 deletions automations/camera/camera_event_detection_control.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

# reset when disabled after 8 hours
- trigger: state
id: disabled
entity_id: input_boolean.camera_event_detection
to: "off"
for:
Expand All @@ -32,9 +33,11 @@
- armed_away
- armed_vacation
actions:
- action: input_boolean.turn_on
target:
entity_id: input_boolean.camera_event_detection
- if: "{{ trigger.id == 'disabled' }}"
then:
- action: input_boolean.turn_on
target:
entity_id: input_boolean.camera_event_detection

- wait_template: >
{{ is_state('binary_sensor.frigate_integration_connected', 'on')
Expand Down
27 changes: 22 additions & 5 deletions automations/camera/camera_indoor_camera_control.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
replace='switch.\\1_camera_power', ignorecase=False) | list }}
triggers:
- trigger: homeassistant
id: starup
event: start

- trigger: state
Expand All @@ -33,6 +34,16 @@
attribute: entity_id
to:
actions:
- if: "{{ trigger.id == 'startup' }}"
then:
- wait_template: >
{{ states('group.indoor_cameras') not in ['unknown', 'unavailable']
and states('binary_sensor.someone_home') not in ['unknown', 'unavailable']
and is_state('binary_sensor.wyze_integration_connected', 'on') }}
timeout: 300
- stop: "Startup didn't complete."

- if: "{{ entities == none or entities | count == 0 }}"
then:
- stop: "No valid entities."
Expand All @@ -52,12 +63,13 @@
###############################################################################
## Camera - Restart Wyze
###############################################################################
- id: camera_restart_wyze #TEST not required now?
- id: camera_restart_wyze
alias: "[Camera] Restart Wyze"
description: "Restart the Wyze addon."
max_exceeded: silent
triggers:
- trigger: homeassistant
id: startup
event: start

- trigger: state
Expand All @@ -68,11 +80,16 @@
- unknown
- unavailable
for: 60
conditions:
- condition: state
entity_id: binary_sensor.wyze_integration_connected
state: "off"
actions:
- if: "{{ trigger.id == 'startup' }}"
then:
- wait_template: "{{ is_state('binary_sensor.wyze_integration_connected', 'on') }}"
timeout: 300

- condition: state
entity_id: binary_sensor.wyze_integration_connected
state: "off"

- action: hassio.addon_restart
data:
addon: 7094bb28_docker_wyze_bridge
29 changes: 0 additions & 29 deletions automations/hass/hass_update_group_entities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,34 +105,6 @@
#TEMP exclude front_door_lock - lock not working
#TEMP exclude tempest, weatherflow - sensor down
#TEMP exclude hydrawise - API errors
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', 'in', integration_entities('balboa'))
| rejectattr('entity_id', 'in', integration_entities('weatherflow'))
| rejectattr('entity_id', 'in', integration_entities('hydrawise'))
| rejectattr('entity_id', 'in', device_entities('c333f39f8e120425543d2b317af99af3'))
| rejectattr('entity_id', 'in', device_entities('95775b8130a626f30b27207298764c44'))
| rejectattr('entity_id', 'in', device_entities('95775b8130a626f30b27207298764c44'))
| rejectattr('entity_id', 'in', state_attr('group.ignored_unavailable_entities', 'entity_id'))
| rejectattr('entity_id', 'contains', '_next_cycle')
| rejectattr('entity_id', 'contains', 'sensor.system_monitor_network')
| rejectattr('entity_id', 'search', 'charlie_cam_camera|living_room_camera')
| rejectattr('entity_id', 'search', '_door_lock_intrusion|_door_lock_lock_jammed|_door_lock_keypad_temporary_disabled|_door_lock_system_hardware_failure')
| rejectattr('entity_id', 'search', '_timers|_alarms|_next_alarm')
| rejectattr('entity_id', 'search', 'select.media_artist_filter|select.media_album_filter')
| rejectattr('entity_id', 'contains', 'garage_inside')
| rejectattr('entity_id', 'contains', 'front_door_lock')
| map(attribute='entity_id') | list | sort }}
- action: group.set
data:
object_id: unavailable_entities_filtered2 #TEST
entities: >
{% set ignored2 = state_attr('sensor.disabled_device_entities', 'entities')
|regex_replace(find='\[|\]|\{|\}|\'entity_id\':', replace='') %}
Expand Down Expand Up @@ -161,7 +133,6 @@
| rejectattr('entity_id', 'contains', 'front_door_lock')
| map(attribute='entity_id') | list | sort }}
- action: group.set
data:
object_id: google_home_timers
Expand Down
15 changes: 9 additions & 6 deletions automations/network/network_update_group_entities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,30 @@
{{ states.device_tracker
| selectattr('attributes.device_type', 'defined')
| selectattr('attributes.device_type', 'eq', 'wireless')
| map(attribute='entity_id') | list | sort }}
| map(attribute='entity_id') | list
| select('has_value') | sort }}
- action: group.set
data:
object_id: unknown_devices
entities: >
{{ states.device_tracker
| rejectattr('attributes.device_type', 'in',
['bluetooth', 'wired', 'wireless', 'location', 'bluetooth_le'])
| map(attribute='entity_id') | select('has_value') | list | sort }}
| map(attribute='entity_id') | list
| select('has_value') | sort }}
- action: group.set
data:
object_id: bluetooth_devices
entities: >
{{ states.device_tracker | selectattr('attributes.device_type', 'eq', 'bluetooth')
| map(attribute='entity_id') | list | sort }}
| map(attribute='entity_id') | list
| select('has_value') | sort }}
- action: group.set
data:
object_id: bluetooth_le_devices
entities: >
{{ states.device_tracker | selectattr('attributes.device_type', 'eq', 'bluetooth_le')
| map(attribute='entity_id') | list | sort }}
{{ states.device_tracker | selectattr('attributes.source_type', 'eq', 'bluetooth_le')
| map(attribute='entity_id') | list
| select('has_value') | sort }}
4 changes: 2 additions & 2 deletions automations/schedule/commute/commute_before_work.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
for:
minutes: 5
actions:
- action: script.work_commute_lights

- if:
- condition: state
entity_id: binary_sensor.work_commute_active
Expand All @@ -33,6 +31,8 @@
entity_id: binary_sensor.jason_home
state: "on"
then:
- action: script.work_commute_lights

- action: script.turn_on
target:
entity_id: script.tts_play
Expand Down
2 changes: 1 addition & 1 deletion custom_templates/alarm.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
{%- if is_state('binary_sensor.nest_protect_' ~ location ~ '_smoke_status', 'on') %} UPSTAIRS - SMOKE
{%- elif is_state('binary_sensor.nest_protect_' ~ location ~ '_co_status', 'on') %} UPSTAIRS - CARBON DIOXIDE
{%- elif is_state('binary_sensor.nest_protect_' ~ location ~ '_heat_status', 'on') %} UPSTAIRS - HEAT
{%- else %} Upstairs Protect
{%- else %} {{ location | title }} Protect
{%- endif -%}
{%- endmacro -%}

Expand Down
4 changes: 4 additions & 0 deletions custom_templates/schedule.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,8 @@ You're either very late or very early. Figure it out dude.
{%- else %}
Check the clock! Your time to leave for work can not be determined today!
{%- endif -%}
{%- endmacro -%}

{%- macro twelve_hour(entity) -%}
{{- states(entity) | as_timestamp(none) | timestamp_custom('%-I:%M %p', true, none) -}}
{%- endmacro -%}
78 changes: 0 additions & 78 deletions custom_templates/speech.jinja

This file was deleted.

4 changes: 0 additions & 4 deletions custom_templates/speech_helpers.jinja
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
{%- macro twelve_hour(entity) -%}
{{- states(entity) | as_timestamp(none) | timestamp_custom('%-I:%M %p', true, none) -}}
{%- endmacro -%}

{%- macro cardinal_direction(bearing) %}
{%- set bearing = bearing | int(-1) %}
{%- set directions = ['N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S',
Expand Down
18 changes: 18 additions & 0 deletions custom_templates/weather.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,24 @@ Be careful driving and
}
{%- endmacro -%}

{%- macro precipitation_intensity_color(intensity) -%}
:host {
--paper-item-icon-color:
{%- set intensity = intensity | int(none) %}
{%- if intensity == none %} var(--entity-disabled-color)
{%- elif intensity == 0 %} var(--state-icon-color)
{%- elif intensity < 1 %} rgb(60, 116, 160)
{%- elif intensity < 4 %} rgb(59, 161, 161)
{%- elif intensity < 15 %} rgb(59, 161, 61)
{%- elif intensity < 20 %} rgb(130, 161, 59)
{%- elif intensity < 30 %} rgb(161, 59, 59)
{%- elif intensity < 50 %} rgb(161, 59, 161)
{%- else %} rgb(148, 79, 237)
{%- endif %}
;
}
{%- endmacro -%}

{%- macro wind_color(wind) -%}
:host {
--paper-item-icon-color:
Expand Down
Loading

0 comments on commit 85c9a90

Please sign in to comment.