Initial Mercury Setup

This commit is contained in:
2021-01-30 20:05:57 +02:00
parent f2060b4df3
commit 09d254e675
8 changed files with 34 additions and 109 deletions
@@ -101,6 +101,10 @@ cards:
entity: input_boolean.guest_mode entity: input_boolean.guest_mode
tap_action: tap_action:
action: toggle action: toggle
- type: custom:button-card
template: [small, with_state_background]
entity: switch.mercury_home_mode
name: Mercury Home
- type: horizontal-stack - type: horizontal-stack
cards: cards:
@@ -134,13 +138,6 @@ cards:
variables: variables:
state_indicator_id: automation.titanium_turn_off_when_idle state_indicator_id: automation.titanium_turn_off_when_idle
- type: custom:button-card
template: [small, with_state_background]
entity: sensor.synology_type_volume_1
name: Platinum
icon: mdi:nas
tap_action:
action: more-info
- type: custom:button-card - type: custom:button-card
template: [small, with_state_background] template: [small, with_state_background]
entity: binary_sensor.pi_hole_enabled entity: binary_sensor.pi_hole_enabled
@@ -165,10 +162,6 @@ cards:
name: "Kitchen" name: "Kitchen"
- type: horizontal-stack - type: horizontal-stack
cards: cards:
- type: custom:button-card
template: [small, with_state_background]
entity: switch.camera
name: Camera
- type: custom:button-card - type: custom:button-card
template: [small, with_state_background, with_state_indicator] template: [small, with_state_background, with_state_indicator]
entity: fan.philips_airpurifier entity: fan.philips_airpurifier
@@ -104,6 +104,10 @@ cards:
entity: input_boolean.guest_mode entity: input_boolean.guest_mode
tap_action: tap_action:
action: toggle action: toggle
- type: custom:button-card
template: [small, with_state_background]
entity: switch.mercury_home_mode
name: Mercury Home
- type: custom:button-card - type: custom:button-card
template: small template: small
entity: media_player.living_room_tv entity: media_player.living_room_tv
@@ -146,10 +150,6 @@ cards:
template: [radiator_button, small] template: [radiator_button, small]
entity: climate.kitchen_radiator_mode entity: climate.kitchen_radiator_mode
name: "Kitchen" name: "Kitchen"
- type: custom:button-card
template: [small, with_state_background]
entity: switch.camera
name: Camera
- type: custom:button-card - type: custom:button-card
template: [small, with_state_indicator] template: [small, with_state_indicator]
entity: fan.philips_airpurifier entity: fan.philips_airpurifier
@@ -94,13 +94,6 @@
entity: switch.titanium entity: switch.titanium
variables: variables:
state_indicator_id: automation.titanium_turn_off_when_idle state_indicator_id: automation.titanium_turn_off_when_idle
- type: custom:button-card
template: default
entity: sensor.synology_type_volume_1
name: Platinum
icon: mdi:nas
tap_action:
action: more-info
- type: custom:button-card - type: custom:button-card
template: default template: default
entity: binary_sensor.pi_hole_enabled entity: binary_sensor.pi_hole_enabled
@@ -134,13 +127,9 @@
title: Camera title: Camera
cards: cards:
- type: picture-glance - type: picture-glance
camera_image: camera.amcrest_camera camera_image: camera.mercury_amcrest_1
entities: entities:
- entity: camera.amcrest_camera - entity: camera.mercury_amcrest_1
- entity: switch.camera
show_state: false
- entity: binary_sensor.amcrest_camera_online
show_state: false
- type: vertical-stack - type: vertical-stack
@@ -120,13 +120,6 @@
variables: variables:
state_indicator_id: automation.titanium_turn_off_when_idle state_indicator_id: automation.titanium_turn_off_when_idle
- type: custom:button-card
template: default
entity: sensor.synology_type_volume_1
name: Platinum
icon: mdi:nas
tap_action:
action: more-info
- type: custom:button-card - type: custom:button-card
template: default template: default
entity: binary_sensor.pi_hole_enabled entity: binary_sensor.pi_hole_enabled
@@ -153,7 +146,7 @@
cards: cards:
- type: custom:button-card - type: custom:button-card
template: default template: default
entity: switch.camera entity: binary_sensor.camera_state
name: Camera name: Camera
- type: custom:button-card - type: custom:button-card
template: [default, with_state_indicator] template: [default, with_state_indicator]
@@ -211,6 +204,10 @@
entity: input_boolean.guest_mode entity: input_boolean.guest_mode
tap_action: tap_action:
action: toggle action: toggle
- type: custom:button-card
template: default
entity: switch.mercury_home_mode
name: Mercury
- type: vertical-stack - type: vertical-stack
cards: cards:
+2 -9
View File
@@ -71,7 +71,7 @@ sensor.synology_type_volume_1:
type: custom:decluttering-card type: custom:decluttering-card
template: platinum_card template: platinum_card
switch.camera: binary_sensor.camera_state:
title: Security camera title: Security camera
style: *popup_style style: *popup_style
auto_close: true auto_close: true
@@ -80,17 +80,10 @@ switch.camera:
cards: cards:
- type: picture-entity - type: picture-entity
aspect_ratio: 50% aspect_ratio: 50%
entity: camera.amcrest_camera entity: camera.mercury_amcrest_1
show_name: true show_name: true
show_state: true show_state: true
- type: entities
title: Camera Controls
show_header_toggle: false
entities:
- switch.camera
- binary_sensor.amcrest_camera_online
media_player.kitchen: media_player.kitchen:
title: Kitchen Sonos title: Kitchen Sonos
style: *popup_style style: *popup_style
+13 -62
View File
@@ -1,11 +1,11 @@
# https://www.home-assistant.io/integrations/amcrest # https://www.home-assistant.io/integrations/amcrest
amcrest: # amcrest:
- host: !secret amcrest_ip # - host: !secret amcrest_ip
username: !secret amcrest_username # username: !secret amcrest_username
password: !secret amcrest_password # password: !secret amcrest_password
resolution: low # resolution: low
binary_sensors: # binary_sensors:
- online # - online
binary_sensor: binary_sensor:
- platform: template - platform: template
@@ -14,59 +14,10 @@ binary_sensor:
friendly_name: Security camera friendly_name: Security camera
device_class: safety device_class: safety
value_template: >- value_template: >-
{{ is_state('camera.amcrest_camera', 'streaming') or is_state('camera.amcrest_camera', 'recording') }} {{ is_state('camera.mercury_amcrest_1', 'streaming') or is_state('camera.mercury_amcrest_1', 'recording') }}
icon_template: >-
switch: {% if is_state('camera.mercury_amcrest_1', 'streaming') or is_state('camera.mercury_amcrest_1', 'recording') %}
- platform: template mdi:video
switches: {% else %}
camera: mdi:video-off
friendly_name: Security camera
value_template: "{{ is_state('binary_sensor.camera_state', 'on') }}"
icon_template: >
{% if is_state('binary_sensor.camera_state', 'on') %} mdi:shield-home
{% else %} mdi:shield-off
{% endif %} {% endif %}
turn_on:
service: script.security_camera_on
turn_off:
service: script.security_camera_off
script:
security_camera_on:
alias: Security camera · Turn on
sequence:
- service: camera.turn_on
entity_id: camera.amcrest_camera
- service: amcrest.goto_preset
entity_id: camera.amcrest_camera
data:
preset: 1
- service: amcrest.enable_recording
entity_id: camera.amcrest_camera
- service: amcrest.enable_audio
entity_id: camera.amcrest_camera
security_camera_off:
alias: Security camera · Turn off
sequence:
- service: amcrest.goto_preset
entity_id: camera.amcrest_camera
data:
preset: 2
- service: amcrest.disable_recording
entity_id: camera.amcrest_camera
- service: amcrest.disable_audio
entity_id: camera.amcrest_camera
- service: camera.turn_off
entity_id: camera.amcrest_camera
automation:
# Hack - the switch.camera initial state is wrong (ON) when the server starts.
- alias: Camera · Startup
trigger:
- platform: homeassistant
event: start
action:
- delay: 00:00:10
- service: switch.turn_off
entity_id: switch.camera
+2 -1
View File
@@ -16,7 +16,8 @@ script:
data: data:
brightness_pct: 100 brightness_pct: 100
- service: script.bed_led_on - service: script.bed_led_on
- service: script.security_camera_off - service: switch.turn_on
entity_id: switch.mercury_home_mode
- service: script.routine_coming_home_after_sunset - service: script.routine_coming_home_after_sunset
- service: input_select.select_option - service: input_select.select_option
entity_id: input_select.hallway_dashboard_mode entity_id: input_select.hallway_dashboard_mode
+2 -1
View File
@@ -2,7 +2,8 @@ script:
routine_leaving_home: routine_leaving_home:
alias: Routine · Leaving home alias: Routine · Leaving home
sequence: sequence:
- service: script.security_camera_on - service: switch.turn_off
entity_id: switch.mercury_home_mode
- service: homeassistant.turn_off - service: homeassistant.turn_off
entity_id: entity_id: