From e1ebf5ed61bacbb1d1fa08d2a9becbee8082580f Mon Sep 17 00:00:00 2001 From: pgrondek Date: Thu, 24 Jun 2021 22:18:01 +0200 Subject: [PATCH] Add zoneminder --- configuration/automations/camera.yaml | 41 +++++++++++++++++++++++++++ configuration/configuration.yaml | 11 ++++++- scripts/10.modes.yaml | 8 ++++++ 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 configuration/automations/camera.yaml diff --git a/configuration/automations/camera.yaml b/configuration/automations/camera.yaml new file mode 100644 index 0000000..b05a509 --- /dev/null +++ b/configuration/automations/camera.yaml @@ -0,0 +1,41 @@ +- id: camera_1_notification + alias: '[Camera] 1 notification' + condition: + - condition: state + entity_id: alarm_control_panel.ha_alarm + state: armed_away + trigger: + - platform: state + entity_id: binary_sensor.kitchen_motion_sensor + from: 'off' + to: 'on' + action: + - service: notify.mobile_app_przemyslaws_iphone + data: + message: Motion Detected in Kitchen! + data: + entity_id: camera.monitor_1 + url: + _: "/lovelace-tablet/cctv" + mode: single + +- id: camera_2_notification + alias: '[Camera] 2 notification' + condition: + - condition: state + entity_id: alarm_control_panel.ha_alarm + state: armed_away + trigger: + - platform: state + entity_id: binary_sensor.hallway_motion_sensor + from: 'off' + to: 'on' + action: + - service: notify.mobile_app_przemyslaws_iphone + data: + message: Motion Detected in Hallway! + data: + entity_id: camera.monitor_2 + url: + _: "/lovelace-tablet/cctv" + mode: single diff --git a/configuration/configuration.yaml b/configuration/configuration.yaml index 8aea892..66c9c84 100644 --- a/configuration/configuration.yaml +++ b/configuration/configuration.yaml @@ -31,7 +31,6 @@ mqtt: ios: actions: - name: door_lock - text: Front Door background_color: "#000000" label: text: "Door Lock" @@ -47,6 +46,13 @@ octoprint: number_of_tools: 1 bed: true +zoneminder: + - host: 192.168.50.197 + path_zms: cgi-bin/nph-zms + path: /zm/ +camera: + - platform: zoneminder + influxdb: host: 192.168.50.100 port: 8086 @@ -401,6 +407,9 @@ http: login_attempts_threshold: 5 switch: + - platform: zoneminder + command_on: Modect + command_off: Monitor # Living Room - platform: template switches: diff --git a/scripts/10.modes.yaml b/scripts/10.modes.yaml index 716f607..1f2eee7 100644 --- a/scripts/10.modes.yaml +++ b/scripts/10.modes.yaml @@ -104,6 +104,10 @@ leave_home: - light.hallway_light - light.hallway_lightstrip - light.computer_computer_cave_background + - service: switch.turn_on + entity_id: + - switch.monitor_1_state + - switch.monitor_2_state - service: switch.turn_off entity_id: switch.desk_motor_on_off - service: script.pc_sleep @@ -127,5 +131,9 @@ arrive_home: entity_id: - switch.desk_motor_on_off - switch.computer_outlet + - service: switch.turn_off + entity_id: + - switch.monitor_1_state + - switch.monitor_2_state mode: single icon: mdi:home-import-outline \ No newline at end of file