From 34e1836ffe83c36141aac5d130e33b720061dd3b Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 28 Apr 2025 22:49:18 +0200 Subject: [PATCH] Added dashboards from home-assistant. Added alarm signal ADC sensor for sthome_ut1 --- .static-ips.yml | 3 +- esphome/data/config/sthome-ut1.yaml | 74 +- ... Person Detect Logic - Backyard Camera.yml | 110 +++ ... Person Detect Logic - Driveway Camera.yml | 111 +++ ... Person Detect Logic - Eastwall Camera.yml | 110 +++ ...TE- Person Detect Logic - Patio Camera.yml | 110 +++ ... Person Detect Logic - Westwall Camera.yml | 107 +++ .../dashboards/lovelace.dashboard_sthome.json | 184 ++++ .../dashboards/lovelace.dashboard_test.json | 892 ++++++++++++++++++ home-assistant/dashboards/lovelace.json | 14 + home-assistant/dashboards/lovelace.map.json | 12 + .../dashboards/lovelace_dashboards.json | 35 + .../dashboards/lovelace_resources.json | 19 + home-assistant/default_view.yml | 105 +++ jellyfin/stacks/.env | 3 + jellyfin/stacks/compose.yml | 17 +- 16 files changed, 1879 insertions(+), 27 deletions(-) create mode 100644 home-assistant/FRIGATE- Person Detect Logic - Backyard Camera.yml create mode 100644 home-assistant/FRIGATE- Person Detect Logic - Driveway Camera.yml create mode 100644 home-assistant/FRIGATE- Person Detect Logic - Eastwall Camera.yml create mode 100644 home-assistant/FRIGATE- Person Detect Logic - Patio Camera.yml create mode 100644 home-assistant/FRIGATE- Person Detect Logic - Westwall Camera.yml create mode 100644 home-assistant/dashboards/lovelace.dashboard_sthome.json create mode 100644 home-assistant/dashboards/lovelace.dashboard_test.json create mode 100644 home-assistant/dashboards/lovelace.json create mode 100644 home-assistant/dashboards/lovelace.map.json create mode 100644 home-assistant/dashboards/lovelace_dashboards.json create mode 100644 home-assistant/dashboards/lovelace_resources.json create mode 100644 home-assistant/default_view.yml diff --git a/.static-ips.yml b/.static-ips.yml index d64b59d..f6d7691 100644 --- a/.static-ips.yml +++ b/.static-ips.yml @@ -19,4 +19,5 @@ syncthing: 192.168.2.241 # we use macvlan1 to use multicast dns (mDNS). As of setting this up, don't know how to setup avahi daemon without using macvlan. ESPHOME_LOCAL: 10.0.2.254 -HOME_ASSISTANT_LOCAL: 10.0.2.253 \ No newline at end of file +HOME_ASSISTANT_LOCAL: 10.0.2.253 +JELLYFIN_LOCAL: 10.0.2.252 \ No newline at end of file diff --git a/esphome/data/config/sthome-ut1.yaml b/esphome/data/config/sthome-ut1.yaml index 1f927f5..d39bddf 100644 --- a/esphome/data/config/sthome-ut1.yaml +++ b/esphome/data/config/sthome-ut1.yaml @@ -50,24 +50,39 @@ captive_portal: #preferences: # flash_write_interval: 30s - +#-25.711340, 28.118370 sun: - latitude: 25.7566° S - longitude: 28.1914° E + latitude: -25.711340 + longitude: 28.118370 time: - platform: homeassistant + +# define DIGITAL_D1 04 +binary_sensor: + - platform: gpio + # device_class: light + id: floodlight_test + pin: + number: GPIO04 + mode: + input: true + pullup: true + filters: + - delayed_off: 100ms + name: "Floodlights Test Mode" + icon: "mdi:lightbulb-on-outline" + #define OUTPUT_R1 16 #define OUTPUT_R2 17 #define OUTPUT_R3 18 #define OUTPUT_R4 19 - switch: - platform: gpio pin: number: GPIO16 - inverted: False + inverted: true id: relay1 name: "Floodlights Backyard" icon: "mdi:light-flood-down" @@ -114,7 +129,12 @@ switch: - sun.is_below_horizon: then: - switch.turn_on: relay1 - - delay: 1000ms + - if: + condition: + - binary_sensor.is_on: floodlight_test + then: + - switch.turn_on: relay1 + - delay: 10s - switch.turn_off: relay4 #define ANALOG_A1 33 @@ -123,9 +143,30 @@ switch: #define ANALOG_A4 34 #define ANALOG_A5 39 #define ANALOG_A6 36 - - -#sensor: +sensor: + - platform: adc + pin: 35 + name: "Alarm Signal" + id: alarm_signal + update_interval: 1s + attenuation: 12db + sampling_mode: avg + filters: + - lambda: + if (x >= 3.11) { + return x * 1.60256; + } else if (x <= 0.15) { + return 0; + } else { + return x * 1.51; + } + on_value: + then: + # switch on floodlights + lambda: |- + if (id(alarm_signal).state > 1.5) { + id(relay1).turn_on(); + } # - platform: adc # pin: 33 # name: "A1 Voltage" @@ -156,21 +197,6 @@ switch: # return x * 1.51; # } # - platform: adc -# pin: 35 -# name: "A3 Voltage" -# update_interval: 1s -# attenuation: 12db -# sampling_mode: avg -# filters: -# - lambda: -# if (x >= 3.11) { -# return x * 1.60256; -# } else if (x <= 0.15) { -# return 0; -# } else { -# return x * 1.51; -# } -# - platform: adc # pin: 34 # name: "A4 Voltage" # update_interval: 5s diff --git a/home-assistant/FRIGATE- Person Detect Logic - Backyard Camera.yml b/home-assistant/FRIGATE- Person Detect Logic - Backyard Camera.yml new file mode 100644 index 0000000..8fb7f2c --- /dev/null +++ b/home-assistant/FRIGATE- Person Detect Logic - Backyard Camera.yml @@ -0,0 +1,110 @@ +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 +# - condition: template +# value_template: "{{ trigger.payload_json[\"after\"][\"entered_zones\"]|length > 0 }}" +# enabled: true + - alias: Object is in Backyard + condition: template + value_template: "{{ [\"backyard_z1\"] | select(\"in\", after_zones) | list | length > 0 }}" + enabled: true +actions: + - choose: + - conditions: + - condition: trigger + id: frigate-event + sequence: + - action: script.person_detect_actions + data: + send_to_sm_n986b: "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: "" + 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" + - condition: template + value_template: "{{ wait.trigger.payload_json['type'] == 'end' }}" + - action: script.person_detect_actions + data: + send_to_sm_n986b: "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\" }}" + default: [] +mode: parallel +max: 10 diff --git a/home-assistant/FRIGATE- Person Detect Logic - Driveway Camera.yml b/home-assistant/FRIGATE- Person Detect Logic - Driveway Camera.yml new file mode 100644 index 0000000..354183b --- /dev/null +++ b/home-assistant/FRIGATE- Person Detect Logic - Driveway Camera.yml @@ -0,0 +1,111 @@ +alias: "FRIGATE: Person Detect Logic - Driveway 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: Driveway +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 Street or Front Yard + condition: template + value_template: "{{ [\"driveway_z1\", \"Driveway_Paving\"] | select(\"in\", after_zones) | list | length > 0 }}" + enabled: true + - alias: Object is not a Car + condition: template + value_template: "{{ trigger.payload_json[\"after\"][\"label\"] != 'car' }}" + enabled: true +actions: + - choose: + - conditions: + - condition: trigger + id: frigate-event + sequence: + - action: script.person_detect_actions + data: + send_to_sm_n986b: "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: "" + 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" + - condition: template + value_template: "{{ wait.trigger.payload_json['type'] == 'end' }}" + - action: script.person_detect_actions + data: + send_to_sm_n986b: "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\" }}" + default: [] +mode: parallel +max: 10 diff --git a/home-assistant/FRIGATE- Person Detect Logic - Eastwall Camera.yml b/home-assistant/FRIGATE- Person Detect Logic - Eastwall Camera.yml new file mode 100644 index 0000000..af10f68 --- /dev/null +++ b/home-assistant/FRIGATE- Person Detect Logic - Eastwall Camera.yml @@ -0,0 +1,110 @@ +alias: "FRIGATE: Person Detect Logic - Eastwall 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: Eastwall +conditions: + - condition: or + conditions: + - condition: template + value_template: "{{ trigger.payload_json['type'] == 'new' }}" + - condition: template + value_template: "{{ before_zones | length == 0 }}" + enabled: true +# - condition: template +# value_template: "{{ trigger.payload_json[\"after\"][\"entered_zones\"]|length > 0 }}" +# enabled: true + - alias: Object is on the East side of house + condition: template + value_template: "{{ [\"eastwall_z1\"] | select(\"in\", after_zones) | list | length > 0 }}" + enabled: true +actions: + - choose: + - conditions: + - condition: trigger + id: frigate-event + sequence: + - action: script.person_detect_actions + data: + send_to_sm_n986b: "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: "" + 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" + - condition: template + value_template: "{{ wait.trigger.payload_json['type'] == 'end' }}" + - action: script.person_detect_actions + data: + send_to_sm_n986b: "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\" }}" + default: [] +mode: parallel +max: 10 diff --git a/home-assistant/FRIGATE- Person Detect Logic - Patio Camera.yml b/home-assistant/FRIGATE- Person Detect Logic - Patio Camera.yml new file mode 100644 index 0000000..5b889bc --- /dev/null +++ b/home-assistant/FRIGATE- Person Detect Logic - Patio Camera.yml @@ -0,0 +1,110 @@ +alias: "FRIGATE: Person Detect Logic - Patio 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: Patio +conditions: + - condition: or + conditions: + - condition: template + value_template: "{{ trigger.payload_json['type'] == 'new' }}" + - condition: template + value_template: "{{ before_zones | length == 0 }}" + 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 }}" + enabled: true +actions: + - choose: + - conditions: + - condition: trigger + id: frigate-event + sequence: + - action: script.person_detect_actions + data: + send_to_sm_n986b: "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: "" + 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" + - condition: template + value_template: "{{ wait.trigger.payload_json['type'] == 'end' }}" + - action: script.person_detect_actions + data: + send_to_sm_n986b: "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\" }}" + default: [] +mode: parallel +max: 10 diff --git a/home-assistant/FRIGATE- Person Detect Logic - Westwall Camera.yml b/home-assistant/FRIGATE- Person Detect Logic - Westwall Camera.yml new file mode 100644 index 0000000..33f4c73 --- /dev/null +++ b/home-assistant/FRIGATE- Person Detect Logic - Westwall Camera.yml @@ -0,0 +1,107 @@ +alias: "FRIGATE: Person Detect Logic - Westwall 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: Westwall +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 on West side + condition: template + value_template: "{{ [\"westwall_z1\"] | select(\"in\", after_zones) | list | length > 0 }}" + enabled: true +actions: + - choose: + - conditions: + - condition: trigger + id: frigate-event + sequence: + - action: script.person_detect_actions + data: + send_to_sm_n986b: "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: "" + 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" + - condition: template + value_template: "{{ wait.trigger.payload_json['type'] == 'end' }}" + - action: script.person_detect_actions + data: + send_to_sm_n986b: "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\" }}" + default: [] +mode: parallel +max: 10 diff --git a/home-assistant/dashboards/lovelace.dashboard_sthome.json b/home-assistant/dashboards/lovelace.dashboard_sthome.json new file mode 100644 index 0000000..dc0f3b1 --- /dev/null +++ b/home-assistant/dashboards/lovelace.dashboard_sthome.json @@ -0,0 +1,184 @@ +{ + "version": 1, + "minor_version": 1, + "key": "lovelace.dashboard_sthome", + "data": { + "config": { + "views": [ + { + "path": "default_view", + "title": "Home", + "cards": [ + { + "type": "weather-forecast", + "entity": "weather.forecast_home", + "show_forecast": false + }, + { + "type": "entity-filter", + "entities": [ + "device_tracker.sm_n986b" + ], + "state_filter": [ + "home" + ], + "card": { + "type": "glance", + "title": "People that are home" + } + }, + { + "type": "media-control", + "entity": "media_player.nova4k" + }, + { + "type": "media-control", + "entity": "media_player.smart_tv" + }, + { + "type": "media-control", + "entity": "media_player.xiaomi_tv_box_2" + }, + { + "type": "entities", + "entities": [ + "switch.sthome_ut1_alarm_zone_4", + "switch.sthome_ut1_floodlights_backyard", + "switch.sthome_ut1_relay_2", + "switch.sthome_ut1_relay_3", + "switch.sthome_ut4_relay_5", + "switch.sthome_ut4_relay_6", + "binary_sensor.sthome_ut1_floodlights_test_mode" + ], + "title": "House" + }, + { + "type": "grid", + "square": false, + "columns": 1, + "cards": [ + { + "type": "entities", + "entities": [], + "title": "Backyard Z1" + }, + { + "type": "picture-entity", + "entity": "camera.backyard" + }, + { + "type": "picture", + "image_entity": "image.backyard_person" + } + ] + }, + { + "type": "grid", + "square": false, + "columns": 1, + "cards": [ + { + "type": "entities", + "entities": [], + "title": "Driveway Z1" + }, + { + "type": "picture-entity", + "entity": "camera.driveway" + }, + { + "type": "picture", + "image_entity": "image.driveway_person" + } + ] + }, + { + "type": "grid", + "square": false, + "columns": 1, + "cards": [ + { + "type": "entities", + "entities": [] + }, + { + "type": "picture-entity", + "entity": "camera.eastwall" + }, + { + "type": "picture", + "image_entity": "image.eastwall_person" + } + ] + }, + { + "type": "grid", + "square": false, + "columns": 1, + "cards": [ + { + "type": "entities", + "entities": [], + "title": "Patio Z1" + }, + { + "type": "picture-entity", + "entity": "camera.patio" + }, + { + "type": "picture", + "image_entity": "image.patio_person" + } + ] + }, + { + "type": "grid", + "square": false, + "columns": 1, + "cards": [ + { + "type": "entities", + "entities": [], + "title": "Westwall Z1" + }, + { + "type": "picture-entity", + "entity": "camera.westwall" + }, + { + "type": "picture", + "image_entity": "image.westwall_person" + } + ] + }, + { + "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" + } + ], + "title": "Counters" + } + ], + "type": "masonry" + } + ] + } + } +} \ No newline at end of file diff --git a/home-assistant/dashboards/lovelace.dashboard_test.json b/home-assistant/dashboards/lovelace.dashboard_test.json new file mode 100644 index 0000000..87ef1e7 --- /dev/null +++ b/home-assistant/dashboards/lovelace.dashboard_test.json @@ -0,0 +1,892 @@ +{ + "version": 1, + "minor_version": 1, + "key": "lovelace.dashboard_test", + "data": { + "config": { + "views": [ + { + "path": "default_view", + "title": "Home", + "cards": [ + { + "type": "media-control", + "entity": "media_player.nova4k" + }, + { + "type": "entities", + "entities": [ + "switch.sthome_ut1_alarm_zone_4", + "switch.sthome_ut1_floodlights_backyard", + "switch.sthome_ut1_relay_2", + "switch.sthome_ut1_relay_3", + "switch.sthome_ut4_relay_5", + "switch.sthome_ut4_relay_6", + "binary_sensor.sthome_ut1_floodlights_test_mode" + ], + "title": "House" + }, + { + "type": "grid", + "square": false, + "columns": 1, + "cards": [ + { + "type": "entities", + "entities": [ + "remote.xiaomi_tv_box" + ], + "title": "Living Room" + }, + { + "type": "media-control", + "entity": "media_player.smart_tv" + }, + { + "type": "media-control", + "entity": "media_player.xiaomi_tv_box_2" + } + ] + }, + { + "type": "entities", + "entities": [ + "person.chris" + ] + }, + { + "type": "entities", + "entities": [ + "counter.backyard_person_alarm_counter", + "counter.car_counter", + "counter.driveway_person_alarm_counter", + "counter.east_wall_person_alarm_counter", + "counter.patio_person_alarm_counter", + "counter.sm_n986b_notification_counter", + "counter.west_wall_person_alarm_counter" + ], + "title": "Helpers" + }, + { + "type": "media-control", + "entity": "media_player.xiaomi_tv_box" + }, + { + "type": "entities", + "entities": [ + "sensor.sm_n986b_battery_health" + ], + "title": "Sensor" + }, + { + "type": "weather-forecast", + "entity": "weather.forecast_home", + "show_forecast": false + }, + { + "type": "grid", + "square": false, + "columns": 1, + "cards": [ + { + "type": "entities", + "entities": [ + { + "entity": "sensor.backyard_all_active_count", + "name": "All Active Count" + }, + { + "entity": "sensor.backyard_all_count", + "name": "All count" + }, + { + "entity": "binary_sensor.backyard_all_occupancy", + "name": "All occupancy" + }, + { + "entity": "binary_sensor.backyard_motion", + "name": "Motion" + }, + { + "entity": "sensor.backyard_person_active_count", + "name": "Person Active Count" + }, + { + "entity": "sensor.backyard_person_count", + "name": "Person count" + }, + { + "entity": "binary_sensor.backyard_person_occupancy", + "name": "Person occupancy" + } + ], + "title": "Backyard" + }, + { + "type": "picture-entity", + "entity": "camera.backyard" + }, + { + "type": "picture", + "image_entity": "image.backyard_person" + } + ] + }, + { + "type": "entities", + "entities": [ + { + "entity": "sensor.backyard_z1_all_active_count", + "name": "All Active Count" + }, + { + "entity": "sensor.backyard_z1_all_count", + "name": "All count" + }, + { + "entity": "binary_sensor.backyard_z1_all_occupancy", + "name": "All occupancy" + }, + { + "entity": "sensor.backyard_z1_person_active_count", + "name": "Person Active Count" + }, + { + "entity": "sensor.backyard_z1_person_count", + "name": "Person count" + }, + { + "entity": "binary_sensor.backyard_z1_person_occupancy", + "name": "Person occupancy" + } + ], + "title": "Backyard Z1" + }, + { + "type": "grid", + "square": false, + "columns": 1, + "cards": [ + { + "type": "entities", + "entities": [ + { + "entity": "sensor.driveway_all_active_count", + "name": "All Active Count" + }, + { + "entity": "sensor.driveway_all_count", + "name": "All count" + }, + { + "entity": "binary_sensor.driveway_all_occupancy", + "name": "All occupancy" + }, + { + "entity": "sensor.driveway_bicycle_active_count", + "name": "Bicycle Active Count" + }, + { + "entity": "sensor.driveway_bicycle_count", + "name": "Bicycle count" + }, + { + "entity": "binary_sensor.driveway_bicycle_occupancy", + "name": "Bicycle occupancy" + }, + { + "entity": "sensor.driveway_bus_active_count", + "name": "Bus Active Count" + }, + { + "entity": "sensor.driveway_bus_count", + "name": "Bus count" + }, + { + "entity": "binary_sensor.driveway_bus_occupancy", + "name": "Bus occupancy" + }, + { + "entity": "sensor.driveway_car_active_count", + "name": "Car Active Count" + }, + { + "entity": "sensor.driveway_car_count", + "name": "Car count" + }, + { + "entity": "binary_sensor.driveway_car_occupancy", + "name": "Car occupancy" + }, + { + "entity": "binary_sensor.driveway_motion", + "name": "Motion" + }, + { + "entity": "sensor.driveway_motorcycle_active_count", + "name": "Motorcycle Active Count" + }, + { + "entity": "sensor.driveway_motorcycle_count", + "name": "Motorcycle count" + }, + { + "entity": "binary_sensor.driveway_motorcycle_occupancy", + "name": "Motorcycle occupancy" + }, + { + "entity": "sensor.driveway_person_active_count", + "name": "Person Active Count" + }, + { + "entity": "sensor.driveway_person_count", + "name": "Person count" + }, + { + "entity": "binary_sensor.driveway_person_occupancy", + "name": "Person occupancy" + } + ], + "title": "Driveway" + }, + { + "type": "picture-entity", + "entity": "camera.driveway" + }, + { + "type": "picture", + "image_entity": "image.driveway_person" + }, + { + "type": "picture", + "image_entity": "image.driveway_car" + }, + { + "type": "picture", + "image_entity": "image.driveway_motorcycle" + }, + { + "type": "picture", + "image_entity": "image.driveway_bicycle" + }, + { + "type": "picture", + "image_entity": "image.driveway_bus" + } + ] + }, + { + "type": "entities", + "entities": [ + { + "entity": "sensor.driveway_paving_all_active_count", + "name": "All Active Count" + }, + { + "entity": "sensor.driveway_paving_all_count", + "name": "All count" + }, + { + "entity": "binary_sensor.driveway_paving_all_occupancy", + "name": "All occupancy" + }, + { + "entity": "sensor.driveway_paving_bicycle_active_count", + "name": "Bicycle Active Count" + }, + { + "entity": "sensor.driveway_paving_bicycle_count", + "name": "Bicycle count" + }, + { + "entity": "binary_sensor.driveway_paving_bicycle_occupancy", + "name": "Bicycle occupancy" + }, + { + "entity": "sensor.driveway_paving_bus_active_count", + "name": "Bus Active Count" + }, + { + "entity": "sensor.driveway_paving_bus_count", + "name": "Bus count" + }, + { + "entity": "binary_sensor.driveway_paving_bus_occupancy", + "name": "Bus occupancy" + }, + { + "entity": "sensor.driveway_paving_car_active_count", + "name": "Car Active Count" + }, + { + "entity": "sensor.driveway_paving_car_count", + "name": "Car count" + }, + { + "entity": "binary_sensor.driveway_paving_car_occupancy", + "name": "Car occupancy" + }, + { + "entity": "sensor.driveway_paving_motorcycle_active_count", + "name": "Motorcycle Active Count" + }, + { + "entity": "sensor.driveway_paving_motorcycle_count", + "name": "Motorcycle count" + }, + { + "entity": "binary_sensor.driveway_paving_motorcycle_occupancy", + "name": "Motorcycle occupancy" + }, + { + "entity": "sensor.driveway_paving_person_active_count", + "name": "Person Active Count" + }, + { + "entity": "sensor.driveway_paving_person_count", + "name": "Person count" + }, + { + "entity": "binary_sensor.driveway_paving_person_occupancy", + "name": "Person occupancy" + } + ], + "title": "Driveway Paving" + }, + { + "type": "entities", + "entities": [ + { + "entity": "sensor.driveway_z1_all_active_count", + "name": "All Active Count" + }, + { + "entity": "sensor.driveway_z1_all_count", + "name": "All count" + }, + { + "entity": "binary_sensor.driveway_z1_all_occupancy", + "name": "All occupancy" + }, + { + "entity": "sensor.driveway_z1_bicycle_active_count", + "name": "Bicycle Active Count" + }, + { + "entity": "sensor.driveway_z1_bicycle_count", + "name": "Bicycle count" + }, + { + "entity": "binary_sensor.driveway_z1_bicycle_occupancy", + "name": "Bicycle occupancy" + }, + { + "entity": "sensor.driveway_z1_bus_active_count", + "name": "Bus Active Count" + }, + { + "entity": "sensor.driveway_z1_bus_count", + "name": "Bus count" + }, + { + "entity": "binary_sensor.driveway_z1_bus_occupancy", + "name": "Bus occupancy" + }, + { + "entity": "sensor.driveway_z1_car_active_count", + "name": "Car Active Count" + }, + { + "entity": "sensor.driveway_z1_car_count", + "name": "Car count" + }, + { + "entity": "binary_sensor.driveway_z1_car_occupancy", + "name": "Car occupancy" + }, + { + "entity": "sensor.driveway_z1_motorcycle_active_count", + "name": "Motorcycle Active Count" + }, + { + "entity": "sensor.driveway_z1_motorcycle_count", + "name": "Motorcycle count" + }, + { + "entity": "binary_sensor.driveway_z1_motorcycle_occupancy", + "name": "Motorcycle occupancy" + }, + { + "entity": "sensor.driveway_z1_person_active_count", + "name": "Person Active Count" + }, + { + "entity": "sensor.driveway_z1_person_count", + "name": "Person count" + }, + { + "entity": "binary_sensor.driveway_z1_person_occupancy", + "name": "Person occupancy" + } + ], + "title": "Driveway Z1" + }, + { + "type": "entities", + "entities": [ + { + "entity": "sensor.driveway_zall_all_active_count", + "name": "All Active Count" + }, + { + "entity": "sensor.driveway_zall_all_count", + "name": "All count" + }, + { + "entity": "binary_sensor.driveway_zall_all_occupancy", + "name": "All occupancy" + }, + { + "entity": "sensor.driveway_zall_bicycle_active_count", + "name": "Bicycle Active Count" + }, + { + "entity": "sensor.driveway_zall_bicycle_count", + "name": "Bicycle count" + }, + { + "entity": "binary_sensor.driveway_zall_bicycle_occupancy", + "name": "Bicycle occupancy" + }, + { + "entity": "sensor.driveway_zall_bus_active_count", + "name": "Bus Active Count" + }, + { + "entity": "sensor.driveway_zall_bus_count", + "name": "Bus count" + }, + { + "entity": "binary_sensor.driveway_zall_bus_occupancy", + "name": "Bus occupancy" + }, + { + "entity": "sensor.driveway_zall_car_active_count", + "name": "Car Active Count" + }, + { + "entity": "sensor.driveway_zall_car_count", + "name": "Car count" + }, + { + "entity": "binary_sensor.driveway_zall_car_occupancy", + "name": "Car occupancy" + }, + { + "entity": "sensor.driveway_zall_motorcycle_active_count", + "name": "Motorcycle Active Count" + }, + { + "entity": "sensor.driveway_zall_motorcycle_count", + "name": "Motorcycle count" + }, + { + "entity": "binary_sensor.driveway_zall_motorcycle_occupancy", + "name": "Motorcycle occupancy" + }, + { + "entity": "sensor.driveway_zall_person_active_count", + "name": "Person Active Count" + }, + { + "entity": "sensor.driveway_zall_person_count", + "name": "Person count" + }, + { + "entity": "binary_sensor.driveway_zall_person_occupancy", + "name": "Person occupancy" + } + ], + "title": "Driveway Zall" + }, + { + "type": "grid", + "square": false, + "columns": 1, + "cards": [ + { + "type": "entities", + "entities": [ + { + "entity": "sensor.eastwall_all_active_count", + "name": "All Active Count" + }, + { + "entity": "sensor.eastwall_all_count", + "name": "All count" + }, + { + "entity": "binary_sensor.eastwall_all_occupancy", + "name": "All occupancy" + }, + { + "entity": "binary_sensor.eastwall_motion", + "name": "Motion" + }, + { + "entity": "sensor.eastwall_person_active_count", + "name": "Person Active Count" + }, + { + "entity": "sensor.eastwall_person_count", + "name": "Person count" + }, + { + "entity": "binary_sensor.eastwall_person_occupancy", + "name": "Person occupancy" + } + ], + "title": "Eastwall" + }, + { + "type": "picture-entity", + "entity": "camera.eastwall" + }, + { + "type": "picture", + "image_entity": "image.eastwall_person" + } + ] + }, + { + "type": "entities", + "entities": [ + { + "entity": "sensor.eastwall_z1_all_active_count", + "name": "All Active Count" + }, + { + "entity": "sensor.eastwall_z1_all_count", + "name": "All count" + }, + { + "entity": "binary_sensor.eastwall_z1_all_occupancy", + "name": "All occupancy" + }, + { + "entity": "sensor.eastwall_z1_person_active_count", + "name": "Person Active Count" + }, + { + "entity": "sensor.eastwall_z1_person_count", + "name": "Person count" + }, + { + "entity": "binary_sensor.eastwall_z1_person_occupancy", + "name": "Person occupancy" + } + ], + "title": "Eastwall Z1" + }, + { + "type": "entities", + "entities": [ + { + "entity": "sensor.front_stoep_all_active_count", + "name": "All Active Count" + }, + { + "entity": "sensor.front_stoep_all_count", + "name": "All count" + }, + { + "entity": "binary_sensor.front_stoep_all_occupancy", + "name": "All occupancy" + }, + { + "entity": "sensor.front_stoep_person_active_count", + "name": "Person Active Count" + }, + { + "entity": "sensor.front_stoep_person_count", + "name": "Person count" + }, + { + "entity": "binary_sensor.front_stoep_person_occupancy", + "name": "Person occupancy" + } + ], + "title": "Front Stoep" + }, + { + "type": "entities", + "entities": [ + { + "entity": "sensor.neighbour_flat_all_active_count", + "name": "All Active Count" + }, + { + "entity": "sensor.neighbour_flat_all_count", + "name": "All count" + }, + { + "entity": "binary_sensor.neighbour_flat_all_occupancy", + "name": "All occupancy" + }, + { + "entity": "sensor.neighbour_flat_person_active_count", + "name": "Person Active Count" + }, + { + "entity": "sensor.neighbour_flat_person_count", + "name": "Person count" + }, + { + "entity": "binary_sensor.neighbour_flat_person_occupancy", + "name": "Person occupancy" + } + ], + "title": "Neighbour (Flat)" + }, + { + "type": "grid", + "square": false, + "columns": 1, + "cards": [ + { + "type": "entities", + "entities": [ + "remote.nova" + ], + "title": "NOVA" + }, + { + "type": "media-control", + "entity": "media_player.nova" + } + ] + }, + { + "type": "grid", + "square": false, + "columns": 1, + "cards": [ + { + "type": "entities", + "entities": [ + { + "entity": "sensor.patio_all_active_count", + "name": "All Active Count" + }, + { + "entity": "sensor.patio_all_count", + "name": "All count" + }, + { + "entity": "binary_sensor.patio_all_occupancy", + "name": "All occupancy" + }, + { + "entity": "binary_sensor.patio_motion", + "name": "Motion" + }, + { + "entity": "sensor.patio_person_active_count", + "name": "Person Active Count" + }, + { + "entity": "sensor.patio_person_count", + "name": "Person count" + }, + { + "entity": "binary_sensor.patio_person_occupancy", + "name": "Person occupancy" + } + ], + "title": "Patio" + }, + { + "type": "picture-entity", + "entity": "camera.patio" + }, + { + "type": "picture", + "image_entity": "image.patio_person" + } + ] + }, + { + "type": "entities", + "entities": [ + { + "entity": "sensor.patio_gate_all_active_count", + "name": "All Active Count" + }, + { + "entity": "sensor.patio_gate_all_count", + "name": "All count" + }, + { + "entity": "binary_sensor.patio_gate_all_occupancy", + "name": "All occupancy" + }, + { + "entity": "sensor.patio_gate_person_active_count", + "name": "Person Active Count" + }, + { + "entity": "sensor.patio_gate_person_count", + "name": "Person count" + }, + { + "entity": "binary_sensor.patio_gate_person_occupancy", + "name": "Person occupancy" + } + ], + "title": "Patio Gate" + }, + { + "type": "entities", + "entities": [ + { + "entity": "sensor.patio_z1_all_active_count", + "name": "All Active Count" + }, + { + "entity": "sensor.patio_z1_all_count", + "name": "All count" + }, + { + "entity": "binary_sensor.patio_z1_all_occupancy", + "name": "All occupancy" + }, + { + "entity": "sensor.patio_z1_person_active_count", + "name": "Person Active Count" + }, + { + "entity": "sensor.patio_z1_person_count", + "name": "Person count" + }, + { + "entity": "binary_sensor.patio_z1_person_occupancy", + "name": "Person occupancy" + } + ], + "title": "Patio Z1" + }, + { + "type": "entities", + "entities": [ + { + "entity": "sensor.pool_all_active_count", + "name": "All Active Count" + }, + { + "entity": "sensor.pool_all_count", + "name": "All count" + }, + { + "entity": "binary_sensor.pool_all_occupancy", + "name": "All occupancy" + }, + { + "entity": "sensor.pool_person_active_count", + "name": "Person Active Count" + }, + { + "entity": "sensor.pool_person_count", + "name": "Person count" + }, + { + "entity": "binary_sensor.pool_person_occupancy", + "name": "Person occupancy" + } + ], + "title": "Pool" + }, + { + "type": "grid", + "square": false, + "columns": 1, + "cards": [ + { + "type": "entities", + "entities": [ + { + "entity": "sensor.westwall_all_active_count", + "name": "All Active Count" + }, + { + "entity": "sensor.westwall_all_count", + "name": "All count" + }, + { + "entity": "binary_sensor.westwall_all_occupancy", + "name": "All occupancy" + }, + { + "entity": "binary_sensor.westwall_motion", + "name": "Motion" + }, + { + "entity": "sensor.westwall_person_active_count", + "name": "Person Active Count" + }, + { + "entity": "sensor.westwall_person_count", + "name": "Person count" + }, + { + "entity": "binary_sensor.westwall_person_occupancy", + "name": "Person occupancy" + } + ], + "title": "Westwall" + }, + { + "type": "picture-entity", + "entity": "camera.westwall" + }, + { + "type": "picture", + "image_entity": "image.westwall_person" + } + ] + }, + { + "type": "entities", + "entities": [ + { + "entity": "sensor.westwall_z1_all_active_count", + "name": "All Active Count" + }, + { + "entity": "sensor.westwall_z1_all_count", + "name": "All count" + }, + { + "entity": "binary_sensor.westwall_z1_all_occupancy", + "name": "All occupancy" + }, + { + "entity": "sensor.westwall_z1_person_active_count", + "name": "Person Active Count" + }, + { + "entity": "sensor.westwall_z1_person_count", + "name": "Person count" + }, + { + "entity": "binary_sensor.westwall_z1_person_occupancy", + "name": "Person occupancy" + } + ], + "title": "Westwall Z1" + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/home-assistant/dashboards/lovelace.json b/home-assistant/dashboards/lovelace.json new file mode 100644 index 0000000..bfbe24f --- /dev/null +++ b/home-assistant/dashboards/lovelace.json @@ -0,0 +1,14 @@ +{ + "version": 1, + "minor_version": 1, + "key": "lovelace", + "data": { + "config": { + "strategy": { + "type": "original-states", + "hide_entities_without_area": false, + "hide_energy": false + } + } + } +} \ No newline at end of file diff --git a/home-assistant/dashboards/lovelace.map.json b/home-assistant/dashboards/lovelace.map.json new file mode 100644 index 0000000..693208b --- /dev/null +++ b/home-assistant/dashboards/lovelace.map.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "minor_version": 1, + "key": "lovelace.map", + "data": { + "config": { + "strategy": { + "type": "map" + } + } + } +} \ No newline at end of file diff --git a/home-assistant/dashboards/lovelace_dashboards.json b/home-assistant/dashboards/lovelace_dashboards.json new file mode 100644 index 0000000..ca6c871 --- /dev/null +++ b/home-assistant/dashboards/lovelace_dashboards.json @@ -0,0 +1,35 @@ +{ + "version": 1, + "minor_version": 1, + "key": "lovelace_dashboards", + "data": { + "items": [ + { + "id": "map", + "icon": "mdi:map", + "title": "Map", + "url_path": "map", + "require_admin": false, + "show_in_sidebar": true, + "mode": "storage" + }, + { + "id": "dashboard_sthome", + "show_in_sidebar": true, + "icon": "mdi:home", + "title": "sthome", + "require_admin": false, + "mode": "storage", + "url_path": "dashboard-sthome" + }, + { + "id": "dashboard_test", + "show_in_sidebar": true, + "title": "test", + "require_admin": false, + "mode": "storage", + "url_path": "dashboard-test" + } + ] + } +} \ No newline at end of file diff --git a/home-assistant/dashboards/lovelace_resources.json b/home-assistant/dashboards/lovelace_resources.json new file mode 100644 index 0000000..c8cab67 --- /dev/null +++ b/home-assistant/dashboards/lovelace_resources.json @@ -0,0 +1,19 @@ +{ + "version": 1, + "minor_version": 1, + "key": "lovelace_resources", + "data": { + "items": [ + { + "id": "e2e76867d1614c9ebdc654bb582b10f7", + "url": "/hacsfiles/android-tv-card/universal-remote-card.min.js?hacstag=6543936464312", + "type": "module" + }, + { + "id": "4748223247fe4f0d8b35a776538e9204", + "url": "/hacsfiles/universal-remote-card/universal-remote-card.min.js?hacstag=654393646442", + "type": "module" + } + ] + } +} \ No newline at end of file diff --git a/home-assistant/default_view.yml b/home-assistant/default_view.yml new file mode 100644 index 0000000..8a207e9 --- /dev/null +++ b/home-assistant/default_view.yml @@ -0,0 +1,105 @@ +path: default_view +title: Home +cards: + - type: weather-forecast + entity: weather.forecast_home + show_forecast: false + - type: entities + entities: + - person.chris + - sensor.sm_n986b_battery_health + - type: grid + square: false + columns: 1 + cards: + - type: entities + entities: + - remote.nova + title: Bedroom + - type: media-control + entity: media_player.nova + - type: grid + square: false + columns: 1 + cards: + - type: entities + entities: + - remote.xiaomi_tv_box + title: Living Room + - type: media-control + entity: media_player.smart_tv + - type: media-control + entity: media_player.xiaomi_tv_box_2 + - type: entities + entities: + - switch.sthome_ut1_alarm_zone_4 + - switch.sthome_ut1_floodlights_backyard + - switch.sthome_ut1_relay_2 + - switch.sthome_ut1_relay_3 + - switch.sthome_ut4_relay_5 + - switch.sthome_ut4_relay_6 + - binary_sensor.sthome_ut1_floodlights_test_mode + title: House + - type: grid + square: false + columns: 1 + cards: + - type: entities + entities: [] + title: Backyard Z1 + - type: picture-entity + entity: camera.backyard + - type: picture + image_entity: image.backyard_person + - type: grid + square: false + columns: 1 + cards: + - type: entities + entities: [] + title: Driveway Z1 + - type: picture-entity + entity: camera.driveway + - type: picture + image_entity: image.driveway_person + - type: grid + square: false + columns: 1 + cards: + - type: entities + entities: [] + - type: picture-entity + entity: camera.eastwall + - type: picture + image_entity: image.eastwall_person + - type: grid + square: false + columns: 1 + cards: + - type: entities + entities: [] + title: Patio Z1 + - type: picture-entity + entity: camera.patio + - type: picture + image_entity: image.patio_person + - type: grid + square: false + columns: 1 + cards: + - type: entities + entities: [] + title: Westwall Z1 + - type: picture-entity + entity: camera.westwall + - type: picture + image_entity: image.westwall_person + - 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 + title: Counters diff --git a/jellyfin/stacks/.env b/jellyfin/stacks/.env index f8e57d3..15d5521 100644 --- a/jellyfin/stacks/.env +++ b/jellyfin/stacks/.env @@ -11,3 +11,6 @@ SECRETSDIR=${STACKSDIR}/secrets DOMAINNAME=sthome.org SERVICE_PORT=8096 + +JELLYFIN_LOCAL=10.0.2.252 # for mDNS + diff --git a/jellyfin/stacks/compose.yml b/jellyfin/stacks/compose.yml index da3ca41..b9848f5 100644 --- a/jellyfin/stacks/compose.yml +++ b/jellyfin/stacks/compose.yml @@ -4,7 +4,9 @@ name: jellyfin networks: traefik-net: external: true - + macvlan1: + external: true + services: jellyfin: image: lscr.io/linuxserver/jellyfin:latest @@ -12,7 +14,9 @@ services: env_file: .jellyfin.env restart: unless-stopped networks: - - traefik-net + traefik-net: + # macvlan1: + # ipv4_address: ${JELLYFIN_LOCAL} # this deploy section requires the installation of the nvidia-container-toolkit; comment out if the toolkit is not installed deploy: resources: @@ -27,6 +31,8 @@ services: - "${DATADIR}/config:/config" - "${DATADIR}/transcodes:/config/data/transcodes" - "${MEDIADIR}:/data" +# depends_on: +# - avahi-tools labels: - traefik.enable=true - traefik.docker.network=traefik-net @@ -45,3 +51,10 @@ services: - "traefik.http.routers.${APPLICATION_NAME}-secure-rtr.tls.options=tls-options@file" - "traefik.http.routers.${APPLICATION_NAME}-secure-rtr.tls.certresolver=solver-dns" - "traefik.http.routers.${APPLICATION_NAME}-secure-rtr.service=${APPLICATION_NAME}-svc" + # avahi-tools: + # volumes: + # - /run/dbus:/var/run/dbus + # - /run/avahi-daemon:/var/run/avahi-daemon + # image: ahasbini/avahi-tools:latest + # #command: avahi-publish -a jellyfin.local ${JELLYFIN_LOCAL} + # command: avahi-publish-service -s jellyfin.local _http._tcp 8096 "Jellyfin" "Jellyfin Media Server" \ No newline at end of file