Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
aneisch committed Feb 6, 2024
1 parent 5cda1c5 commit 5f7551c
Show file tree
Hide file tree
Showing 11 changed files with 94 additions and 50 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![Build Status](https://github.com/aneisch/home-assistant-config/actions/workflows/check-ha-release-compatibility.yml/badge.svg)](https://github.com/aneisch/home-assistant-config/actions)
[![GitHub last commit](https://img.shields.io/github/last-commit/aneisch/home-assistant-config)](https://github.com/aneisch/home-assistant-config/commits/master)
[![GitHub commit activity](https://img.shields.io/github/commit-activity/y/aneisch/home-assistant-config)](https://github.com/aneisch/home-assistant-config/graphs/commit-activity)
[![HA Version](https://img.shields.io/badge/Running%20Home%20Assistant-2024.1.6%20(Latest)-brightgreen)](https://github.com/home-assistant/home-assistant/releases/latest)
[![HA Version](https://img.shields.io/badge/Running%20Home%20Assistant%20-2024.2.0b8%20(Out%20of%20Date)-Red)](https://github.com/home-assistant/home-assistant/releases/latest)
<br><a href="https://www.buymeacoffee.com/aneisch" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-black.png" width="150px" height="35px" alt="Buy Me A Coffee" style="height: 35px !important;width: 150px !important;" ></a>


Expand Down Expand Up @@ -57,25 +57,25 @@ Also using Grafana/Influx for graphing, both running in Docker containers on NUC
Description | value
-- | --
Lines of ESPHome YAML | 2801
Lines of Home Assistant YAML | 9006
Lines of Home Assistant YAML | 9050
[Integrations](https://www.home-assistant.io/integrations/) in use | 56
Zigbee devices in [`zha`](https://www.home-assistant.io/integrations/zha/) | 26
Z-Wave devices in [`zwave_js`](https://www.home-assistant.io/integrations/zwave_js/) | 37

Description | value
-- | --
Entities in the [`automation`](https://www.home-assistant.io/components/automation) domain | 117
Entities in the [`binary_sensor`](https://www.home-assistant.io/components/binary_sensor) domain | 145
Entities in the [`binary_sensor`](https://www.home-assistant.io/components/binary_sensor) domain | 148
Entities in the [`button`](https://www.home-assistant.io/components/button) domain | 17
Entities in the [`camera`](https://www.home-assistant.io/components/camera) domain | 13
Entities in the [`camera`](https://www.home-assistant.io/components/camera) domain | 14
Entities in the [`climate`](https://www.home-assistant.io/components/climate) domain | 1
Entities in the [`counter`](https://www.home-assistant.io/components/counter) domain | 1
Entities in the [`cover`](https://www.home-assistant.io/components/cover) domain | 13
Entities in the [`device_tracker`](https://www.home-assistant.io/components/device_tracker) domain | 3
Entities in the [`event`](https://www.home-assistant.io/components/event) domain | 50
Entities in the [`fan`](https://www.home-assistant.io/components/fan) domain | 3
Entities in the [`group`](https://www.home-assistant.io/components/group) domain | 17
Entities in the [`image`](https://www.home-assistant.io/components/image) domain | 8
Entities in the [`image`](https://www.home-assistant.io/components/image) domain | 9
Entities in the [`input_boolean`](https://www.home-assistant.io/components/input_boolean) domain | 28
Entities in the [`input_datetime`](https://www.home-assistant.io/components/input_datetime) domain | 34
Entities in the [`input_number`](https://www.home-assistant.io/components/input_number) domain | 6
Expand All @@ -91,17 +91,17 @@ Entities in the [`remote`](https://www.home-assistant.io/components/remote) doma
Entities in the [`scene`](https://www.home-assistant.io/components/scene) domain | 2
Entities in the [`script`](https://www.home-assistant.io/components/script) domain | 55
Entities in the [`select`](https://www.home-assistant.io/components/select) domain | 3
Entities in the [`sensor`](https://www.home-assistant.io/components/sensor) domain | 397
Entities in the [`sensor`](https://www.home-assistant.io/components/sensor) domain | 446
Entities in the [`siren`](https://www.home-assistant.io/components/siren) domain | 1
Entities in the [`sun`](https://www.home-assistant.io/components/sun) domain | 1
Entities in the [`switch`](https://www.home-assistant.io/components/switch) domain | 163
Entities in the [`switch`](https://www.home-assistant.io/components/switch) domain | 167
Entities in the [`timer`](https://www.home-assistant.io/components/timer) domain | 6
Entities in the [`tts`](https://www.home-assistant.io/components/tts) domain | 1
Entities in the [`update`](https://www.home-assistant.io/components/update) domain | 3
Entities in the [`update`](https://www.home-assistant.io/components/update) domain | 35
Entities in the [`vacuum`](https://www.home-assistant.io/components/vacuum) domain | 1
Entities in the [`weather`](https://www.home-assistant.io/components/weather) domain | 2
Entities in the [`zone`](https://www.home-assistant.io/components/zone) domain | 6
**Total state objects** | **1202**
**Total state objects** | **1292**
## The HACS integrations/plugins that I use:
**Appdaemon**:<br>
[aneisch/follow_me_appdaemon](https://github.com/aneisch/follow_me_appdaemon)<br>
Expand Down
2 changes: 1 addition & 1 deletion custom_components/frigate/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
"iot_class": "local_push",
"issue_tracker": "https://github.com/blakeblackshear/frigate-hass-integration/issues",
"requirements": ["pytz==2022.7"],
"version": "5.0.0"
"version": "5.0.1"
}
2 changes: 1 addition & 1 deletion custom_components/frigate/media_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ def _build_event_response(
),
media_class=identifier.media_class,
media_content_type=identifier.media_type,
title=f"{dt.datetime.fromtimestamp(event['start_time'], DEFAULT_TIME_ZONE).strftime(DATE_STR_FORMAT)} [{duration}s, {event['label'].capitalize()} {int(event['data']['top_score']*100)}%]",
title=f"{dt.datetime.fromtimestamp(event['start_time'], DEFAULT_TIME_ZONE).strftime(DATE_STR_FORMAT)} [{duration}s, {event['label'].capitalize()} {int((event['data'].get('top_score') or event['top_score'])*100)}%]",
can_play=identifier.media_type == MEDIA_TYPE_VIDEO,
can_expand=False,
thumbnail=f"/api/frigate/{identifier.frigate_instance_id}/thumbnail/{event['id']}",
Expand Down
18 changes: 8 additions & 10 deletions custom_components/setter/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import logging
import asyncio

from homeassistant.core import Context
from homeassistant.helpers.restore_state import RestoreEntity
Expand Down Expand Up @@ -78,13 +77,12 @@ def state_attributes(self):
def state(self):
return len(self._entities_db)

@asyncio.coroutine
def async_added_to_hass(self):
state = yield from self.async_get_last_state()
if (
state is not None
and state.attributes is not None
and not isinstance(state.attributes["entities"], list)
and "entities" in state.attributes
):

async def async_added_to_hass(self):
state = await self.async_get_last_state()
if state is not None \
and state.attributes is not None \
and "variables" in state.attributes and not isinstance(state.attributes["entities"], list) \
and "entities" in state.attributes and not isinstance(state.attributes["variables"], list):
self._variables_db = state.attributes["variables"]
self._entities_db = state.attributes["entities"]
2 changes: 1 addition & 1 deletion extras/docker-compose/homeassistant/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.2'
services:
homeassistant:
container_name: homeassistant
image: ghcr.io/home-assistant/home-assistant:stable
image: ghcr.io/home-assistant/home-assistant:beta
labels:
- com.centurylinklabs.watchtower.monitor-only=true
# HTTPS for CF
Expand Down
5 changes: 3 additions & 2 deletions extras/docker-compose/other/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ services:
environment:
- MODE=native
- TZ=America/Chicago
- AUTO_RECEIVE_SCHEDULE=0 22 * * *
ports:
- "127.0.0.1:8800:8080" # Expose localhost only for Home Assistant
#- "8808:8080"
Expand Down Expand Up @@ -499,8 +500,8 @@ services:
container_name: frigate
privileged: true
restart: always
#image: ghcr.io/blakeblackshear/frigate:stable
image: ghcr.io/blakeblackshear/frigate:0.13.0-beta7
image: ghcr.io/blakeblackshear/frigate:stable
#image: ghcr.io/blakeblackshear/frigate:0.13.0-beta7
shm_size: "128mb"
devices:
- /dev/bus/usb:/dev/bus/usb
Expand Down
7 changes: 4 additions & 3 deletions extras/docker-compose/unified/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3.2'
services:
homeassistant:
container_name: homeassistant
image: ghcr.io/home-assistant/home-assistant:stable
image: ghcr.io/home-assistant/home-assistant:beta
labels:
- com.centurylinklabs.watchtower.monitor-only=true
# HTTPS for CF
Expand Down Expand Up @@ -584,6 +584,7 @@ services:
environment:
- MODE=native
- TZ=America/Chicago
- AUTO_RECEIVE_SCHEDULE=0 22 * * *
ports:
- "127.0.0.1:8800:8080" # Expose localhost only for Home Assistant
#- "8808:8080"
Expand Down Expand Up @@ -705,8 +706,8 @@ services:
container_name: frigate
privileged: true
restart: always
#image: ghcr.io/blakeblackshear/frigate:stable
image: ghcr.io/blakeblackshear/frigate:0.13.0-beta7
image: ghcr.io/blakeblackshear/frigate:stable
#image: ghcr.io/blakeblackshear/frigate:0.13.0-beta7
shm_size: "128mb"
devices:
- /dev/bus/usb:/dev/bus/usb
Expand Down
2 changes: 1 addition & 1 deletion extras/traefik/traefik.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ providers:
exposedByDefault: false
file:
directory: "/etc/traefik"
watch: true
watch: true
11 changes: 5 additions & 6 deletions packages/frigate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ automation:

- alias: Front Door on Photo Frame
id: "front_door_on_photo_frame"
mode: restart
mode: 'single'
trigger:
- platform: mqtt
topic: frigate/events
Expand All @@ -79,11 +79,10 @@ automation:
action:
- service: script.photo_frame_launch_front_door_stream
data:
delay: "00:00:10" # This has to finish before we proceed here
entity_id: media_player.kitchen_photo_frame
- service: script.photo_frame_launch_fotoo
data:
entity_id: media_player.kitchen_photo_frame
delay: "00:00:30" # How long to show video
entity_id:
- media_player.kitchen_photo_frame
- media_player.office_photo_frame

- alias: Frigate Notification Deliveries
id: "frigate_notification_deliveries"
Expand Down
74 changes: 60 additions & 14 deletions packages/photo_frames.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ automation:
id: start_fotoo
mode: "parallel"
trigger:
- platform: state
entity_id: media_player.office_photo_frame
from: "unavailable"
- platform: state
entity_id: media_player.kitchen_photo_frame
from: "unavailable"
- platform: state
entity_id:
from: "unavailable"
- media_player.office_photo_frame
- media_player.kitchen_photo_frame
- media_player.misc_photo_frame
from:
- "unavailable"
- "unknown"
action:
- service: script.photo_frame_launch_fotoo
data:
Expand Down Expand Up @@ -71,19 +70,54 @@ script:
entity_id: "{{ entity_id }}"

photo_frame_launch_front_door_stream:
mode: 'restart'
mode: 'single'
sequence:
- variables:
token: "{{ state_attr('camera.front_door_test','access_token')}}"
- service: androidtv.adb_command
target:
entity_id: "{{ entity_id }}"
data:
command: "am start -a android.intent.action.VIEW -d 'http://10.0.1.22:8123/api/camera_proxy_stream/camera.front_door_test?token={{ token }}'"
- delay: "{{ delay | default('00:30:00')}}" # If we launch it manually, time out after 30 minutes by default. Override by passing delay to this service
- service: script.photo_frame_launch_fotoo
# https://xdaforums.com/t/how-to-load-full-desktop-websites-permanently-in-chrome-for-android.3771982/post-78875887
command: "am start -a com.google.android.apps.chrome.ACTION_CLOSE_TABS -n com.android.chrome/org.chromium.chrome.browser.ChromeTabbedActivity"
- service: androidtv.adb_command
target:
entity_id: "{{ entity_id }}"
data:
#command: "am start -a android.intent.action.VIEW -d 'http://10.0.1.22:8123/api/camera_proxy_stream/camera.front_door_test?token={{ state_attr('camera.front_door_test','access_token')}}'"
command: "am start -n com.android.chrome/com.google.android.apps.chrome.Main -a android.intent.action.VIEW -d 'http://frigatelocal/live/webrtc/webrtc.html?src=front_door_twoway'"
- delay: "00:00:05"
- service: androidtv.adb_command
target:
entity_id: "{{ entity_id }}"
data:
command: "input tap 200 200" # Random Tap
- service: androidtv.adb_command
target:
entity_id: "{{ entity_id }}"
data:
command: "input tap 1850 1033" # Full Screen
# - service: androidtv.adb_command
# target:
# entity_id: "{{ entity_id }}"
# data:
# command: "input tap 1760 1033" # Unmute
# - service: androidtv.adb_command
# target:
# entity_id: "{{ entity_id }}"
# data:
# command: "input tap 1760 1033" # Unmute
- delay: "{{ delay | default('00:00:30')}}" # If we launch it manually, time out after 30 minutes by default. Override by passing delay to this service
# In case we were showing timers before..
- if: "{{ is_state('input_boolean.kitchen_timers_showing','on') }}"
then:
- service: script.photo_frame_launch_timers
data:
entity_id:
- media_player.kitchen_photo_frame
- media_player.office_photo_frame
else:
- service: script.photo_frame_launch_fotoo
data:
entity_id: "{{ entity_id }}"

photo_frame_launch_url:
mode: 'restart'
Expand All @@ -105,4 +139,16 @@ script:
target:
entity_id: "{{ entity_id }}"
data:
command: "adb shell am start -n com.android.chrome/com.google.android.apps.chrome.Main -a android.intent.action.VIEW -d 'http://10.0.1.22:8123/lovelace/timers?wp_enabled=true'"
# https://xdaforums.com/t/how-to-load-full-desktop-websites-permanently-in-chrome-for-android.3771982/post-78875887
command: "am start -a com.google.android.apps.chrome.ACTION_CLOSE_TABS -n com.android.chrome/org.chromium.chrome.browser.ChromeTabbedActivity"
- service: androidtv.adb_command
target:
entity_id: "{{ entity_id }}"
data:
command: "am start -n com.android.chrome/com.google.android.apps.chrome.Main -a android.intent.action.VIEW -d 'http://10.0.1.22:8123/lovelace/timers?wp_enabled=true'"
- delay: "00:00:15"
- service: androidtv.adb_command
target:
entity_id: "{{ entity_id }}"
data:
command: "input tap 50 200" # tap on screen to make fullscreen
3 changes: 1 addition & 2 deletions packages/timers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ automation:
- media_player.office_photo_frame
data:
# https://xdaforums.com/t/how-to-load-full-desktop-websites-permanently-in-chrome-for-android.3771982/post-78875887
command: "adb shell am start -a com.google.android.apps.chrome.ACTION_CLOSE_TABS -n com.android.chrome/org.chromium.chrome.browser.ChromeTabbedActivity"
- delay: "00:00:02"
command: "am start -a com.google.android.apps.chrome.ACTION_CLOSE_TABS -n com.android.chrome/org.chromium.chrome.browser.ChromeTabbedActivity"
- service: script.photo_frame_launch_fotoo
data:
entity_id:
Expand Down

0 comments on commit 5f7551c

Please sign in to comment.