Added more dashboards to home-assistant

This commit is contained in:
Chris Stuurman 2025-05-02 01:13:06 +02:00
parent 3655fd2e85
commit f16556dfc0
9 changed files with 847 additions and 220 deletions

View File

@ -25,25 +25,32 @@ conditions:
conditions: conditions:
- condition: template - condition: template
value_template: "{{ trigger.payload_json['type'] == 'new' }}" value_template: "{{ trigger.payload_json['type'] == 'new' }}"
alias: New message
- condition: template - condition: template
value_template: "{{ before_zones | length == 0 }}" value_template: "{{ before_zones | length == 0 }}"
alias: No zones in before segment
enabled: true enabled: true
# - condition: template
# value_template: "{{ trigger.payload_json[\"after\"][\"entered_zones\"]|length > 0 }}"
# enabled: true
- alias: Object is on Patio - alias: Object is on Patio
condition: template 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 enabled: true
actions: actions:
- choose: - choose:
- conditions: - conditions:
- condition: trigger - condition: trigger
id: frigate-event 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: sequence:
- action: script.person_detect_actions - action: script.person_detect_actions
data: data:
send_to_sm_n986b: "true"
send_to_nova_4k: "false" send_to_nova_4k: "false"
id: "{{ id }}" id: "{{ id }}"
title: >- title: >-
@ -59,7 +66,7 @@ actions:
importance: max importance: max
priority: critical priority: critical
image: /api/frigate/notifications/{{ id }}/snapshot.jpg image: /api/frigate/notifications/{{ id }}/snapshot.jpg
video: "" video: null
base_url: https://home-assistant.sthome.org base_url: https://home-assistant.sthome.org
when: "{{ detect_time }}" when: "{{ detect_time }}"
camera: "{{ camera }}" camera: "{{ camera }}"
@ -72,11 +79,12 @@ actions:
trigger: mqtt trigger: mqtt
continue_on_timeout: false continue_on_timeout: false
timeout: "00:02:00" timeout: "00:02:00"
alias: 2 min timeout
- condition: template - condition: template
value_template: "{{ wait.trigger.payload_json['type'] == 'end' }}" value_template: "{{ wait.trigger.payload_json['type'] == 'end' }}"
alias: Wait for end event
- action: script.person_detect_actions - action: script.person_detect_actions
data: data:
send_to_sm_n986b: "true"
send_to_nova_4k: "false" send_to_nova_4k: "false"
id: "{{ id }}" id: "{{ id }}"
title: > title: >

View File

@ -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

View File

