diff --git a/config/automation/driveway_parked_car.yaml b/config/automation/driveway_parked_car.yaml index 0d89f73f..547a4b05 100644 --- a/config/automation/driveway_parked_car.yaml +++ b/config/automation/driveway_parked_car.yaml @@ -4,7 +4,7 @@ # Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig # ------------------------------------------------------------------- # Driveway Parked Car Alert - notify when a car remains in the driveway zone. -# Sends a camera-backed parent alert and an LLM-processed announcement. +# Sends alerts and starts the shared ten-minute kiosk camera takeover. # Video: https://youtu.be/X9qrywP3XS0 # Blog: https://www.vcloudinfo.com/2026/09/home-assistant-frigate-driveway-car-alert.html # ------------------------------------------------------------------- @@ -12,13 +12,16 @@ # this occupancy sensor turns on. Configure the driveway camera's review # alerts and detections with required_zones: [driveway-zone] so street # traffic does not create camera-wide review items. +# Notes: The kiosk takeover clears with occupancy or after ten minutes, +# whichever happens first; Garage and Front Door keep higher priority. ###################################################################### - alias: 'Driveway Parked Car Alert' id: a80df6e2-fba8-44a6-b9ee-bd8c7d83a8a5 description: >- Notify Carlo and Stacey and announce when Frigate confirms a car has - remained in the driveway-zone for at least 30 seconds. + remained in the driveway-zone for at least 30 seconds, while showing + the Driveway camera on both household kiosks for at most ten minutes. mode: single triggers: - trigger: occupancy.detected @@ -26,6 +29,11 @@ entity_id: binary_sensor.driveway_zone_car_occupancy actions: + - action: script.turn_on + continue_on_error: true + target: + entity_id: script.kiosk_driveway_camera_takeover + - action: script.notify_engine continue_on_error: true data: diff --git a/config/dashboards/bedroom/partials/home_cards.yaml b/config/dashboards/bedroom/partials/home_cards.yaml index f3adf3ab..a453e24b 100644 --- a/config/dashboards/bedroom/partials/home_cards.yaml +++ b/config/dashboards/bedroom/partials/home_cards.yaml @@ -9,6 +9,7 @@ # Related Issue: 1875 # Notes: No current-time clock; both nightstands already provide visible clocks. # Notes: Full-screen event cameras replace the default status/camera/alert bands. +# Notes: Driveway alerts clear with occupancy or after ten minutes, whichever is first. # Video: https://youtu.be/ChgEu0IDWzc ###################################################################### @@ -38,6 +39,18 @@ aspect_ratio: "2:1" entities: [] + - type: conditional + conditions: + - entity: sensor.kiosk_active_camera_view + state: driveway + card: + type: picture-glance + title: Driveway Alert + camera_image: camera.driveway + camera_view: live + aspect_ratio: "2:1" + entities: [] + # Bedroom context is intentionally distinct from Kitchen's clock/forecast banner. - type: conditional conditions: diff --git a/config/dashboards/kiosk_satellite_staging/partials/home_sections.yaml b/config/dashboards/kiosk_satellite_staging/partials/home_sections.yaml index 2579ffe7..b51d7cf5 100644 --- a/config/dashboards/kiosk_satellite_staging/partials/home_sections.yaml +++ b/config/dashboards/kiosk_satellite_staging/partials/home_sections.yaml @@ -11,6 +11,7 @@ # Notes: Three-row landscape layout uses full-width clock and alert banners around the camera row. # Notes: Camera cards use automatic streaming to limit idle tablet load. # Notes: Native Garage and Front Door views take over for their matching live states. +# Notes: Driveway alerts use a full-view live card until occupancy clears or ten minutes elapse. # Notes: Kitchen Show Kiosk Satellite imports the HA camera sources and prefers HLS for native camera playback on Fire/WebView displays. # Notes: Nearby rain or lightning starts a five-minute NOAA radar view only while the sun is above the horizon. # Notes: After radar returns to the ambient wall, Storms Approaching offers another five-minute replay from the lower banner. @@ -1295,3 +1296,19 @@ width: 100% view_layout: grid-area: 1 / 1 / 4 / 3 + + # A core conditional picture card is required for the Driveway source, + # which is not configured as a native Kiosk Satellite camera shortcut. + - type: conditional + conditions: + - entity: sensor.kiosk_active_camera_view + state: driveway + card: + type: picture-glance + title: Driveway Alert + camera_image: camera.driveway + camera_view: live + aspect_ratio: "16:10" + entities: [] + view_layout: + grid-area: 1 / 1 / 4 / 3 diff --git a/config/packages/kiosk_tablet.yaml b/config/packages/kiosk_tablet.yaml index d95ea7d4..4c4c9e8e 100644 --- a/config/packages/kiosk_tablet.yaml +++ b/config/packages/kiosk_tablet.yaml @@ -17,7 +17,7 @@ # Notes: Kiosk Satellite owns HA kiosk-mode hiding, connection recovery, HA camera import, and HLS-first playback; no kiosk-mode custom resource is loaded. # Notes: Kitchen Show uses the Dim screensaver while empty/asleep; true panel-off is disabled because this Crown build naps Wi-Fi and cannot accept a remote wake. # Notes: Kitchen Show volume is corrected to 13% at 08:00 and after HA or kiosk startup; manual changes otherwise persist. -# Notes: Garage takes over while either door is moving/open and remains for three minutes after both close; Front Door takes over while unlocked. +# Notes: Garage and Front Door retain priority; a Driveway alert takes over both kiosks until occupancy clears or ten minutes elapse. # Notes: At 07:00, Home Assistant stages a pending Kiosk Satellite release, then dispatches Joanna daily until installation is verified. # Notes: Wake events only restore brightness/focus; URL reloads require page drift. # Notes: Fully auto-reload on screen-on/screensaver-stop is disabled to avoid motion wake reload loops. @@ -50,6 +50,11 @@ timer: duration: "00:03:00" restore: false icon: mdi:card-text-outline + kiosk_driveway_camera_display: + name: "Kiosk Driveway Camera Display" + duration: "00:10:00" + restore: false + icon: mdi:car-search automation: - alias: "Bedroom Kiosk Tablet - Return to Kiosk View" @@ -427,6 +432,8 @@ template: garage {% elif is_state('lock.front_door', 'unlocked') %} front_door + {% elif is_state('timer.kiosk_driveway_camera_display', 'active') %} + driveway {% else %} none {% endif %} @@ -740,7 +747,7 @@ script: mode: restart variables: desired_view: >- - {{ {'garage': 'Garage', 'front_door': 'Front Door'}.get( + {{ {'garage': 'Garage', 'front_door': 'Front Door', 'driveway': 'Driveway'}.get( states('sensor.kiosk_active_camera_view'), 'none') }} desired_button: >- {{ 'button.kitchen_show_show_garage_2' @@ -759,6 +766,23 @@ script: data: event_type: camera show_button: "{{ desired_button }}" + - conditions: + - condition: template + value_template: "{{ desired_view == 'Driveway' }}" + sequence: + - choose: + - conditions: + - condition: template + value_template: >- + {{ states('sensor.kitchen_show_active_camera_view_2') + not in ['none', 'unknown', 'unavailable'] }} + sequence: + - service: button.press + target: + entity_id: button.kitchen_show_close_camera_view_2 + - service: script.kitchen_kiosk_show_event + data: + event_type: detail default: - choose: - conditions: diff --git a/config/script/kiosk_driveway_camera_takeover.yaml b/config/script/kiosk_driveway_camera_takeover.yaml new file mode 100644 index 00000000..d790c2f6 --- /dev/null +++ b/config/script/kiosk_driveway_camera_takeover.yaml @@ -0,0 +1,113 @@ +###################################################################### +# @CCOSTAN - Follow Me on X +# For more info visit https://www.vcloudinfo.com/click-here +# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig +# ------------------------------------------------------------------- +# Kiosk Driveway Camera Takeover - Wake and coordinate both displays +# Shows the live Driveway feed for the shorter of occupancy or ten minutes. +# ------------------------------------------------------------------- +# Notes: Garage and Front Door remain higher-priority camera states. +# Notes: Repeated activity keeps each kiosk visible without changing its idle settings. +###################################################################### + +kiosk_driveway_camera_takeover: + alias: "Kiosks - Show Driveway Camera" + description: >- + Show the Driveway camera on Kitchen and Bedroom until Frigate occupancy + clears or ten minutes elapse, while preserving higher-priority cameras. + mode: restart + variables: + bedroom_screen_was_on: "{{ is_state('switch.alarm_panel_1_screen', 'on') }}" + bedroom_screensaver_was_active: >- + {{ is_state('switch.alarm_panel_1_screensaver', 'on') }} + kitchen_screensaver_was_active: >- + {{ is_state('switch.kitchen_show_screensaver_active_2', 'on') }} + sequence: + - service: timer.start + target: + entity_id: timer.kiosk_driveway_camera_display + data: + duration: "00:10:00" + - delay: "00:00:01" + - parallel: + - sequence: + - if: + - condition: state + entity_id: binary_sensor.driveway_zone_car_occupancy + state: "on" + then: + - wait_for_trigger: + - platform: state + entity_id: binary_sensor.driveway_zone_car_occupancy + to: "off" + timeout: "00:10:00" + continue_on_timeout: true + - service: timer.cancel + target: + entity_id: timer.kiosk_driveway_camera_display + - sequence: + - repeat: + while: + - condition: state + entity_id: timer.kiosk_driveway_camera_display + state: active + sequence: + - parallel: + - service: automation.trigger + continue_on_error: true + target: + entity_id: automation.kitchen_kiosk_satellite_show_garage_camera + data: + skip_condition: true + - service: switch.turn_on + continue_on_error: true + target: + entity_id: switch.alarm_panel_1_screen + - service: switch.turn_off + continue_on_error: true + target: + entity_id: switch.alarm_panel_1_screensaver + - service: button.press + continue_on_error: true + target: + entity_id: button.alarm_panel_1_trigger_motion_activity + - service: button.press + continue_on_error: true + target: + entity_id: button.alarm_panel_1_bring_to_foreground + - delay: "00:00:45" + - service: automation.trigger + continue_on_error: true + target: + entity_id: automation.kitchen_kiosk_satellite_show_garage_camera + data: + skip_condition: true + - if: + - condition: state + entity_id: sensor.kiosk_active_camera_view + state: none + then: + - if: + - condition: template + value_template: "{{ kitchen_screensaver_was_active | bool }}" + then: + - service: switch.turn_on + continue_on_error: true + target: + entity_id: switch.kitchen_show_screensaver_active_2 + - if: + - condition: template + value_template: "{{ bedroom_screensaver_was_active | bool }}" + then: + - service: switch.turn_on + continue_on_error: true + target: + entity_id: switch.alarm_panel_1_screensaver + - if: + - condition: template + value_template: "{{ not (bedroom_screen_was_on | bool) }}" + then: + - service: switch.turn_off + continue_on_error: true + target: + entity_id: switch.alarm_panel_1_screen diff --git a/config/www/bedroom-kiosk.html b/config/www/bedroom-kiosk.html index 5731d84e..a9d896cc 100644 --- a/config/www/bedroom-kiosk.html +++ b/config/www/bedroom-kiosk.html @@ -1,5 +1,5 @@ - + @@ -7,7 +7,7 @@ Bedroom Kiosk - +
Connecting to Home Assistant…
@@ -161,12 +161,6 @@ var stateRefreshRunning = false; var imageRefreshRunning = false; - function setTheme() { - var hour = new Date().getHours(); - var prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; - document.body.classList.toggle('dark', prefersDark || hour >= 20 || hour < 7); - } - function getTokens() { try { return JSON.parse(localStorage.getItem('hassTokens') || 'null'); @@ -248,11 +242,13 @@ var eventView = document.getElementById('event-view'); var defaultView = document.getElementById('default-view'); - if (mode === 'garage' || mode === 'front_door') { + if (mode === 'garage' || mode === 'front_door' || mode === 'driveway') { defaultView.style.display = 'none'; eventView.style.display = 'block'; eventView.className = mode === 'front_door' ? 'front-door' : ''; - document.getElementById('event-label').textContent = mode === 'garage' ? 'Garage' : 'Front Door'; + document.getElementById('event-label').textContent = mode === 'garage' + ? 'Garage' + : mode === 'front_door' ? 'Front Door' : 'Driveway Alert'; } else { eventView.style.display = 'none'; defaultView.style.display = 'grid'; @@ -312,6 +308,8 @@ requests = [updateImage('event-image', 'camera.garagecam')]; } else if (mode === 'front_door') { requests = [updateImage('event-image', 'camera.frontdoorbell')]; + } else if (mode === 'driveway') { + requests = [updateImage('event-image', 'camera.driveway')]; } else { requests = [ updateImage('front-lawn', 'camera.frontlawn'), @@ -325,12 +323,10 @@ }); } - setTheme(); refreshStates(); window.setTimeout(refreshImages, 1000); window.setInterval(refreshStates, 5000); window.setInterval(refreshImages, 4000); - window.setInterval(setTheme, 60000); }());