Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tinuva committed Feb 12, 2025
1 parent 490312d commit e55f02e
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 66 deletions.
2 changes: 2 additions & 0 deletions configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ homeassistant:
name: Home
allowlist_external_dirs: # changed from whitelist_external_dirs to allowlist_external_dirs in 0.113.0
- /config/
allowlist_external_urls:
- https://ha.heaven.za.net
#customize: !include includes/customize.yaml
default_config:
frontend:
Expand Down
5 changes: 4 additions & 1 deletion logging/logger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ logs:
# homeassistant.components.light: warn
# homeassistant.components.media_player: debug
# homeassistant.components.mqtt: debug
# homeassistant.components.notify: error
homeassistant.components.notify: warn
homeassistant.components.slack.notify: debug
# homeassistant.components.python_script: debug
homeassistant.components.rest: debug
homeassistant.components.sensor: fatal
Expand All @@ -74,3 +75,5 @@ logs:
aiohttp.server: fatal
pychromecast.socket_client: fatal
plexwebsocket: fatal

homeassistant.components.python_script.shellies_discovery.py: fatal

Check failure on line 79 in logging/logger.yaml

View workflow job for this annotation

GitHub Actions / 🧹 yamllint

no new line character at the end of file
14 changes: 7 additions & 7 deletions packages/notifications/dismiss_persistant_notifications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ automation:
Persistent notification dismissed. {{now()}}
{{ trigger.event.as_dict()['data']}}
level: warning
- service: script.log
data:
object: 'persistent_notification'
message: >
Persistent notification dismissed. {{now()}}
{{ trigger.event.as_dict()['data']}}
target: 'alerts-david'
# - service: script.log
# data:
# object: 'persistent_notification'
# message: >
# Persistent notification dismissed. {{now()}}
# {{ trigger.event.as_dict()['data']}}
# target: 'alerts-david'

- alias: 'persistent notification log and dismiss invalid config'
trigger:
Expand Down
44 changes: 4 additions & 40 deletions packages/notifications/notification_scripts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ script:
######################################################################
# - service: script.log
# data:
# icon: ':robot_face:' # optional
# object: 'Vacuum Robot' # required
# message: 'The robot is stuck' # required
# target: 'logs' # optional - default 'logs'
######################################################################
Expand All @@ -25,13 +23,6 @@ script:
{% endif %}
message: '{{ message }}'
data:
icon: >
{% if icon is defined %}
{{ icon }}
{% else %}
:house:
{% endif %}
username: '{{ object }}'
blocks_template:
- type: section
text:
Expand All @@ -45,8 +36,6 @@ script:
######################################################################
# - service: script.alert
# data:
# icon: ':robot_face:' # optional
# object: 'Vacuum Robot' # required
# message: 'The robot is stuck' # required
# target: 'alerts' # optional - default 'alerts'
######################################################################
Expand All @@ -60,12 +49,6 @@ script:
{% else %}
["#alerts"]
{% endif %}
icon: >
{% if icon is defined %}
{{ icon }}
{% else %}
:house:
{% endif %}
cam: >
{% if camera is defined %}
{{ camera }}
Expand All @@ -81,34 +64,24 @@ script:
sequence:
- service: camera.snapshot
data:
filename: "/config/www/cam_captures/script_log.jpg"
filename: "/config/www/cam_captures/script_log_{{ cam }}.jpg"
target:
entity_id: "{{ cam }}"
- service: notify.bezuidenhouts
data:
message: '{{ message }}'
target: '{{ target }}'
title: '{{ cam }}'
data:
icon: "{{ icon }}"
username: '{{ object }}'
- service: notify.bezuidenhouts
data:
message: ''
target: '{{ target }}'
data:
#icon: "{{ icon }}"
#username: '{{ object }}'
file:
path: "/config/www/cam_captures/script_log.jpg"
### path is now required as of 0.113.0 see https://github.com/home-assistant/home-assistant.io/pull/13860/files
path: "/config/www/cam_captures/script_log_{{ cam }}.jpg"

