From 68744695ddad7edcf0f7c0c5cb42be7b47ccfd17 Mon Sep 17 00:00:00 2001 From: Florian Brinker Date: Mon, 13 Jan 2020 15:43:32 +0100 Subject: [PATCH] Removed shinobi, replaced deconz with the integrated system, added replink custom component --- alexa.yaml | 4 +++ configuration.yaml | 52 ++++++++++++++++++------------------- lovelace-views/cctv.yaml | 24 +++++------------- scripts.yaml | 44 +------------------------------- sensors/cctv.yaml | 9 ------- switches.yaml | 55 ++++++++++++++++++++++++++++++++-------- 6 files changed, 83 insertions(+), 105 deletions(-) delete mode 100644 sensors/cctv.yaml diff --git a/alexa.yaml b/alexa.yaml index 283beb8..6df6d61 100644 --- a/alexa.yaml +++ b/alexa.yaml @@ -18,6 +18,7 @@ - switch.harmony_denon_power - switch.desktop_wol - switch.wallboard_display + - switch.tplink1 # include_domains: # - switch # exclude_entities: @@ -66,4 +67,7 @@ switch.wallboard_display: name: Display description: Wallboard Display + switch.tplink1: + name: Kamera + description: Wohnzimmer Kamera # ACHTUNG: WHITELIST EBENFALLS ERGÄNZEN! \ No newline at end of file diff --git a/configuration.yaml b/configuration.yaml index 4ae701d..0ac6964 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -116,9 +116,14 @@ influxdb: - sensor.instagram_codedwithlove_follows - sensor.instagram_codedwithlove_media -deconz: - host: !secret deconz_ip - port: !secret deconz_port +#deconz: +# host: !secret deconz_ip +# port: !secret deconz_port + +zha: + usb_path: /dev/ttyACM0 + radio_type: deconz + database_path: /config/zigbee.db emulated_roku: servers: @@ -210,12 +215,6 @@ binary_sensor: host: !secret desktop_ip count: 2 scan_interval: 15 - - platform: template - sensors: - cctv_active: - value_template: "{{ is_state('sensor.camera_mode_office', 'start') or is_state('sensor.camera_mode_office', 'recording') }}" - cctv_motion_detection_active: - value_template: "{{ (is_state('sensor.camera_mode_office', 'start') or is_state('sensor.camera_mode_office', 'recording')) and is_state('sensor.camera_motion_office', 'True') }}" - platform: command_line name: Wallboard HDMI Status command: !secret wallboard_hdmi_status_cmd @@ -228,26 +227,35 @@ binary_sensor: value_template: >- {{ is_state('person.florian', 'home') or is_state('person.jenny', 'home') }} + - platform: template + sensors: + motion_livingroom: + friendly_name: Motion Livingroom + device_class: motion + entity_id: camera.livingroom + value_template: "{{ is_state('camera.livingroom', 'motion') }}" + delay_off: + seconds: 30 weather: - platform: openweathermap api_key: !secret openweathermap -#octoprint: -# host: !secret octoprint_ip -# api_key: !secret octoprint_api_key -# bed: true -# number_of_tools: 1 - ffmpeg: ffmpeg_bin: /usr/bin/ffmpeg stream: camera: - - platform: ffmpeg - name: office - input: !secret office_stream_url + - platform: reolink_dev + host: !secret cam_livingroom_ip + username: !secret cam_livingroom_user + password: !secret cam_livingroom_password + name: livingroom + stream: main + protocol: rtsp + channel: 0 + scan_interval: 30 input_datetime: bedroom_alarm_clock_time: @@ -281,18 +289,10 @@ rest_command: url: "https://{{ host }}/{{ apikey }}/monitorStates/{{ group }}/{{ preset_name }}" panel_iframe: - cctv: - title: 'CCTV' - url: !secret url_cctv - icon: mdi:cctv chronograf: title: 'Chronograf' url: !secret url_chronograf icon: mdi:monitor-dashboard - deconz: - title: 'Deconz' - url: !secret url_deconz - icon: mdi:gate-and esphome: title: 'ESPHome' url: !secret url_esphome diff --git a/lovelace-views/cctv.yaml b/lovelace-views/cctv.yaml index 27fb8fd..e5de9e7 100644 --- a/lovelace-views/cctv.yaml +++ b/lovelace-views/cctv.yaml @@ -1,24 +1,14 @@ icon: mdi:cctv path: cctv cards: - - type: entities - show_header_toggle: false - entities: - - entity: binary_sensor.cctv_active - name: Kameras aktiviert - icon: mdi:power - - entity: binary_sensor.cctv_motion_detection_active - name: Aufnahmen bei Bewegung - icon: mdi:motion-sensor - type: picture-glance - title: Büro - camera_image: camera.office - camera_view: live - entities: - - entity: binary_sensor.cctv_motion_detection_active - icon: mdi:motion-sensor - - entity: binary_sensor.cctv_active - icon: mdi:power + camera_image: camera.livingroom + entities: + - binary_sensor.motion_livingroom + - switch.camera_livingroom_ir_lights +# - switch.camera_livingroom_email +# - switch.camera_livingroom_ftp + title: Wohnzimmer - type: alarm-panel name: Alarm entity: alarm_control_panel.home_alarm diff --git a/scripts.yaml b/scripts.yaml index 39ed14d..57dc8d0 100644 --- a/scripts.yaml +++ b/scripts.yaml @@ -125,48 +125,6 @@ harmony_volume_down: device: 42849850 #Denon num_repeats: 5 -# CCTV - -shinobi_idle: - sequence: - - service: rest_command.shinobi_monitorstates - data: - host: !secret shinobi_host - apikey: !secret shinobi_api_key - group: !secret shinobi_group - preset_name: Inactive (Idle) - -shinobi_active: - sequence: - - service: rest_command.shinobi_monitorstates - data: - host: !secret shinobi_host - apikey: !secret shinobi_api_key - group: !secret shinobi_group - preset_name: Active + Motion Detection OFF - -shinobi_active_with_motion: - sequence: - - service: rest_command.shinobi_monitorstates - data: - host: !secret shinobi_host - apikey: !secret shinobi_api_key - group: !secret shinobi_group - preset_name: Active + Motion Detection ON - -shinobi_notify: - sequence: - - service: notify.telegram_fb - data_template: - title: "*ALARM: Bewegung erkannt*" - message: | - [Live-Stream]({{ stream_url }}) - Monitor: {{ name }} - Confidence: {{ confidence }} - Letzte Aufnahmen: - - [{{ video_last }}]({{ video_url }}/{{ video_last }}) - - [{{ video_previous }}]({{ video_url }}/{{ video_previous }}) - # Wallboard wallboard_hdmi_on: @@ -178,7 +136,7 @@ wallboard_hdmi_on: user: !secret wallboard_ssh_user port: !secret wallboard_ssh_port command_or_param: 1 - + wallboard_hdmi_off: sequence: - service: shell_command.ssh diff --git a/sensors/cctv.yaml b/sensors/cctv.yaml deleted file mode 100644 index e04aad3..0000000 --- a/sensors/cctv.yaml +++ /dev/null @@ -1,9 +0,0 @@ -- platform: rest - resource: !secret office_details_url - name: Camera Mode Office - value_template: '{{ value_json.mode }}' - -- platform: rest - resource: !secret office_details_url - name: Camera Motion Office - value_template: '{{ value_json.details|string|regex_search("\"detector\":\"1\"", ignorecase=FALSE) }}' diff --git a/switches.yaml b/switches.yaml index b1ca81b..77c14b1 100644 --- a/switches.yaml +++ b/switches.yaml @@ -113,21 +113,56 @@ ### CCTV - cctv_motion_detection: - friendly_name: CCTV Motion Detection - value_template: "{{ states('binary_sensor.cctv_motion_detection_active') }}" + camera_livingroom_email: + value_template: "{{ is_state_attr('camera.livingroom', 'email_enabled', true) }}" turn_on: - service: script.shinobi_active_with_motion + service: camera.enable_email + data: + entity_id: camera.livingroom turn_off: - service: script.shinobi_active + service: camera.disable_email + data: + entity_id: camera.livingroom + icon_template: >- + {% if is_state_attr('camera.livingroom', 'email_enabled', true) %} + mdi:email + {% else %} + mdi:email-outline + {% endif %} - cctv_active: - friendly_name: CCTV Active - value_template: "{{ states('binary_sensor.cctv_active') }}" + camera_livingroom_ftp: + value_template: "{{ is_state_attr('camera.livingroom', 'ftp_enabled', true) }}" turn_on: - service: script.shinobi_active + service: camera.enable_ftp + data: + entity_id: camera.livingroom turn_off: - service: script.shinobi_idle + service: camera.disable_ftp + data: + entity_id: camera.livingroom + icon_template: >- + {% if is_state_attr('camera.livingroom', 'ftp_enabled', true) %} + mdi:filmstrip + {% else %} + mdi:filmstrip-off + {% endif %} + + camera_livingroom_ir_lights: + value_template: "{{ is_state_attr('camera.livingroom', 'ir_lights_enabled', true) }}" + turn_on: + service: camera.enable_ir_lights + data: + entity_id: camera.livingroom + turn_off: + service: camera.disable_ir_lights + data: + entity_id: camera.livingroom + icon_template: >- + {% if is_state_attr('camera.livingroom', 'ir_lights_enabled', true) %} + mdi:flashlight + {% else %} + mdi:flashlight-off + {% endif %} ### Wallboard