@ -8,89 +8,82 @@ variables:
sequence: sequence:
- if: - if:
- condition: template - condition: template
value_template: "{{ camera == 'Driveway' }}" value_template: "{{ states('input_boolean.enable_person_detect_alarm') == 'on' }}"
alias: Person detect alarm is enabled
then: then:
- variables:
relay_floodlight: switch.sthome_ut1_floodlights_backyard
counter: counter.driveway_person_alarm_counter
else:
- if: - if:
- condition: template - condition: template
value_template: "{{ camera == 'Patio' }}" value_template: "{{ camera == 'Driveway' }}"
then: then:
- variables: - variables:
relay_floodlight: switch.sthome_ut1_floodlights_backyard counter: counter.driveway_person_alarm_counter
counter: counter.patio_person_alarm_counter
else: else:
- if: - if:
- condition: template - condition: template
value_template: "{{ camera == 'Westwall' }}" value_template: "{{ camera == 'Patio' }}"
then: then:
- variables: - variables:
relay_floodlight: switch.sthome_ut1_floodlights_backyard counter: counter.patio_person_alarm_counter
counter: counter.west_wall_person_alarm_counter
else: else:
- if: - if:
- condition: template - condition: template
value_template: "{{ camera == 'Eastwall' }}" value_template: "{{ camera == 'Westwall' }}"
then: then:
- variables: - variables:
relay_floodlight: switch.sthome_ut1_floodlights_backyard counter: counter.west_wall_person_alarm_counter
counter: counter.east_wall_person_alarm_counter
else: else:
- if: - if:
- condition: template - condition: template
value_template: "{{ camera == 'Backyard' }}" value_template: "{{ camera == 'Eastwall' }}"
then: then:
- variables: - variables:
relay_floodlight: switch.sthome_ut1_floodlights_backyard counter: counter.east_wall_person_alarm_counter
counter: counter.backyard_person_alarm_counter
else: else:
- stop: Unknown camera - if:
- if: - condition: template
- condition: template value_template: "{{ camera == 'Backyard' }}"
value_template: "{{ importance == \"max\" }}" then:
then: - variables:
action: counter.increment counter: counter.backyard_person_alarm_counter
target: else:
entity_id: "{{ counter }}" - stop: Unknown camera
data: {} - if:
- if: - condition: template
- condition: template value_template: "{{ importance == \"max\" }}"
value_template: "{{ importance == \"max\" }}" then:
then: action: counter.increment
sequence:
- action: switch.turn_on
target: target:
entity_id: "{{ relay_floodlight }}" entity_id: "{{ counter }}"
data: {} data: {}
- action: switch.turn_on - if:
target: - condition: template
entity_id: "{{ relay_alarm }}" value_template: "{{ importance == \"max\" }}"
data: {} then:
- action: script.send_dynamic_notification_to_devices sequence:
data: - action: switch.turn_on
send_to_sm_n986b: "{{ send_to_sm_n986b }}" target:
send_to_nova_4k: "{{ send_to_nova_4k }}" entity_id: "{{ relay_alarm }}"
id: "{{ id }}" data: {}
title: "{{ title }}" - action: script.send_dynamic_notification_to_devices
message: "{{ message }}" data:
notifTag: "{{ notifTag }}" send_to_sm_n986b: "{{ states('input_boolean.notify_sm_n986b') == 'on' }}"
notifIcon: "{{ notifIcon }}" send_to_nokia_c20: "{{ states('input_boolean.notify_nokia_c20') == 'on' }}"
group: "{{ group }}" send_to_sm_x115: "{{ states('input_boolean.notify_sm_x115') == 'on' }}"
channel: "{{ channel }}" send_to_nova_4k: "{{ send_to_nova_4k }}"
importance: "{{ importance }}" id: "{{ id }}"
base_url: "{{ base_url }}" title: "{{ title }}"
image: "{{ image }}" message: "{{ message }}"
video: "{{ video }}" notifTag: "{{ notifTag }}"
when: "{{ when }}" notifIcon: "{{ notifIcon }}"
enabled: true group: "{{ group }}"
channel: "{{ channel }}"
importance: "{{ importance }}"
base_url: "{{ base_url }}"
image: "{{ image }}"
video: "{{ video }}"
when: "{{ when }}"
enabled: true
fields: fields:
send_to_sm_n986b:
selector:
boolean: null
name: send_to_sm_n986b
required: false
send_to_nova_4k: send_to_nova_4k:
selector: selector:
boolean: null boolean: null

View File