default:
- service: notify.bezuidenhouts
data_template:
target: "{{ target }}"
message: '{{ message }}'
data:
icon: "{{ icon }}"
username: '{{ object }}'
blocks_template:
- type: section
text:
Expand All @@ -122,8 +95,6 @@ script:
######################################################################
# - service: script.alert
# data:
# icon: ':robot_face:' # optional
# object: 'Vacuum Robot' # required
# message: 'The robot is stuck' # required
# target: 'alerts' # optional - default 'alerts'
######################################################################
Expand All @@ -132,13 +103,6 @@ script:
sequence:
- service: script.alert
data:
icon: >
{% if icon is defined %}
{{ icon }}
{% else %}
:house:
{% endif %}
object: '{{ object }}'
target: >
{% if target is defined %}
{{ target }}
Expand Down
3 changes: 3 additions & 0 deletions packages/security/alarm_notifications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ automation:
- condition: template
value_template: >
{{ trigger.from_state != None }}
- condition: template
value_template: >
{{ trigger.from_state.state != "unavailable" }}
action:
- service: script.log
data:
Expand Down
46 changes: 28 additions & 18 deletions packages/security/bi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,33 @@ automation:
value_template: >
{{ should_notify }}
action:
- service: notify.bezuidenhouts
- service: script.alert
data:
target: '#alerts-camera'
target: 'alerts-camera'
camera: >-
{{ cam_entity + cam }}
message: >-
Motion on {{ cam_name }} camera at {{ img_time }} {{- '\n' -}}
Type: {{ ai_object }} Confidence: {{ ai_confidence }}
title: Camera Alert
data:
blocks:
- type: section
text:
type: mrkdwn
text: >-
Motion on *{{ cam_name }}* camera at *{{ img_time }}* {{- '\n' -}}
*Type*: {{ ai_object }} *Confidence*: {{ ai_confidence }} {{- '\n' -}}
<https://bi.heaven.za.net/alerts/{{ bi_dbid }}?fulljpeg|Image>
<https://bi.heaven.za.net/ui3.htm?maximize=1&tab=alerts&cam={{ cam }}&rec={{ bi_dbid }}&timeout=0|Video> {{- '\n' -}}
- type: image
image_url: https://ha.heaven.za.net{{ state_attr( cam_entity + cam , "entity_picture") }}
alt_text: Image preview
Motion on *{{ cam_name }}* camera at *{{ img_time }}* {{- '\n' -}}
*Type*: {{ ai_object }} *Confidence*: {{ ai_confidence }} {{- '\n' -}}
<https://bi.heaven.za.net/alerts/{{ bi_dbid }}?fulljpeg|Image>
<https://bi.heaven.za.net/ui3.htm?maximize=1&tab=alerts&cam={{ cam }}&rec={{ bi_dbid }}&timeout=0|Video> {{- '\n' -}}
# - service: notify.bezuidenhouts
# data:
# target: '#alerts-camera'
# message: >-
# Motion on {{ cam_name }} camera at {{ img_time }} {{- '\n' -}}
# Type: {{ ai_object }} Confidence: {{ ai_confidence }}
# title: Camera Alert
# data:
# blocks:
# - type: section
# text:
# type: mrkdwn
# text: >-
# Motion on *{{ cam_name }}* camera at *{{ img_time }}* {{- '\n' -}}
# *Type*: {{ ai_object }} *Confidence*: {{ ai_confidence }} {{- '\n' -}}
# <https://bi.heaven.za.net/alerts/{{ bi_dbid }}?fulljpeg|Image>
# <https://bi.heaven.za.net/ui3.htm?maximize=1&tab=alerts&cam={{ cam }}&rec={{ bi_dbid }}&timeout=0|Video> {{- '\n' -}}
# - type: image
# image_url: https://ha.heaven.za.net{{ state_attr( cam_entity + cam , "entity_picture") }}
# alt_text: Image preview

0 comments on commit e55f02e

Please sign in to comment.