From f16556dfc0fe62996841ecf4c84a5f1b91edb160 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 2 May 2025 01:13:06 +0200 Subject: [PATCH] Added more dashboards to home-assistant --- ...TE- Person Detect Logic - Patio Camera.yml | 22 +- .../Improving person detect automation.yml | 135 ++++++ home-assistant/Person detect Actions.yml | 111 +++-- ...nd Dynamic Notification To All Devices.yml | 213 ++++----- home-assistant/configuration.yml | 106 +++++ home-assistant/dashboard.yml | 415 ++++++++++++++++++ home-assistant/frigate events.xlsx | Bin 0 -> 11050 bytes home-assistant/input_boolean.json | 29 ++ home-assistant/templates.yml | 36 -- 9 files changed, 847 insertions(+), 220 deletions(-) create mode 100644 home-assistant/Improving person detect automation.yml create mode 100644 home-assistant/configuration.yml create mode 100644 home-assistant/dashboard.yml create mode 100644 home-assistant/frigate events.xlsx create mode 100644 home-assistant/input_boolean.json delete mode 100644 home-assistant/templates.yml diff --git a/home-assistant/FRIGATE- Person Detect Logic - Patio Camera.yml b/home-assistant/FRIGATE- Person Detect Logic - Patio Camera.yml index 5b889bc..70a770d 100644 --- a/home-assistant/FRIGATE- Person Detect Logic - Patio Camera.yml +++ b/home-assistant/FRIGATE- Person Detect Logic - Patio Camera.yml @@ -25,25 +25,32 @@ conditions: conditions: - condition: template value_template: "{{ trigger.payload_json['type'] == 'new' }}" + alias: New message - condition: template value_template: "{{ before_zones | length == 0 }}" + alias: No zones in before segment enabled: true -# - condition: template -# value_template: "{{ trigger.payload_json[\"after\"][\"entered_zones\"]|length > 0 }}" -# enabled: true - alias: Object is on Patio condition: template - value_template: "{{ [\"patio_z1\", \"Patio_Gate\"] | select(\"in\", after_zones) | list | length > 0 }}" + value_template: >- + {{ ["patio_z1", "Patio_Gate"] | select("in", after_zones) | list | length + > 0 }} enabled: true actions: - choose: - conditions: - condition: trigger id: frigate-event + - condition: or + conditions: + - condition: template + value_template: "{{ trigger.payload_json[\"before\"][\"stationary\"] != 'true' }}" + - condition: template + value_template: "{{ trigger.payload_json[\"after\"][\"stationary\"] != 'true' }}" + alias: Object is moving sequence: - action: script.person_detect_actions data: - send_to_sm_n986b: "true" send_to_nova_4k: "false" id: "{{ id }}" title: >- @@ -59,7 +66,7 @@ actions: importance: max priority: critical image: /api/frigate/notifications/{{ id }}/snapshot.jpg - video: "" + video: null base_url: https://home-assistant.sthome.org when: "{{ detect_time }}" camera: "{{ camera }}" @@ -72,11 +79,12 @@ actions: trigger: mqtt continue_on_timeout: false timeout: "00:02:00" + alias: 2 min timeout - condition: template value_template: "{{ wait.trigger.payload_json['type'] == 'end' }}" + alias: Wait for end event - action: script.person_detect_actions data: - send_to_sm_n986b: "true" send_to_nova_4k: "false" id: "{{ id }}" title: > diff --git a/home-assistant/Improving person detect automation.yml b/home-assistant/Improving person detect automation.yml new file mode 100644 index 0000000..869dcbf --- /dev/null +++ b/home-assistant/Improving person detect automation.yml @@ -0,0 +1,135 @@ +alias: "FRIGATE: Person Detect Logic - Backyard Camera" +description: >- + This automation is used to send a notification when a person is detected by + Frigate. It uses the frigate MQTT event stream to trigger the notification and + includes a snapshot of the detected object. The notification will be sent to + all devices with the specified group and will include a video clip of the + detection if available. +triggers: + - topic: homeassistant/events + id: frigate-event + value_template: "{{ value_json[\"after\"][\"camera\"] }}" + variables: + after_zones: "{{ trigger.payload_json[\"after\"][\"entered_zones\"] }}" + before_zones: "{{ trigger.payload_json[\"before\"][\"entered_zones\"] }}" + camera: "{{ trigger.payload_json[\"after\"][\"camera\"] }}" + id: "{{ trigger.payload_json[\"after\"][\"id\"] }}" + label: "{{ trigger.payload_json[\"after\"][\"label\"] }}" + score: "{{ trigger.payload_json[\"after\"][\"score\"] }}" + time_clip_start: "{{ trigger.payload_json[\"after\"][\"start_time\"] - 10.0 }}" + detect_time: "{{trigger.payload_json[\"after\"][\"start_time\"]|int}}" + trigger: mqtt + payload: Backyard +conditions: + - condition: or + conditions: + - condition: template + value_template: "{{ trigger.payload_json['type'] == 'new' }}" + - condition: template + value_template: "{{ before_zones | length == 0 }}" + enabled: true + - alias: Object is in Back Yard + condition: template + value_template: >- + {{ ["backyard_z1"] | select("in", after_zones) | list | + length > 0 }} + enabled: true +actions: + - choose: + - conditions: + - condition: trigger + id: frigate-event + - condition: or + conditions: + - condition: template + value_template: "{{ trigger.payload_json[\"before\"][\"stationary\"] != 'true' }}" + - condition: template + value_template: "{{ trigger.payload_json[\"after\"][\"stationary\"] != 'true' }}" + alias: Object is moving + sequence: + - action: script.person_detect_actions + alias: Trigger alarm and send critical priority event to devices + data: + send_to_sm_n986b: "true" + send_to_sm_x115: "true" + send_to_nokia_c20: "true" + send_to_nova_4k: "false" + id: "{{ id }}" + title: >- + {{ label }} was detected on {{ camera | replace("_", " ") | + title }} camera + message: >- + "{{ label }} detected in the {{ after_zones[0] | replace("_", " + ") | title }} zone" + notifTag: "{{ id }}" + notifIcon: mdi:alarm-light + group: frigate-notification-{{ camera }} + channel: alarm + importance: max + priority: critical + image: /api/frigate/notifications/{{ id }}/snapshot.jpg + video: null + base_url: https://home-assistant.sthome.org + when: "{{ detect_time }}" + camera: "{{ camera }}" + - repeat: + sequence: + - wait_for_trigger: + - topic: homeassistant/events + payload: "{{ trigger.payload_json[\"after\"][\"id\"] }}" + value_template: "{{ value_json[\"after\"][\"id\"] }}" + trigger: mqtt + continue_on_timeout: false + timeout: "00:02:00" + alias: 2 min timeout + - condition: template + value_template: "{{ wait.trigger.payload_json['type'] == 'end' }}" + alias: Wait for end event +# - condition: or +# conditions: +# - condition: template +# value_template: >- +# {{ trigger.payload_json["before"]["stationary"] != +# 'true' }} +# - condition: template +# value_template: >- +# {{ trigger.payload_json["after"]["stationary"] != 'true' +# }} + - action: script.person_detect_actions + alias: Send high priority notification to devices + data: + send_to_sm_n986b: "true" + send_to_sm_x115: "true" + send_to_nokia_c20: "true" + send_to_nova_4k: "false" + id: "{{ id }}" + title: > + {% if (wait.trigger.payload_json["after"]["sub_label"] != + None) -%} {{ + (wait.trigger.payload_json["after"]["sub_label"]) | title + }} {%- else -%} {{ label | replace("_", " ") | title }} + {%- endif %} was detected in the {{ after_zones[0] | + replace("_", " ") | title }} zone + message: >- + Detected with {{ int(score | round(2) * 100) }}% + confidence + notifTag: "{{ id }}" + notifIcon: mdi:cctv + group: > + frigate-notification-{{ + trigger.payload_json["after"]["camera"] }} + channel: alarm + priority: high + importance: default + image: /api/frigate/notifications/{{ id }}/snapshot.jpg + video: /api/frigate/notifications/{{ id }}/{{ camera }}/clip.mp4 + base_url: https://home-assistant.sthome.org + when: "{{ detect_time }}" + camera: "{{ camera }}" + until: + - condition: template + value_template: "{{ wait.trigger.payload_json[\"type\"] == \"end\" }}" + alias: End event is detected + default: [] +mode: parallel +max: 10 diff --git a/home-assistant/Person detect Actions.yml b/home-assistant/Person detect Actions.yml index 1264ac4..6b293c0 100644 --- a/home-assistant/Person detect Actions.yml +++ b/home-assistant/Person detect Actions.yml @@ -8,89 +8,82 @@ variables: sequence: - if: - condition: template - value_template: "{{ camera == 'Driveway' }}" + value_template: "{{ states('input_boolean.enable_person_detect_alarm') == 'on' }}" + alias: Person detect alarm is enabled then: - - variables: - relay_floodlight: switch.sthome_ut1_floodlights_backyard - counter: counter.driveway_person_alarm_counter - else: - if: - condition: template - value_template: "{{ camera == 'Patio' }}" + value_template: "{{ camera == 'Driveway' }}" then: - variables: - relay_floodlight: switch.sthome_ut1_floodlights_backyard - counter: counter.patio_person_alarm_counter + counter: counter.driveway_person_alarm_counter else: - if: - condition: template - value_template: "{{ camera == 'Westwall' }}" + value_template: "{{ camera == 'Patio' }}" then: - variables: - relay_floodlight: switch.sthome_ut1_floodlights_backyard - counter: counter.west_wall_person_alarm_counter + counter: counter.patio_person_alarm_counter else: - if: - condition: template - value_template: "{{ camera == 'Eastwall' }}" + value_template: "{{ camera == 'Westwall' }}" then: - variables: - relay_floodlight: switch.sthome_ut1_floodlights_backyard - counter: counter.east_wall_person_alarm_counter + counter: counter.west_wall_person_alarm_counter else: - if: - condition: template - value_template: "{{ camera == 'Backyard' }}" + value_template: "{{ camera == 'Eastwall' }}" then: - variables: - relay_floodlight: switch.sthome_ut1_floodlights_backyard - counter: counter.backyard_person_alarm_counter + counter: counter.east_wall_person_alarm_counter else: - - stop: Unknown camera - - if: - - condition: template - value_template: "{{ importance == \"max\" }}" - then: - action: counter.increment - target: - entity_id: "{{ counter }}" - data: {} - - if: - - condition: template - value_template: "{{ importance == \"max\" }}" - then: - sequence: - - action: switch.turn_on + - if: + - condition: template + value_template: "{{ camera == 'Backyard' }}" + then: + - variables: + counter: counter.backyard_person_alarm_counter + else: + - stop: Unknown camera + - if: + - condition: template + value_template: "{{ importance == \"max\" }}" + then: + action: counter.increment target: - entity_id: "{{ relay_floodlight }}" + entity_id: "{{ counter }}" data: {} - - action: switch.turn_on - target: - entity_id: "{{ relay_alarm }}" - data: {} - - action: script.send_dynamic_notification_to_devices - data: - send_to_sm_n986b: "{{ send_to_sm_n986b }}" - send_to_nova_4k: "{{ send_to_nova_4k }}" - id: "{{ id }}" - title: "{{ title }}" - message: "{{ message }}" - notifTag: "{{ notifTag }}" - notifIcon: "{{ notifIcon }}" - group: "{{ group }}" - channel: "{{ channel }}" - importance: "{{ importance }}" - base_url: "{{ base_url }}" - image: "{{ image }}" - video: "{{ video }}" - when: "{{ when }}" - enabled: true + - if: + - condition: template + value_template: "{{ importance == \"max\" }}" + then: + sequence: + - action: switch.turn_on + target: + entity_id: "{{ relay_alarm }}" + data: {} + - action: script.send_dynamic_notification_to_devices + data: + send_to_sm_n986b: "{{ states('input_boolean.notify_sm_n986b') == 'on' }}" + send_to_nokia_c20: "{{ states('input_boolean.notify_nokia_c20') == 'on' }}" + send_to_sm_x115: "{{ states('input_boolean.notify_sm_x115') == 'on' }}" + send_to_nova_4k: "{{ send_to_nova_4k }}" + id: "{{ id }}" + title: "{{ title }}" + message: "{{ message }}" + notifTag: "{{ notifTag }}" + notifIcon: "{{ notifIcon }}" + group: "{{ group }}" + channel: "{{ channel }}" + importance: "{{ importance }}" + base_url: "{{ base_url }}" + image: "{{ image }}" + video: "{{ video }}" + when: "{{ when }}" + enabled: true fields: - send_to_sm_n986b: - selector: - boolean: null - name: send_to_sm_n986b - required: false send_to_nova_4k: selector: boolean: null diff --git a/home-assistant/Send Dynamic Notification To All Devices.yml b/home-assistant/Send Dynamic Notification To All Devices.yml index 485fa66..381cae3 100644 --- a/home-assistant/Send Dynamic Notification To All Devices.yml +++ b/home-assistant/Send Dynamic Notification To All Devices.yml @@ -4,12 +4,12 @@ sequence: image_url: "{{ base_url~image }}" video_url: "{{ base_url~video }}" - parallel: - - sequence: - - if: - - condition: template - value_template: "{{ send_to_sm_n986b | default(True) }}" - alias: Send to SM_N986B? - then: + - if: + - condition: template + value_template: "{{ send_to_sm_n986b | default(True) }}" + alias: Send to SM_N986B? + then: + - parallel: - data: message: "{{ message }}" title: "{{ title }}" @@ -41,118 +41,95 @@ sequence: uri: "{{ video_url }}" action: notify.mobile_app_sm_n986b alias: "Notify: Send message to SM_N986B" - - if: - - condition: template - value_template: '{{ send_to_nokia_c20 | default(True) }}' - then: - - sequence: - - data: - message: "{{ message }}" - title: "{{ title }}" - data: - sticky: "true" - color: "#2DF56D" - channel: "{{ channel }}" - vibrationPattern: 100, 1000, 100, 1000, 100 - priority: "{{ priority }}" - ledColor: red - importance: "{{ importance }}" - clickAction: "{{ image_url }}" - tag: "{{ notifTag }}" - group: "{{ group }}" - image: >- - {% if (importance == "default" and video != null) -%} {{ null }} - {%- else -%} {{ image_url }} {%- endif %} - video: >- - {% if (importance == "default" and video != null) -%} {{ video_url - }} {%- else -%} {{ null }} {%- endif %} - notification_icon: "{{ notifIcon }}" - when: "{{ when }}" - actions: - - action: URI - title: Open Image - uri: "{{ image_url }}" - - action: URI - title: Open Clip - uri: "{{ video_url }}" - action: notify.mobile_app_nokia_c20 - - action: counter.increment - target: - entity_id: counter.nokia_c20_notification_counter - data: {} - alias: Increment NOKIA_C20 notification counter - - if: - - condition: template - value_template: '{{ send_to_sm_x115 | default(True) }}' - then: - - sequence: - - data: - message: "{{ message }}" - title: "{{ title }}" - data: - sticky: "true" - color: "#2DF56D" - channel: "{{ channel }}" - vibrationPattern: 100, 1000, 100, 1000, 100 - priority: "{{ priority }}" - ledColor: red - importance: "{{ importance }}" - clickAction: "{{ image_url }}" - tag: "{{ notifTag }}" - group: "{{ group }}" - image: >- - {% if (importance == "default" and video != null) -%} {{ null }} - {%- else -%} {{ image_url }} {%- endif %} - video: >- - {% if (importance == "default" and video != null) -%} {{ video_url - }} {%- else -%} {{ null }} {%- endif %} - notification_icon: "{{ notifIcon }}" - when: "{{ when }}" - actions: - - action: URI - title: Open Image - uri: "{{ image_url }}" - - action: URI - title: Open Clip - uri: "{{ video_url }}" - action: notify.mobile_app_sm_x115 - - action: counter.increment - target: - entity_id: counter.sm_x115_notification_counter - data: {} - alias: Increment SM_X115 notification counter - - # - data: - # message: '{{ message }}' - # title: '{{ title }}' - # data: - # url: '{{ video_url }}' - # tag: '{{ notifTag }}' - # group: '{{ group }}' - # attachment: - # url: '{% if (importance == "default" and video != null) -%} {{ video }} {%- else -%} {{ image_url }} {%- endif %}' - # push: - # interruption-level: '{% if importance == "max" -%} time-sensitive {%- else -%} passive {%- endif %}' - # must test above data sent to notify.mobile_app_sm_n986b and check whether the following data is needed - # actions: - # - action: URI - # title: Open Image - # uri: https://home-assistant.sthome.org/api/frigate/notifications/{{ id }}/thumbnail.jpg?format=android - # action: notify.mobile_app_sm_n986b - # - if: - # - condition: template - # value_template: '{{ states("media_player.nova4k") != "off" }}' - # - condition: template - # value_template: '{{ importance == "max" }}' - # then: - # - data: - # message: '{{ message }}' - # title: '{{ title }}' - # data: - # fontsize: medium - # image: - # url: https://frigate.sthome.org/api/events/{{id}}/snapshot.jpg - # action: notify.nova_4k + - action: counter.increment + target: + entity_id: counter.sm_n986b_notification_counter + data: {} + alias: Increment SM_N986B notification counter + - if: + - condition: template + value_template: "{{ send_to_nokia_c20 | default(True) }}" + alias: Send to Nokia_C20? + then: + - parallel: + - data: + message: "{{ message }}" + title: "{{ title }}" + data: + sticky: "true" + color: "#2DF56D" + channel: "{{ channel }}" + vibrationPattern: 100, 1000, 100, 1000, 100 + priority: "{{ priority }}" + ledColor: red + importance: "{{ importance }}" + clickAction: "{{ image_url }}" + tag: "{{ notifTag }}" + group: "{{ group }}" + image: >- + {% if (importance == "default" and video != null) -%} {{ + null }} {%- else -%} {{ image_url }} {%- endif %} + video: >- + {% if (importance == "default" and video != null) -%} {{ + video_url }} {%- else -%} {{ null }} {%- endif %} + notification_icon: "{{ notifIcon }}" + when: "{{ when }}" + actions: + - action: URI + title: Open Image + uri: "{{ image_url }}" + - action: URI + title: Open Clip + uri: "{{ video_url }}" + action: notify.mobile_app_nokia_c20 + alias: "Notify: Send message to Nokia_C20" + - action: counter.increment + target: + entity_id: counter.nokia_c20_notification_counter + data: {} + alias: Increment NOKIA_C20 notification counter + - if: + - condition: template + value_template: "{{ send_to_sm_x115 | default(True) }}" + alias: Send to SM_X115? + then: + - parallel: + - data: + message: "{{ message }}" + title: "{{ title }}" + data: + sticky: "true" + color: "#2DF56D" + channel: "{{ channel }}" + vibrationPattern: 100, 1000, 100, 1000, 100 + priority: "{{ priority }}" + ledColor: red + importance: "{{ importance }}" + clickAction: "{{ image_url }}" + tag: "{{ notifTag }}" + group: "{{ group }}" + image: >- + {% if (importance == "default" and video != null) -%} {{ + null }} {%- else -%} {{ image_url }} {%- endif %} + video: >- + {% if (importance == "default" and video != null) -%} {{ + video_url }} {%- else -%} {{ null }} {%- endif %} + notification_icon: "{{ notifIcon }}" + when: "{{ when }}" + actions: + - action: URI + title: Open Image + uri: "{{ image_url }}" + - action: URI + title: Open Clip + uri: "{{ video_url }}" + action: notify.mobile_app_sm_x115 + alias: "Notify: Send message to SM_X115" + - action: counter.increment + target: + entity_id: counter.sm_x115_notification_counter + data: {} + alias: Increment SM_X115 notification counter mode: parallel icon: mdi:bell-ring-outline max: 10 diff --git a/home-assistant/configuration.yml b/home-assistant/configuration.yml new file mode 100644 index 0000000..ed969c7 --- /dev/null +++ b/home-assistant/configuration.yml @@ -0,0 +1,106 @@ +# Configure a default setup of Home Assistant (frontend, api, etc) +default_config: +# Text to speech +tts: + - platform: google_translate +group: !include groups.yaml +automation: !include automations.yaml +script: !include scripts.yaml +scene: !include scenes.yaml +recorder: + purge_keep_days: 30 + commit_interval: 3 + db_url: "postgresql://home-assistant:M1ykv2TSzPD4c7lq4ixyBIl/q9kf4NyVIziQ3Yzansst4kZx@home-assistant_postgresql:5432/home-assistant?client_encoding=utf8" +http: + use_x_forwarded_for: true + trusted_proxies: + - 10.255.224.0/20 + +homeassistant: + customize_domain: + + automation: + templates: &state_color # <-- define a yaml anchor here + icon_color: > + if (state === 'on') return 'green'; + return 'steelblue'; + +# or use a theme variable: + +# templates: &state_color +# icon_color: > +# if (state === 'on') return 'var(--primary-color)'; +# return 'green'; #'steelblue'; + + sensor: + templates: + <<: *state_color # <-- and use it on any other entity in this file + + binary_sensor: + templates: + icon_color: > + if (state === 'on') return 'firebrick'; + return 'steelblue'; +# <<: *state_color # <-- and use it on any other entity in this file + + input_boolean: + templates: *state_color # <-- or even shorter like this + + switch: + templates: + icon: > + if (state === 'on') return 'mdi:toggle-switch'; + return 'mdi:toggle-switch-off'; + <<: *state_color + +template: + - binary_sensor: + - name: Sun + state: > + {{ is_state("sun.sun", "above_horizon") }} + icon: > + {% if is_state("binary_sensor.sun_up", "on") %} + mdi:weather-sunset-up + {% else %} + mdi:weather-sunset-down + {% endif %} + - unique_id: alarm_triggered_gui + name: Alarm triggered + state: > + {{ 'on' if states('sensor.sthome_ut1_alarm_signal')|float > 1.5 else 'off' }} + icon: > + {%- if this.state == 'on' -%} + mdi:alarm-light + {%- elif this.state == 'off' -%} + mdi:alarm-light-outline + {%- else -%} + mdi:alarm-light-off-outline + {%- endif -%} + - unique_id: zone_4_triggered_gui + name: Zone 4 triggered + state: "{{ states('switch.sthome_ut1_alarm_zone_4') }}" + icon: > + {%- if this.state == 'on' -%} + mdi:alarm-light + {%- elif this.state == 'off' -%} + mdi:alarm-light-off + {%- else -%} + mdi:alarm-light-off-outline + {%- endif -%} + - unique_id: gate_lock_gui + name: Gate Lock + state: "{{ states('switch.sthome_ut4_relay_5') }}" + icon: > + {%- if this.state == 'on' -%} + mdi:lock-open + {%- elif this.state == 'off' -%} + mdi:lock + {%- else -%} + mdi:lock-off + {%- endif -%} + +#notify: +# - platform: androidtv +# name: Android TV +# host: 10.0.0.71 +# - sensor: \ No newline at end of file diff --git a/home-assistant/dashboard.yml b/home-assistant/dashboard.yml new file mode 100644 index 0000000..852d338 --- /dev/null +++ b/home-assistant/dashboard.yml @@ -0,0 +1,415 @@ +{ + "version": 1, + "minor_version": 1, + "key": "lovelace.dashboard_sthome", + "data": { + "config": { + "title": "Home", + "resources": [ + { + "url": "/local/button-card.js", + "type": "module" + } + ], + "views": [ + { + "path": "default_view", + "title": "Home", + "cards": [ + { + "type": "weather-forecast", + "entity": "weather.forecast_home", + "show_forecast": true + }, + { + "type": "entity-filter", + "entities": [ + "device_tracker.sm_n986b", + "device_tracker.nokia_c20", + "device_tracker.sm_x115" + ], + "state_filter": [ + "home" + ], + "card": { + "type": "glance", + "title": "People that are home" + } + }, + { + "type": "media-control", + "entity": "media_player.smart_tv" + }, + { + "type": "entities", + "entities": [ + { + "entity": "switch.sthome_ut1_relay_2", + "name": "Relay 2" + }, + { + "entity": "switch.sthome_ut1_relay_3", + "name": "Relay 3" + }, + { + "entity": "binary_sensor.gate_lock", + "name": "Gate lock" + }, + { + "entity": "switch.sthome_ut4_relay_6", + "name": "Open/Close gate" + } + ], + "title": "House" + }, + { + "type": "entities", + "entities": [ + { + "entity": "counter.backyard_person_alarm_counter" + }, + { + "entity": "counter.driveway_person_alarm_counter" + }, + { + "entity": "counter.east_wall_person_alarm_counter" + }, + { + "entity": "counter.patio_person_alarm_counter" + }, + { + "entity": "counter.west_wall_person_alarm_counter" + }, + { + "entity": "counter.sm_n986b_notification_counter" + }, + { + "entity": "counter.sm_x115_notification_counter" + }, + { + "entity": "counter.nokia_c20_notification_counter" + } + ], + "title": "Counters" + }, + { + "type": "grid", + "square": false, + "columns": 1, + "cards": [ + { + "type": "entities", + "entities": [ + "remote.xiaomi_tv_box" + ], + "title": "Xiaomi TV Box" + }, + { + "type": "media-control", + "entity": "media_player.xiaomi_tv_box_2" + } + ] + }, + { + "type": "grid", + "square": false, + "columns": 1, + "cards": [ + { + "type": "entities", + "entities": [ + "remote.nova" + ], + "title": "NOVA" + }, + { + "type": "media-control", + "entity": "media_player.nova" + } + ] + } + ], + "type": "masonry", + "icon": "mdi:home", + "badges": [ + { + "type": "entity", + "show_name": true, + "show_state": false, + "show_icon": true, + "entity": "binary_sensor.alarm_triggered", + "color": "red", + "name": "Alarm", + "show_entity_picture": false, + "tap_action": { + "action": "navigate", + "navigation_path": "/dashboard-sthome/alarm" + } + } + ] + }, + { + "title": "Security Cameras", + "cards": [], + "icon": "mdi:cctv", + "type": "sections", + "sections": [ + { + "type": "grid", + "cards": [ + { + "type": "heading", + "heading": "Cameras", + "heading_style": "title", + "icon": "mdi:cctv" + }, + { + "show_state": true, + "show_name": true, + "camera_view": "auto", + "type": "picture-entity", + "entity": "camera.driveway", + "grid_options": { + "columns": 12, + "rows": "auto" + } + }, + { + "show_state": true, + "show_name": true, + "camera_view": "auto", + "type": "picture-entity", + "entity": "camera.patio", + "grid_options": { + "columns": 6, + "rows": "auto" + } + }, + { + "show_state": true, + "show_name": true, + "camera_view": "auto", + "type": "picture-entity", + "entity": "camera.eastwall", + "grid_options": { + "columns": 6, + "rows": "auto" + } + }, + { + "show_state": true, + "show_name": true, + "camera_view": "auto", + "type": "picture-entity", + "entity": "camera.westwall", + "grid_options": { + "columns": 6, + "rows": "auto" + } + }, + { + "show_state": true, + "show_name": true, + "camera_view": "auto", + "type": "picture-entity", + "entity": "camera.backyard", + "grid_options": { + "columns": 6, + "rows": "auto" + } + } + ], + "column_span": 1 + }, + { + "type": "grid", + "cards": [ + { + "type": "heading", + "heading": "Detections", + "heading_style": "title" + }, + { + "type": "picture", + "image_entity": "image.driveway_person", + "grid_options": { + "columns": 6, + "rows": "auto" + } + }, + { + "type": "picture", + "image_entity": "image.driveway_car", + "grid_options": { + "columns": 6, + "rows": "auto" + } + }, + { + "type": "picture", + "image_entity": "image.eastwall_person", + "grid_options": { + "columns": 6, + "rows": "auto" + } + }, + { + "type": "picture", + "image_entity": "image.patio_person", + "grid_options": { + "columns": 6, + "rows": "auto" + } + }, + { + "type": "picture", + "image_entity": "image.westwall_person", + "grid_options": { + "columns": 6, + "rows": "auto" + } + }, + { + "type": "picture", + "image_entity": "image.backyard_person", + "grid_options": { + "columns": 6, + "rows": "auto" + } + } + ] + } + ], + "header": { + "card": { + "type": "markdown", + "text_only": true, + "content": "Security Cameras" + } + }, + "max_columns": 4, + "dense_section_placement": true, + "badges": [ + { + "type": "entity", + "entity": "counter.driveway_person_alarm_counter" + }, + { + "type": "entity", + "entity": "counter.east_wall_person_alarm_counter" + }, + { + "type": "entity", + "entity": "counter.patio_person_alarm_counter" + }, + { + "type": "entity", + "entity": "counter.west_wall_person_alarm_counter" + }, + { + "type": "entity", + "entity": "counter.backyard_person_alarm_counter" + } + ] + }, + { + "type": "sections", + "max_columns": 4, + "subview": true, + "path": "alarm", + "title": "Alarm", + "icon": "mdi:alarm-light", + "sections": [ + { + "type": "grid", + "cards": [ + { + "type": "heading", + "heading": "Settings", + "heading_style": "title" + }, + { + "show_name": true, + "show_icon": true, + "type": "button", + "entity": "input_boolean.enable_person_detect_alarm", + "name": "Enable Camera Alarm" + }, + { + "show_name": true, + "show_icon": true, + "type": "button", + "entity": "input_boolean.notify_nokia_c20", + "show_state": false + }, + { + "show_name": true, + "show_icon": true, + "type": "button", + "entity": "input_boolean.notify_sm_n986b" + }, + { + "show_name": true, + "show_icon": true, + "type": "button", + "entity": "input_boolean.notify_sm_x115" + } + ] + } + ], + "cards": [], + "badges": [ + { + "type": "entity", + "show_name": true, + "show_state": true, + "show_icon": true, + "entity": "binary_sensor.alarm_triggered", + "show_entity_picture": true, + "color": "red", + "name": "Siren" + }, + { + "type": "entity", + "show_name": true, + "show_state": true, + "show_icon": true, + "entity": "binary_sensor.zone_4_triggered", + "color": "red", + "name": "Zone 4" + }, + { + "type": "entity", + "show_name": true, + "show_state": true, + "show_icon": true, + "entity": "switch.sthome_ut1_floodlights_backyard", + "state_content": "state", + "show_entity_picture": true, + "icon": "mdi:light-flood-down", + "name": "Backyard" + }, + { + "type": "entity", + "show_name": true, + "show_state": true, + "show_icon": true, + "entity": "binary_sensor.sthome_ut1_floodlights_test_mode", + "icon": "mdi:light-flood-down", + "show_entity_picture": true, + "color": "orange", + "name": "Test" + } + ], + "header": { + "card": { + "type": "markdown", + "text_only": true, + "content": "# House Alarm\n" + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/home-assistant/frigate events.xlsx b/home-assistant/frigate events.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..e7dece2293e8a65056fc17096ee0320641383d95 GIT binary patch literal 11050 zcmeHtg;QPG^7X}ny9Ot?I|L8G{o?NK1b24{aB+tq!QI{6EjYm;xCMtFGjHBEGkNp< z1@E0(wNKruy}I_VO1gFXdfWOZF-}PU-1EujJvOP>FA~)iXLfiC`E7c!h*pK}O z&}iiOJA32$iw!k1&COpj!yZsR=3rWIR-sL-c(9z0nN{0Z*ZYU|w)>%R z_6;17cVNE-*=wkuW@F%eV1BEs8)cFPNdDB&qrfJ-At+gjYlex%@4J<;G@ydI-rs~! ztWn4{xZL$!R%H$K{czC?%GMP6tc5wXhtA~|y#!>$JC7ACXPtZ?iJBs{fkKo0eUenW z163pIoSq^08dGpg8`A3d`kR(^PC^+r-0Gt6t747*7)#m?Pc2XP4yw-)SHSyb4oov$ zddF8$Jn_JX<@pT&@bUry0RD}Zb;?YnSFgS%{mMG{S6b@Y8(TRrGW<6FkB zukuFy7$o_*$yOSHhQUKx?@|_=bpOc-nufwYQS?*kMlY)K-1Xeg6fsFRD(ALnnv%xC z9I2soQqh@n;VP5~231^G^nCnaEWQ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M&r5U-q-*b{OZ>Ns+s!^dM+4>W&RkyzU7y^%QS$wS>|6=EkqIJa1HZ2PJ#Rk2uR` z%kn^Cw3=EOazA(3!NmK#b=7ly;V$pZaHnm`O1}PF{S5za_XPu|f0d(u?n?akasB)L z4?T)NslOZed;iqGfxq38UODlXZmM5_zxI^;32l9C)cU2v - {{ is_state("sun.sun", "above_horizon") }} - icon: > - {% if is_state("binary_sensor.sun_up", "on") %} - mdi:weather-sunset-up - {% else %} - mdi:weather-sunset-down - {% endif %} -#notify: -# - platform: androidtv -# name: Android TV -# host: 10.0.0.71 - - sensor: - - name: alarm_triggered_gui - state: "{{ states('switch.sthome_ut1_alarm_zone_4') }}" - icon: > - {%- set state = states('switch.sthome_ut1_alarm_zone_4') -%} - {%- if state == 'on' -%} - mdi:alarm-light - {%- elif state == 'off' -%} - mdi:alarm-light-off - {%- endif -%} - - name: gate_lock_gui - state: "{{ states('switch.sthome_ut4_relay_5') }}" # should change to binary sensor - icon: > - {%- set state = states('switch.sthome_ut4_relay_5') -%} - {%- if state == 'on' -%} - mdi:lock-open - {%- elif state == 'off' -%} - mdi:lock - {%- else -%} - mdi:lock-off - {%- endif -%}