Skip to content

Commit

Permalink
ui, doorbell, media player, readme
Browse files Browse the repository at this point in the history
- Fix living room universal remote when smarttube is idle
- Add "Reset Stuck Doorbell Ring" automation when doorbell ring is stuck on
- Fix debug output for Frigate notifications
- Update readme
- UI:
  - Use state_translated in some places
  - Add VOC to air quality
  • Loading branch information
zanix committed May 1, 2024
1 parent 94ef3a8 commit 817ed36
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 50 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -559,14 +559,15 @@ A Material You and Google Home app influenced theme for Home Assistant
- [Leviton ZW4SF-1BW Smart 4 Speed Fan Controller](https://www.amazon.com/dp/B08GQJWSRG)
- [Philips Hue Dimmer Remote 324131092621](https://www.amazon.com/dp/B0167Z0P3I)
- [Rachio Sprinkler Controller](https://www.amazon.com/dp/B01D1NMLJU) - Smart Sprinkler controller
- [SONOFF S31 Lite 15A Zigbee Smart Plug](https://www.amazon.com/dp/B08Y87WD1X) - Smart plug
- [SONOFF S31 Lite 15A Zigbee Smart Plug](https://www.amazon.com/dp/B08Y87WD1X) - Smart plug
- [Tasmota](https://tasmota.github.io/docs/) - Flashed devices
- [THIRDREALITY ZigBee Smart Plug Gen2](https://www.amazon.com/dp/B0BPY5D1KC) - Smart plug with power monitoring
- [Zooz Titan Water Valve Actuator](https://www.thesmartesthouse.com/products/zooz-z-wave-plus-700-series-titan-water-valve-actuator-zac36) - Control the water main

### Camera

- [Amcrest AD410 Doorbell](https://www.amazon.com/dp/B091KMT9GB)
- [Wyze Cam v2](https://www.amazon.com/dp/B09XJ36RP2)
- [Tapo C210 2K Pan/Tilt Camera](https://www.amazon.com/dp/B09Y8TLP25/)

### Media

Expand Down Expand Up @@ -603,7 +604,7 @@ A Material You and Google Home app influenced theme for Home Assistant

> For more details, see the [automations.xml][automations] file and `automation:` blocks in [integrations].
<details><summary>157 Automations</summary>
<details><summary>158 Automations</summary>

- ⏯ Ensure PiPup is Running
- ⏯ Family Room Media Auto Off
Expand Down Expand Up @@ -746,6 +747,7 @@ A Material You and Google Home app influenced theme for Home Assistant
- 🔔 Doorbell Ring
- 🔔 Frigate Doorbell - Event Handler
- 🔔 Frigate Doorbell - Object Seen
- 🔔 Reset Stuck Doorbell Ring
- 🖥️ [Ardena] Power Actions
- 🖥️ [Ardena] Power on Activity
- 🖥️ [Ardena] Sleep When Harmony Off
Expand Down
44 changes: 22 additions & 22 deletions automations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4027,26 +4027,26 @@
data:
title: Frigate Notification
message: "Info:\n - FPS: {{ fps }}\n - Frigate event Id: {{ id }}\n
\ - Object (formatted): {{ object }} ({{ label }})\nConfig:\n - Camera(formatted):
{{ camera }}({{ camera_name }})\n - Base URL: {{ base_url }}\n -
Alert once: {{ alert_once }}\n - Update thumbnails: {{ update_thumbnail
}}\n - Clip: {{ clip }}\n - Icon: {{ icon }}\n - Cooldown: {{ cooldown
}}s\n - Loiter timer: {{ loiter_timer }}s\n - Title: {{ title }}\n
\ - Message: {{ message }}\n - Actions: {{ actions | tojson }}\nFilters:\n
\ - Zones:\n - Zone filter on: {{ zones | length }}\n - Required
zones: {{ zones | join(', ') }}\n - All Zones on: {{ zone_all }}\n
\ - Entered Zones: {{ entered_zones }}\n - Zone Filter TEST:
{{ 'PASS (Multi)' if zone_multi_filter else 'PASS' if ( not zones
| length or not zone_all and zones | select('in', entered_zones) |
list | length ) else 'FAIL (Multi)' if zone_all else 'FAIL' }}\n -
Required objects TEST:\n - Labels: {{ labels | join(', ') }}\n
\ - TEST: {{ 'PASS' if not labels | length or object in labels else
'FAIL' }}\n - Disabled times: {{ disable_times }}\n - State Filter:\n
\ - State filter on: {{ iif(state_entities | list | count > 0, 'True',
'False') }}\n - State filter entity: {{ state_entities | tojson
}}\n - Required states: {{ states_filter | join(', ') }}\n {%-
set state_filter = namespace(allow=[]) -%}\n {%- for entity, time
in state_entities.items() -%}\n {%- set state =\n states(entity)
\ - Object (Formatted): {{ object }} ({{ label }})\n\nConfig:\n -
Camera (Formatted): {{ camera }} ({{ camera_name }})\n - Base URL:
{{ base_url }}\n - Alert once: {{ alert_once }}\n - Update thumbnails:
{{ update_thumbnail }}\n - Clip: {{ clip }}\n - Icon: {{ icon }}\n
\ - Cooldown: {{ cooldown }}s\n - Loiter timer: {{ loiter_timer }}s\n
\ - Title: {{ title }}\n - Message: {{ message }}\n - Actions: {{
actions | tojson }}\n\nFilters:\n - Zones:\n - Zone filter on:
{{ zones | length }}\n - Required zones: {{ zones | join(', ')
}}\n - All Zones on: {{ zone_all }}\n - Entered Zones: {{ entered_zones
}}\n - Zone Filter TEST: {{ 'PASS (Multi)' if zone_multi_filter
else 'PASS' if ( not zones | length or not zone_all and zones | select('in',
entered_zones) | list | length ) else 'FAIL (Multi)' if zone_all else
'FAIL' }}\n - Required objects TEST:\n - Labels: {{ labels | join(',
') }}\n - TEST: {{ 'PASS' if not labels | length or object in labels
else 'FAIL' }}\n - Disabled times: {{ disable_times }}\n - State
Filter:\n - State filter on: {{ iif(state_entities | list | count
> 0, 'True', 'False') }}\n - State filter entity: {{ state_entities
| tojson }}\n - Required states: {{ states_filter | join(', ')
}}\n {%- set state_filter = namespace(allow=[]) -%}\n {%- for entity,
time in state_entities.items() -%}\n {%- set state =\n states(entity)
in states_filter\n and (as_timestamp(now()) - as_timestamp(states[entity].last_changed))
| int / 60 > time\n -%}\n {%- set state_filter.allow = state_filter.allow
+ [state] -%}\n {%- endfor %}\n - State Filter TEST: {{ iif(state_filter.allow
Expand Down Expand Up @@ -4159,10 +4159,10 @@
message: "Info:\n - Last zones: {{ last_zones }}\n - Current zones:
{{ entered_zones }}\n - Sublabel: {{ sub_label }}\n - URL: api/frigate/notifications/{{
id }}/{{ camera + '/clip.mp4' if clip | length > 0 and wait.trigger.payload_json['type']
== 'end' else attachment + '.jpg' }}\n - Clip: \"{{ clip }}\"\nTriggers:\n
== 'end' else attachment }}\n - Clip: \"{{ clip }}\"\n\nTriggers:\n
\ - New snapshot: {{ new_snapshot }}\n - Stationary moved: {{
stationary_moved }}\n - Entered zones changed: {{ entered_zones_changed
}}\n - Sublabel changed: {{ sub_label_changed }}\nConditions:\n
}}\n - Sublabel changed: {{ sub_label_changed }}\n\nConditions:\n
\ - Loitering: {{ loitering }}\n - Zone filter test: {{ 'ON'
if zones | length else 'OFF' }} - {{ 'PASS' if zone_filter else
'FAIL' }}\n - Multi-zone filter: {{ 'OFF' if not zones | length
Expand Down
8 changes: 5 additions & 3 deletions entities/media_player/universal_living_room.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ children:
- media_player.cast_living_room
- media_player.androidtv_living_room
state_template: >-
{%- if not states('media_player.plex_living_room') in ['standby', 'off', 'unknown', 'unavailable'] -%}
{{ states('media_player.plex_living_room') }}
{%- if not states("media_player.plex_living_room") in ["standby", "off", "unknown", "unavailable"] -%}
{{ states("media_player.plex_living_room") }}
{%- elif not is_state("media_player.androidtv_living_room", "off") and is_state("media_player.cast_living_room", "off") -%}
{{ states("media_player.shield_living_room") }}
{%- else -%}
{{ states('media_player.cast_living_room') }}
{{ states("media_player.cast_living_room") }}
{%- endif -%}
browse_media_entity: media_player.cast_living_room
attributes:
Expand Down
23 changes: 23 additions & 0 deletions packages/amcrest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,26 @@ switch:
password: !secret amcrest_password
setting: ExternalDoorBell.Enable
value: 'false'

automation:
- id: amcrest_reset_stuck_doorbell_ring
alias: 🔔 Reset Stuck Doorbell Ring
description: Resets the doorbell ring when stuck.
trigger:
- platform: state
entity_id:
- binary_sensor.doorbell_ring
for:
minutes: 5
to: "on"
condition: []
action:
- event: amcrest
event_data:
camera: Doorbell
event: AlarmLocal
payload:
Code: AlarmLocal
action: Stop
alias: Reset doorbell ring
mode: restart
5 changes: 3 additions & 2 deletions templates/README.j2
Original file line number Diff line number Diff line change
Expand Up @@ -376,14 +376,15 @@ Authors: {% for author in authors -%}[{{ author }}](https://github.com/{{ author
- [Leviton ZW4SF-1BW Smart 4 Speed Fan Controller](https://www.amazon.com/dp/B08GQJWSRG)
- [Philips Hue Dimmer Remote 324131092621](https://www.amazon.com/dp/B0167Z0P3I)
- [Rachio Sprinkler Controller](https://www.amazon.com/dp/B01D1NMLJU) - Smart Sprinkler controller
- [SONOFF S31 Lite 15A Zigbee Smart Plug](https://www.amazon.com/dp/B08Y87WD1X) - Smart plug
- [SONOFF S31 Lite 15A Zigbee Smart Plug](https://www.amazon.com/dp/B08Y87WD1X) - Smart plug
- [Tasmota](https://tasmota.github.io/docs/) - Flashed devices
- [THIRDREALITY ZigBee Smart Plug Gen2](https://www.amazon.com/dp/B0BPY5D1KC) - Smart plug with power monitoring
- [Zooz Titan Water Valve Actuator](https://www.thesmartesthouse.com/products/zooz-z-wave-plus-700-series-titan-water-valve-actuator-zac36) - Control the water main

### Camera

- [Amcrest AD410 Doorbell](https://www.amazon.com/dp/B091KMT9GB)
- [Wyze Cam v2](https://www.amazon.com/dp/B09XJ36RP2)
- [Tapo C210 2K Pan/Tilt Camera](https://www.amazon.com/dp/B09Y8TLP25/)

### Media

Expand Down
56 changes: 36 additions & 20 deletions ui-lovelace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,8 @@ decluttering_templates:
type: custom:mushroom-template-card
entity: '[[entity]]'
primary: '[[name]]'
secondary: '{% from "util.jinja" import nominal_change_history %} {{ iif(is_state(entity,
"on"), "Open", "Closed") }} ⸱ {{ nominal_change_history(entity) }}'
secondary: '{% from "util.jinja" import nominal_change_history %} {{ state_translated(entity)
}} ⸱ {{ nominal_change_history(entity) }}'
icon: '[[icon]]{{ iif(is_state(entity, "on"), "-open", "") }}'
icon_color: '{{ iif(is_state(entity, "on"), "red", "green") }}'
tap_action:
Expand Down Expand Up @@ -570,8 +570,8 @@ decluttering_templates:
- type: custom:mushroom-title-card
alignment: center
title: "{% set entity = \"[[entity]]\" %} {% if states(entity)\
\ in [\"playing\", \"paused\", \"standby\"] %}\n {{ states(entity)\
\ | title }}\n{% endif %}"
\ in [\"playing\", \"paused\", \"standby\"] %}\n {{ state_translated(entity)\
\ }}\n{% endif %}"
card_mod:
style:
.: "ha-card {\n --ha-card-box-shadow: none;\n}\nh1 {\n text-shadow:\
Expand Down Expand Up @@ -1165,7 +1165,7 @@ decluttering_templates:
entity: sensor.[[watch_base]]_[[person]]_activity_state
layout: vertical
primary: Activity
secondary: '{{ states(entity) }}'
secondary: '{{ states(entity) | title }}'
icon: mdi:account-reactivate
icon_color: pink
tap_action:
Expand Down Expand Up @@ -2957,6 +2957,23 @@ views:
- color: var(--red-color)
from: '50'
to: '100'
- entity: sensor.airgradient_kitchen_voc_index
name: VOC
min: 0
max: 500
severity:
- color: var(--green-color)
from: '0'
to: '150'
- color: var(--yellow-color)
from: '150'
to: '250'
- color: var(--orange-color)
from: '250'
to: '400'
- color: var(--red-color)
from: '400'
to: '500'
- type: vertical-stack
cards:
- type: custom:mushroom-title-card
Expand Down Expand Up @@ -5362,6 +5379,7 @@ views:
- type: tile
entity: light.office_shelf_led
name: Shelf
vertical: true
- type: custom:mini-media-player
entity: media_player.cast_office_speaker
name: Google Home
Expand Down Expand Up @@ -6122,7 +6140,7 @@ views:
\ 13px;\n --mush-icon-size: 2.84em;\n --mush-icon-symbol-size: 1.3em;\n\
}\nha-card {\n transition: all 0s;\n padding-bottom: 0 !important;\n\
}\nmushroom-shape-icon {\n position: absolute;\n top: -57px;\n \
\ left: -40px;\n}\nmushroom-state-info {\n padding-left: 34px;\n\
\ left: -40px;\n}\nmushroom-state-info {\n padding-left: 64px;\n\
\ z-index: 1;\n}\n"
- type: custom:mushroom-chips-card
alignment: end
Expand Down Expand Up @@ -8823,18 +8841,17 @@ views:
service: browser_mod.more_info
card_mod:
style:
mushroom-shape-icon$: "{% if (states(\"sensor.front_door_contact_battery_level\"\
) | int) <= 60 %} {% from \"util.jinja\" import battery_color\
\ %} .shape {\n /* Radial progress bar */\n background:\n\
\ radial-gradient(var(--card-background-color) 60%, transparent\
\ calc(60% + 1px)),\n conic-gradient(var(--{{ battery_color(\"\
sensor.front_door_contact_battery_level\") }}-color) {{\
\ states(\"sensor.front_door_contact_battery_level\") }}%\
\ 0%, var(--card-background-color) 0% 100%\n );\n} .shape:after\
\ {\n /* Add back icon shape */\n content: \"\";\n height:\
\ 100%;\n width: 100%;\n position: absolute;\n border-radius:\
\ var(--icon-border-radius);\n background: var(--shape-color);\n\
} {% endif %}"
mushroom-shape-icon$: "{% set battery_entity = \"sensor.front_door_contact_battery_level\"\
\ %} {% if (states(battery_entity) | int) <= 60 %} {% from\
\ \"util.jinja\" import battery_color %} .shape {\n /*\
\ Radial progress bar */\n background:\n radial-gradient(var(--card-background-color)\
\ 60%, transparent calc(60% + 1px)),\n conic-gradient(var(--{{\
\ battery_color(battery_entity) }}-color) {{ states(battery_entity)\
\ }}% 0%, var(--card-background-color) 0% 100%\n );\n}\
\ .shape:after {\n /* Add back icon shape */\n content:\
\ \"\";\n height: 100%;\n width: 100%;\n position: absolute;\n\
\ border-radius: var(--icon-border-radius);\n background:\
\ var(--shape-color);\n} {% endif %}"
- type: custom:layout-card
layout_type: custom:grid-layout
layout:
Expand Down Expand Up @@ -8886,9 +8903,8 @@ views:
- type: custom:mushroom-template-card
entity: cover.opengarage
primary: Garage Door
multiline_secondary: true
secondary: '{% from "util.jinja" import nominal_change_history
%} {{ states(entity) | title }} ⸱ {{ nominal_change_history(entity)
%} {{ state_translated(entity) }} ⸱ {{ nominal_change_history(entity)
}}'
icon: "{% if is_state(entity, \"open\") %}\n mdi:garage-open-variant\n\
{% elif states(entity) in [\"opening\", \"closing\"] %}\n mdi:garage-alert-variant\n\
Expand Down

0 comments on commit 817ed36

Please sign in to comment.