minor fixes

This commit is contained in:
Mahasri Kalavala 2021-01-10 18:15:03 -05:00
parent dab0d91303
commit b9b9f14ead
12 changed files with 145 additions and 111 deletions

View File

@ -17,13 +17,14 @@ homeassistant:
allowlist_external_dirs:
- /config/www/downloads/camera/patio/
- /config/www/downloads/camera/porch/
- /config/www/downloads/camera/garage/
- /config/www/downloads/camera/playarea/
- /config/www/downloads/camera/driveway/
- /config/www/downloads/camera/frontdoor/
- /config/www/downloads/camera/kitchen/
- /config/www/downloads/camera/frontroom/
- /config/www/downloads/camera/3dprinter/
- /config/www/downloads/camera/3d/
sun:
alexa:

View File

@ -82,4 +82,4 @@ cards:
show_header_toggle: true
entities:
- switch.frontyard_light
- switch.wemobackyardlightswitch
- switch.backyard_light

View File

@ -51,6 +51,22 @@ cards:
domain: script
action: stream_patio_camera_to_chromecast
- type: "custom:button-card"
name: Porch
entity: input_label.current_stream
icon: mdi:cctv
color_type: card
style:
- font-weight: bold
- color: rgb(0, 0, 5)
state:
- value: "porch"
color: var(--primary-color)
action: service
service:
domain: script
action: stream_porch_camera_to_chromecast
- type: "custom:button-card"
name: Playarea
entity: input_label.current_stream
@ -105,7 +121,7 @@ cards:
tap_action:
action: more-info
entities:
- switch.wemobackyardlightswitch
- switch.backyard_light
- binary_sensor.patio_camera_motion
- type: picture-glance
@ -129,7 +145,7 @@ cards:
tap_action:
action: more-info
entities:
- switch.wemobackyardlightswitch
- switch.backyard_light
- binary_sensor.playarea_camera_motion
- type: picture-glance

View File

@ -1051,7 +1051,7 @@ automation:
- platform: time_pattern
minutes: "/15"
action:
- service_template: "script.{{- ['driveway', 'patio', 'playarea'] | random -}}_cam"
- service_template: "script.{{- ['driveway', 'patio', 'playarea', 'porch'] | random -}}_cam"
script:
frontdoor_cam:
@ -1078,8 +1078,119 @@ script:
data_template:
url: !secret playarea_camera_stream_url
name: "playarea"
porch_cam:
sequence:
- service: script.stream2chromecast
data_template:
url: !secret porch_camera_stream_url
name: "porch"
reset_camera_stream:
alias: Reset Camera Stream
sequence:
- service: shell_command.reset_camera_stream
- service_template: "script.{{- ['frontdoor', 'driveway', 'patio', 'playarea'] | random -}}_cam"
###############################################################################
# On-Demand camera stream to chromecast scripts
#
stream_frontdoor_camera_to_chromecast:
sequence:
- condition: template
value_template: "{{ states('input_boolean.stream_camera2chromecast') == 'on' }}"
- service: script.stream2chromecast
data_template:
url: !secret frontdoor_camera_stream_url
name: "frontyard"
stream_driveway_camera_to_chromecast:
sequence:
- condition: template
value_template: "{{ states('input_boolean.stream_camera2chromecast') == 'on' }}"
- service: script.stream2chromecast
data_template:
url: !secret driveway_camera_stream_url
name: "driveway"
stream_patio_camera_to_chromecast:
sequence:
- condition: template
value_template: "{{ states('input_boolean.stream_camera2chromecast') == 'on' }}"
- service: script.stream2chromecast
data_template:
url: !secret patio_camera_stream_url
name: "patio"
stream_playarea_camera_to_chromecast:
sequence:
- condition: template
value_template: "{{ states('input_boolean.stream_camera2chromecast') == 'on' }}"
- service: script.stream2chromecast
data_template:
url: !secret playarea_camera_stream_url
name: "playarea"
stream_porch_camera_to_chromecast:
sequence:
- condition: template
value_template: "{{ states('input_boolean.stream_camera2chromecast') == 'on' }}"
- service: script.stream2chromecast
data_template:
url: !secret porch_camera_stream_url
name: "porch"
###############################################################################
# _____ ____ _
# / ____| / __ \ | |
# | | __ _ _ __ ___ ___ _ __ __ _ | | | |_ _____ _ __| | __ _ _ _
# | | / _` | '_ ` _ \ / _ \ '__/ _` | | | | \ \ / / _ \ '__| |/ _` | | | |
# | |___| (_| | | | | | | __/ | | (_| | | |__| |\ V / __/ | | | (_| | |_| |
# \_____\__,_|_| |_| |_|\___|_| \__,_| \____/ \_/ \___|_| |_|\__,_|\__, |
# __/ |
# |___/
#
# Camera Text Overlay Script - sets a given text as an overlay on camera feed
###############################################################################
frontdoor_camera_text_overlay:
sequence:
- service: rest_command.set_frontdoor_camera_text_left_bottom
data_template:
message: "{{text}}"
driveway_camera_text_overlay:
sequence:
- service: rest_command.set_driveway_camera_text_left_bottom
data_template:
message: "{{text}}"
patio_camera_text_overlay:
sequence:
- service: rest_command.set_patio_camera_text_left_bottom
data_template:
message: "{{text}}"
playarea_camera_text_overlay:
sequence:
- service: rest_command.set_playarea_camera_text_left_bottom
data_template:
message: "{{text}}"
###############################################################################
# Stream2Chromecast script streams a given URL to Chromecast
# But before it streams, it turns ON the media player if it is OFF, and after
# streaming the URL, it saves the current stream name
# BY calling media_player.turn_off, it forces Chromecast stream onto be active
# on TV as soon as it turns ON TV
stream2chromecast:
sequence:
- condition: template
value_template: "{{ states('input_label.current_stream') != name }}"
- service: media_player.play_media
data_template:
entity_id: media_player.attic_tv
media_content_id: "{{ url }}"
media_content_type: "video"
- service: input_label.set_value
data_template:
entity_id: input_label.current_stream
value: "{{ name }}"