@ -4,12 +4,12 @@ sequence:
image_url: "{{ base_url~image }}" image_url: "{{ base_url~image }}"
video_url: "{{ base_url~video }}" video_url: "{{ base_url~video }}"
- parallel: - parallel:
- sequence: - if:
- if: - condition: template
- condition: template value_template: "{{ send_to_sm_n986b | default(True) }}"
value_template: "{{ send_to_sm_n986b | default(True) }}" alias: Send to SM_N986B?
alias: Send to SM_N986B? then:
then: - parallel:
- data: - data:
message: "{{ message }}" message: "{{ message }}"
title: "{{ title }}" title: "{{ title }}"
@ -41,118 +41,95 @@ sequence:
uri: "{{ video_url }}" uri: "{{ video_url }}"
action: notify.mobile_app_sm_n986b action: notify.mobile_app_sm_n986b
alias: "Notify: Send message to SM_N986B" alias: "Notify: Send message to SM_N986B"
- if: - action: counter.increment
- condition: template target:
value_template: '{{ send_to_nokia_c20 | default(True) }}' entity_id: counter.sm_n986b_notification_counter
then: data: {}
- sequence: alias: Increment SM_N986B notification counter
- data: - if:
message: "{{ message }}" - condition: template
title: "{{ title }}" value_template: "{{ send_to_nokia_c20 | default(True) }}"
data: alias: Send to Nokia_C20?
sticky: "true" then:
color: "#2DF56D" - parallel:
channel: "{{ channel }}" - data:
vibrationPattern: 100, 1000, 100, 1000, 100 message: "{{ message }}"
priority: "{{ priority }}" title: "{{ title }}"
ledColor: red data:
importance: "{{ importance }}" sticky: "true"
clickAction: "{{ image_url }}" color: "#2DF56D"
tag: "{{ notifTag }}" channel: "{{ channel }}"
group: "{{ group }}" vibrationPattern: 100, 1000, 100, 1000, 100
image: >- priority: "{{ priority }}"
{% if (importance == "default" and video != null) -%} {{ null }} ledColor: red
{%- else -%} {{ image_url }} {%- endif %} importance: "{{ importance }}"
video: >- clickAction: "{{ image_url }}"
{% if (importance == "default" and video != null) -%} {{ video_url tag: "{{ notifTag }}"
}} {%- else -%} {{ null }} {%- endif %} group: "{{ group }}"
notification_icon: "{{ notifIcon }}" image: >-
when: "{{ when }}" {% if (importance == "default" and video != null) -%} {{
actions: null }} {%- else -%} {{ image_url }} {%- endif %}
- action: URI video: >-
title: Open Image {% if (importance == "default" and video != null) -%} {{
uri: "{{ image_url }}" video_url }} {%- else -%} {{ null }} {%- endif %}
- action: URI notification_icon: "{{ notifIcon }}"
title: Open Clip when: "{{ when }}"
uri: "{{ video_url }}" actions:
action: notify.mobile_app_nokia_c20 - action: URI
- action: counter.increment title: Open Image
target: uri: "{{ image_url }}"
entity_id: counter.nokia_c20_notification_counter - action: URI
data: {} title: Open Clip
alias: Increment NOKIA_C20 notification counter uri: "{{ video_url }}"
- if: action: notify.mobile_app_nokia_c20
- condition: template alias: "Notify: Send message to Nokia_C20"
value_template: '{{ send_to_sm_x115 | default(True) }}' - action: counter.increment
then: target:
- sequence: entity_id: counter.nokia_c20_notification_counter
- data: data: {}
message: "{{ message }}" alias: Increment NOKIA_C20 notification counter
title: "{{ title }}" - if:
data: - condition: template
sticky: "true" value_template: "{{ send_to_sm_x115 | default(True) }}"
color: "#2DF56D" alias: Send to SM_X115?
channel: "{{ channel }}" then:
vibrationPattern: 100, 1000, 100, 1000, 100 - parallel:
priority: "{{ priority }}" - data:
ledColor: red message: "{{ message }}"
importance: "{{ importance }}" title: "{{ title }}"
clickAction: "{{ image_url }}" data:
tag: "{{ notifTag }}" sticky: "true"
group: "{{ group }}" color: "#2DF56D"
image: >- channel: "{{ channel }}"
{% if (importance == "default" and video != null) -%} {{ null }} vibrationPattern: 100, 1000, 100, 1000, 100
{%- else -%} {{ image_url }} {%- endif %} priority: "{{ priority }}"
video: >- ledColor: red
{% if (importance == "default" and video != null) -%} {{ video_url importance: "{{ importance }}"
}} {%- else -%} {{ null }} {%- endif %} clickAction: "{{ image_url }}"
notification_icon: "{{ notifIcon }}" tag: "{{ notifTag }}"
when: "{{ when }}" group: "{{ group }}"
actions: image: >-
- action: URI {% if (importance == "default" and video != null) -%} {{
title: Open Image null }} {%- else -%} {{ image_url }} {%- endif %}
uri: "{{ image_url }}" video: >-
- action: URI {% if (importance == "default" and video != null) -%} {{
title: Open Clip video_url }} {%- else -%} {{ null }} {%- endif %}
uri: "{{ video_url }}" notification_icon: "{{ notifIcon }}"
action: notify.mobile_app_sm_x115 when: "{{ when }}"
- action: counter.increment actions:
target: - action: URI
entity_id: counter.sm_x115_notification_counter title: Open Image
data: {} uri: "{{ image_url }}"
alias: Increment SM_X115 notification counter - action: URI
title: Open Clip
# - data: uri: "{{ video_url }}"
# message: '{{ message }}' action: notify.mobile_app_sm_x115
# title: '{{ title }}' alias: "Notify: Send message to SM_X115"
# data: - action: counter.increment
# url: '{{ video_url }}' target:
# tag: '{{ notifTag }}' entity_id: counter.sm_x115_notification_counter
# group: '{{ group }}' data: {}
# attachment: alias: Increment SM_X115 notification counter
# 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
mode: parallel mode: parallel
icon: mdi:bell-ring-outline icon: mdi:bell-ring-outline
max: 10 max: 10

View File

@ -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:

View File

@ -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"
}
}
}
]
}
}
}

Binary file not shown.

View File

@ -0,0 +1,29 @@
{
"version": 1,
"minor_version": 1,
"key": "input_boolean",
"data": {
"items": [
{
"id": "enable_person_detect_alarm",
"name": "Enable Person Detect Alarm",
"icon": "mdi:run"
},
{
"id": "notify_sm_n986b",
"name": "Notify SM_N986B",
"icon": "mdi:cellphone-text"
},
{
"id": "notify_sm_x115",
"name": "Notify SM_X115",
"icon": "mdi:tablet"
},
{
"id": "notify_nokia_c20",
"name": "Notify Nokia C20",
"icon": "mdi:cellphone-text"
}
]
}
}

View File

@ -1,36 +0,0 @@
template:
- binary_sensor:
- name: Sun Up
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 %}
#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 -%}