View File

@ -108,9 +108,9 @@ automation:
state: "on"
action:
- service: switch.turn_off
entity_id: switch.frontyard
entity_id: switch.frontyard_light
- service: switch.turn_off
entity_id: switch.backyard
entity_id: switch.backyard_light
###############################################################################
# Turn OF Kitchen Lights after 3 hours of wake up time during school/work days
@ -162,9 +162,9 @@ automation:
state: "on"
action:
- service: switch.turn_on
entity_id: switch.frontyard
entity_id: switch.frontyard_light
- service: switch.turn_on
entity_id: switch.backyard
entity_id: switch.backyard_light
###############################################################################
# Turn indoor lights on 30 minutes before sunset

View File

@ -27,7 +27,6 @@ speedtestdotnet:
sensor:
- platform: uptime
name: Home Assistant Up Time
unit_of_measurement: hours
- platform: rest
resource: http://icanhazip.com

View File

@ -6,7 +6,7 @@
###############################################################################
homeassistant:
customize:
switch.frontyard:
switch.frontyard_light:
icon: mdi:lightbulb
friendly_name: Front Porch Lights
emulated_hue_name: Front Yard Lights
@ -18,7 +18,7 @@ homeassistant:
emulated_hue_name: Wemo Outlet
homebridge_name: Wemo Outlet
switch.backyard:
switch.backyard_light:
icon: mdi:lightbulb
friendly_name: Backyard Lights
emulated_hue_name: Backyard Lights

View File

@ -124,101 +124,6 @@ script:
- switch.upstairs_fragrance
- switch.officeroom_accent_lights
###############################################################################
# _____ ____ _
# / ____| / __ \ | |
# | | __ _ _ __ ___ ___ _ __ __ _ | | | |_ _____ _ __| | __ _ _ _
# | | / _` | '_ ` _ \ / _ \ '__/ _` | | | | \ \ / / _ \ '__| |/ _` | | | |
# | |___| (_| | | | | | | __/ | | (_| | | |__| |\ V / __/ | | | (_| | |_| |
# \_____\__,_|_| |_| |_|\___|_| \__,_| \____/ \_/ \___|_| |_|\__,_|\__, |
# __/ |
# |___/
#
# Camera Text Overlay Script - sets a given text as an overlay on camera feed
###############################################################################
frontdoor_camera_text_overlay:
sequence:
- service: rest_command.set_frontdoor_camera_text_left_bottom
data_template:
message: "{{text}}"
driveway_camera_text_overlay:
sequence:
- service: rest_command.set_driveway_camera_text_left_bottom
data_template:
message: "{{text}}"
patio_camera_text_overlay:
sequence:
- service: rest_command.set_patio_camera_text_left_bottom
data_template:
message: "{{text}}"
playarea_camera_text_overlay:
sequence:
- service: rest_command.set_playarea_camera_text_left_bottom
data_template:
message: "{{text}}"
###############################################################################
# On-Demand camera stream to chromecast scripts
#
stream_frontdoor_camera_to_chromecast:
sequence:
- condition: template
value_template: "{{ states('input_boolean.stream_camera2chromecast') == 'on' }}"
- service: script.stream2chromecast
data_template:
url: !secret frontdoor_camera_stream_url
name: "frontyard"
stream_driveway_camera_to_chromecast:
sequence:
- condition: template
value_template: "{{ states('input_boolean.stream_camera2chromecast') == 'on' }}"
- service: script.stream2chromecast
data_template:
url: !secret driveway_camera_stream_url
name: "driveway"
stream_patio_camera_to_chromecast:
sequence:
- condition: template
value_template: "{{ states('input_boolean.stream_camera2chromecast') == 'on' }}"
- service: script.stream2chromecast
data_template:
url: !secret patio_camera_stream_url
name: "patio"
stream_playarea_camera_to_chromecast:
sequence:
- condition: template
value_template: "{{ states('input_boolean.stream_camera2chromecast') == 'on' }}"
- service: script.stream2chromecast
data_template:
url: !secret playarea_camera_stream_url
name: "playarea"
###############################################################################
# Stream2Chromecast script streams a given URL to Chromecast
# But before it streams, it turns ON the media player if it is OFF, and after
# streaming the URL, it saves the current stream name
# BY calling media_player.turn_off, it forces Chromecast stream onto be active
# on TV as soon as it turns ON TV
stream2chromecast:
sequence:
- condition: template
value_template: "{{ states('input_label.current_stream') != name }}"
- service: media_player.play_media
data_template:
entity_id: media_player.attic_tv
media_content_id: "{{ url }}"
media_content_type: "video"
- service: input_label.set_value
data_template:
entity_id: input_label.current_stream
value: "{{ name }}"
stop_hass:
sequence:
- service: shell_command.stop_hass

View File

@ -82,8 +82,8 @@ automation:
trigger:
- platform: state
entity_id:
- switch.backyard
- switch.frontyard
- switch.backyard_light
- switch.frontyard_light
to: "on"
for:
minutes: 5

View File

@ -242,6 +242,8 @@ automation:
input_boolean.super_heavy_wind_alert
{%- elif ( windspeed > 60 ) %}
input_boolean.hurricane_wind_alert
{% else %}
input_boolean.dummy
{%- endif %}
# #Turn off those wind speed alert booleans automatically after 15 minutes.

View File

@ -94,7 +94,7 @@
"switch.kids_bedroom",
"switch.kitchen",
"switch.office_room",
"switch.wemobackyardlightswitch"] %}
"switch.backyard_light"] %}
{% for item in lights_switches -%}
{%- if states[item.split('.')[0]][item.split('.')[1]].state == "on" -%}
{%- set friendly_name = states[item.split('.')[0]][item.split('.')[1]].attributes.friendly_name -%}

View File

@ -28,7 +28,7 @@
"switch.kids_bedroom",
"switch.kitchen",
"switch.office_room",
"switch.wemobackyardlightswitch"] %}
"switch.backyard_light"] %}
{%- for item in lights_switches -%}
{%- if states[item.split('.')[0]][item.split('.')[1]].state == "on" -%}
{%- set friendly_name = states[item.split('.')[0]][item.split('.')[1]].attributes.friendly_name %}