minor updates.

This commit is contained in:
Mahasri Kalavala 2020-07-16 21:15:43 -04:00
parent 023c71f018
commit 0f735e39c7
6 changed files with 80 additions and 61 deletions

View File

@ -41,6 +41,7 @@ homekit:
- light
- switch
- input_boolean
- camera
include_entities:
- binary_sensor.back_door_sensor_sensor
- binary_sensor.aeotec_zw120_door_window_sensor_gen5_sensor
@ -70,7 +71,7 @@ python_script:
logger: !include logging.yaml
zeroconf:
owntracks:
#owntracks:
system_health:
life360:

View File

@ -209,10 +209,7 @@ automation:
action:
- condition: template
value_template: "{{ states('input_boolean.notify_camera_alerts') == 'on' }}"
- service: script.stream2chromecast
data_template:
url: !secret frontdoor_camera_stream_url
name: "frontyard"
- service: script.frontdoor_cam
- condition: template
value_template: "{{ states('alarm_control_panel.home') == 'armed_home' or states('alarm_control_panel.home') == 'armed_away' }}"
- service: image_processing.scan
@ -845,10 +842,7 @@ automation:
as_timestamp(states.input_label.current_stream.last_updated))
| int > 15 }}"
action:
- service: script.stream2chromecast
data_template:
url: !secret frontdoor_camera_stream_url
name: "frontyard"
- service: script.frontdoor_cam
#
# Every 15 minutes, change stream to alternate view with random cameras
@ -861,6 +855,12 @@ automation:
- service_template: "script.{{- ['driveway', 'patio', 'playarea'] | random -}}_cam"
script:
frontdoor_cam:
sequence:
- service: script.stream2chromecast
data_template:
url: !secret frontdoor_camera_stream_url
name: "frontyard"
driveway_cam:
sequence:
- service: script.stream2chromecast

View File

@ -119,6 +119,16 @@ automation:
payload: "off"
retain: false
- alias: Turn Garage Lights On When Motion Detected
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.motion_sensor_158d000272bf48
to: "on"
action:
- service: switch.turn_on
entity_id: switch.garage
- alias: Kitchen Camera Motion Reset
initial_state: true
trigger:
@ -276,19 +286,21 @@ automation:
action:
- service: switch.turn_on
entity_id: switch.front_room
- service: script.frontdoor_cam
- alias: When Back Door Opens Turn Kitchen Lights ON
initial_state: true
trigger:
platform: state
entity_id: binary_sensor.back_door_sensor_sensor
to: "on"
- platform: state
entity_id: binary_sensor.back_door_sensor_sensor
to: "on"
condition:
- condition: template
value_template: "{{ states('sun.sun') == 'below_horizon' }}"
action:
- service: switch.turn_on
entity_id: switch.kitchen
- service_template: "script.{{ ['patio_cam', 'playarea_cam'] | random }}"
################################################################################
# When I open the garage door

View File

@ -237,6 +237,7 @@ automation:
brightness: 10
- service: timer.start
entity_id: timer.timer_masterbedroom
# Master Bedroom:
# Timer Elapsed - Turn OFF lights
###############################################################################
@ -255,27 +256,29 @@ automation:
- delay: "00:00:05"
- service: light.turn_off
entity_id: light.master_bedroom
# Garage:
# Motion Detected - Turn ON the light and extend timer
#
# Added a condition - if the lights were just turn off in the last 30 seconds,
# do not turn ON the lights again
###############################################################################
- alias: Garage Motion & Timer
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.garage_motion
from: "off"
to: "on"
condition:
- condition: template
value_template: "{{ states('input_boolean.working_in_garage') | lower == 'on' }}"
- condition: template
value_template: "{{ (as_timestamp(now()) - as_timestamp(states.switch.garage.last_updated)) | int > 30 }}"
action:
- service: switch.turn_on
entity_id: switch.garage
# # Garage:
# # Motion Detected - Turn ON the light and extend timer
# #
# # Added a condition - if the lights were just turn off in the last 30 seconds,
# # do not turn ON the lights again
# ###############################################################################
# - alias: Garage Motion & Timer
# initial_state: true
# trigger:
# - platform: state
# entity_id: binary_sensor.garage_motion
# from: "off"
# to: "on"
# condition:
# - condition: template
# value_template: "{{ states('input_boolean.working_in_garage') | lower == 'on' }}"
# - condition: template
# value_template: "{{ (as_timestamp(now()) - as_timestamp(states.switch.garage.last_updated)) | int > 30 }}"
# action:
# - service: switch.turn_on
# entity_id: switch.garage
# Start the timer when the lights are ON
###############################################################################
- alias: Garage Timer Start When Garage Lights ON
@ -288,6 +291,7 @@ automation:
action:
- service: timer.start
entity_id: timer.timer_garage
# Garage:
# Timer Elapsed - Turn OFF lights, when "I am not working"
###############################################################################

View File

@ -1,6 +1,8 @@
## skalavala's Home Automation/Smart Home
Here you will find a bunch of scripts that I use to automate my home.
skalavala's Home Automation
<!-- Here you will find a bunch of scripts that I use to automate my home.
I have a bunch of Raspberry Pi's, and Pi Zeros at home along with a bunch of "smart" devices of various brands. All these smart devices work great independently but not together. My goal is to bring all of them together and have them talk to each other with a little bit of programming and make them really smarter as a whole! I also want to be able to run all the software on Raspberry Pi's only.
@ -296,4 +298,4 @@ I wrote a Palo Alto component to keep an eye on who is logging into my firewall
### Tesla
<img src="https://raw.githubusercontent.com/skalavala/mysmarthome/master/images/Tesla.png" />
<img src="https://raw.githubusercontent.com/skalavala/mysmarthome/master/images/Tesla.png" /> -->

View File

@ -34,10 +34,10 @@
</CommandClass>
<CommandClass id="49" name="COMMAND_CLASS_SENSOR_MULTILEVEL" version="5" innif="true">
<Instance index="1" />
<Value type="decimal" genre="user" instance="1" index="1" label="Temperature" units="F" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="65.4" />
<Value type="decimal" genre="user" instance="1" index="1" label="Temperature" units="F" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="71.9" />
<Value type="decimal" genre="user" instance="1" index="3" label="Luminance" units="lux" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="6" />
<Value type="decimal" genre="user" instance="1" index="4" label="Power" units="W" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="46" />
<Value type="decimal" genre="user" instance="1" index="5" label="Relative Humidity" units="%" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="38" />
<Value type="decimal" genre="user" instance="1" index="5" label="Relative Humidity" units="%" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="42" />
</CommandClass>
<CommandClass id="90" name="COMMAND_CLASS_DEVICE_RESET_LOCALLY" version="1" request_flags="4" after_mark="true" innif="true">
<Instance index="1" />
@ -168,7 +168,7 @@
</CommandClass>
<CommandClass id="128" name="COMMAND_CLASS_BATTERY" version="1" request_flags="4" innif="true">
<Instance index="1" />
<Value type="byte" genre="user" instance="1" index="0" label="Battery Level" units="%" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="34" />
<Value type="byte" genre="user" instance="1" index="0" label="Battery Level" units="%" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="0" />
</CommandClass>
<CommandClass id="130" name="COMMAND_CLASS_HAIL" version="1" request_flags="4" after_mark="true" innif="true">
<Instance index="1" />
@ -216,9 +216,9 @@
</CommandClass>
<CommandClass id="49" name="COMMAND_CLASS_SENSOR_MULTILEVEL" version="5" innif="true">
<Instance index="1" />
<Value type="decimal" genre="user" instance="1" index="1" label="Temperature" units="F" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="64.2" />
<Value type="decimal" genre="user" instance="1" index="3" label="Luminance" units="lux" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="12" />
<Value type="decimal" genre="user" instance="1" index="5" label="Relative Humidity" units="%" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="38" />
<Value type="decimal" genre="user" instance="1" index="1" label="Temperature" units="F" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="72.1" />
<Value type="decimal" genre="user" instance="1" index="3" label="Luminance" units="lux" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="75" />
<Value type="decimal" genre="user" instance="1" index="5" label="Relative Humidity" units="%" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="39" />
<Value type="decimal" genre="user" instance="1" index="27" label="Ultraviolet" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="0" />
</CommandClass>
<CommandClass id="90" name="COMMAND_CLASS_DEVICE_RESET_LOCALLY" version="1" request_flags="4" after_mark="true" innif="true">
@ -350,7 +350,7 @@
</CommandClass>
<CommandClass id="128" name="COMMAND_CLASS_BATTERY" version="1" request_flags="4" innif="true">
<Instance index="1" />
<Value type="byte" genre="user" instance="1" index="0" label="Battery Level" units="%" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="48" />
<Value type="byte" genre="user" instance="1" index="0" label="Battery Level" units="%" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="41" />
</CommandClass>
<CommandClass id="130" name="COMMAND_CLASS_HAIL" version="1" request_flags="4" after_mark="true" innif="true">
<Instance index="1" />
@ -386,7 +386,7 @@
<CommandClasses>
<CommandClass id="32" name="COMMAND_CLASS_BASIC" version="1" request_flags="4" innif="true" setasreport="true">
<Instance index="1" />
<Value type="byte" genre="basic" instance="1" index="0" label="Basic" units="" read_only="false" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="0" />
<Value type="byte" genre="basic" instance="1" index="0" label="Basic" units="" read_only="false" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="255" />
</CommandClass>
<CommandClass id="48" name="COMMAND_CLASS_SENSOR_BINARY" version="1" request_flags="4" innif="true">
<Instance index="1" />
@ -574,7 +574,7 @@
</CommandClass>
<CommandClass id="128" name="COMMAND_CLASS_BATTERY" version="1" request_flags="4" innif="true">
<Instance index="1" />
<Value type="byte" genre="user" instance="1" index="0" label="Battery Level" units="%" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="99" />
<Value type="byte" genre="user" instance="1" index="0" label="Battery Level" units="%" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="100" />
</CommandClass>
<CommandClass id="132" name="COMMAND_CLASS_WAKE_UP" version="2" request_flags="2" innif="true">
<Instance index="1" />
@ -720,7 +720,7 @@
</CommandClass>
<CommandClass id="48" name="COMMAND_CLASS_SENSOR_BINARY" version="1" request_flags="4" innif="true">
<Instance index="1" />
<Value type="bool" genre="user" instance="1" index="0" label="Sensor" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="True" />
<Value type="bool" genre="user" instance="1" index="0" label="Sensor" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="False" />
<SensorMap index="0" type="38" />
<SensorMap index="0" type="54" />
<SensorMap index="0" type="201" />
@ -728,9 +728,9 @@
</CommandClass>
<CommandClass id="49" name="COMMAND_CLASS_SENSOR_MULTILEVEL" version="5" innif="true">
<Instance index="1" />
<Value type="decimal" genre="user" instance="1" index="1" label="Temperature" units="F" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="60.4" />
<Value type="decimal" genre="user" instance="1" index="3" label="Luminance" units="lux" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="7" />
<Value type="decimal" genre="user" instance="1" index="5" label="Relative Humidity" units="%" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="54" />
<Value type="decimal" genre="user" instance="1" index="1" label="Temperature" units="F" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="75.0" />
<Value type="decimal" genre="user" instance="1" index="3" label="Luminance" units="lux" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="2" />
<Value type="decimal" genre="user" instance="1" index="5" label="Relative Humidity" units="%" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="46" />
<Value type="decimal" genre="user" instance="1" index="27" label="Ultraviolet" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="0" />
</CommandClass>
<CommandClass id="90" name="COMMAND_CLASS_DEVICE_RESET_LOCALLY" version="1" request_flags="4" innif="true">
@ -902,7 +902,7 @@
<Value type="byte" genre="user" instance="1" index="0" label="Alarm Type" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="0" />
<Value type="byte" genre="user" instance="1" index="1" label="Alarm Level" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="0" />
<Value type="byte" genre="user" instance="1" index="2" label="SourceNodeId" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="0" />
<Value type="byte" genre="user" instance="1" index="10" label="Burglar" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="8" />
<Value type="byte" genre="user" instance="1" index="10" label="Burglar" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="0" />
</CommandClass>
<CommandClass id="114" name="COMMAND_CLASS_MANUFACTURER_SPECIFIC" version="1" request_flags="4" innif="true">
<Instance index="1" />
@ -1006,11 +1006,11 @@
</CommandClass>
<CommandClass id="50" name="COMMAND_CLASS_METER" version="3" request_flags="2" innif="true">
<Instance index="1" />
<Value type="decimal" genre="user" instance="1" index="0" label="Energy" units="kWh" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="60.518" />
<Value type="decimal" genre="user" instance="1" index="1" label="Previous Reading" units="kWh" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="60.468" />
<Value type="decimal" genre="user" instance="1" index="0" label="Energy" units="kWh" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="60.790" />
<Value type="decimal" genre="user" instance="1" index="1" label="Previous Reading" units="kWh" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="60.743" />
<Value type="int" genre="user" instance="1" index="2" label="Interval" units="seconds" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="-2147483648" max="2147483647" value="65535" />
<Value type="decimal" genre="user" instance="1" index="8" label="Power" units="W" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="0.000" />
<Value type="decimal" genre="user" instance="1" index="16" label="Voltage" units="V" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="121.339" />
<Value type="decimal" genre="user" instance="1" index="16" label="Voltage" units="V" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="122.264" />
<Value type="decimal" genre="user" instance="1" index="20" label="Current" units="A" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="0.000" />
<Value type="bool" genre="user" instance="1" index="32" label="Exporting" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="False" />
<Value type="button" genre="system" instance="1" index="33" label="Reset" units="" read_only="false" write_only="true" verify_changes="false" poll_intensity="0" min="0" max="0" />
@ -1181,7 +1181,7 @@
</CommandClass>
<CommandClass id="129" name="COMMAND_CLASS_CLOCK" version="1" request_flags="4" innif="true">
<Instance index="1" />
<Value type="list" genre="user" instance="1" index="0" label="Day" units="" read_only="false" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" vindex="5" size="1">
<Value type="list" genre="user" instance="1" index="0" label="Day" units="" read_only="false" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" vindex="6" size="1">
<Item label="Monday" value="1" />
<Item label="Tuesday" value="2" />
<Item label="Wednesday" value="3" />
@ -1191,7 +1191,7 @@
<Item label="Sunday" value="7" />
</Value>
<Value type="byte" genre="user" instance="1" index="1" label="Hour" units="" read_only="false" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="6" />
<Value type="byte" genre="user" instance="1" index="2" label="Minute" units="" read_only="false" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="16" />
<Value type="byte" genre="user" instance="1" index="2" label="Minute" units="" read_only="false" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="46" />
</CommandClass>
<CommandClass id="130" name="COMMAND_CLASS_HAIL" version="1" request_flags="4" after_mark="true" innif="true">
<Instance index="1" />
@ -1339,7 +1339,7 @@
</CommandClass>
<CommandClass id="48" name="COMMAND_CLASS_SENSOR_BINARY" version="1" request_flags="4" innif="true">
<Instance index="1" />
<Value type="bool" genre="user" instance="1" index="0" label="Sensor" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="False" />
<Value type="bool" genre="user" instance="1" index="0" label="Sensor" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="True" />
<SensorMap index="0" type="255" />
</CommandClass>
<CommandClass id="90" name="COMMAND_CLASS_DEVICE_RESET_LOCALLY" version="1">
@ -1369,7 +1369,7 @@
<Value type="byte" genre="user" instance="1" index="0" label="Alarm Type" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="0" />
<Value type="byte" genre="user" instance="1" index="1" label="Alarm Level" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="0" />
<Value type="byte" genre="user" instance="1" index="2" label="SourceNodeId" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="0" />
<Value type="byte" genre="user" instance="1" index="10" label="Burglar" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="0" />
<Value type="byte" genre="user" instance="1" index="10" label="Burglar" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="8" />
<Value type="byte" genre="user" instance="1" index="11" label="Power Management" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="0" />
</CommandClass>
<CommandClass id="114" name="COMMAND_CLASS_MANUFACTURER_SPECIFIC" version="1" request_flags="4" innif="true">
@ -2038,7 +2038,7 @@
</CommandClass>
<CommandClass id="49" name="COMMAND_CLASS_SENSOR_MULTILEVEL" version="7" innif="true">
<Instance index="1" />
<Value type="decimal" genre="user" instance="1" index="1" label="Temperature" units="F" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="66.74" />
<Value type="decimal" genre="user" instance="1" index="1" label="Temperature" units="F" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="78.26" />
</CommandClass>
<CommandClass id="90" name="COMMAND_CLASS_DEVICE_RESET_LOCALLY" version="1" request_flags="4" innif="true">
<Instance index="1" />
@ -2262,9 +2262,9 @@
</CommandClass>
<CommandClass id="49" name="COMMAND_CLASS_SENSOR_MULTILEVEL" version="5" innif="true">
<Instance index="1" />
<Value type="decimal" genre="user" instance="1" index="1" label="Temperature" units="F" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="71.2" />
<Value type="decimal" genre="user" instance="1" index="1" label="Temperature" units="F" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="76.7" />
<Value type="decimal" genre="user" instance="1" index="3" label="Luminance" units="lux" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="0" />
<Value type="decimal" genre="user" instance="1" index="5" label="Relative Humidity" units="%" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="39" />
<Value type="decimal" genre="user" instance="1" index="5" label="Relative Humidity" units="%" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="41" />
<Value type="decimal" genre="user" instance="1" index="27" label="Ultraviolet" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="0" />
<Value type="decimal" genre="user" instance="1" index="37" label="Radon Concentration" units="bq/m3" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="60" />
</CommandClass>
@ -2525,7 +2525,7 @@
</CommandClass>
</CommandClasses>
</Node>
<Node id="39" name="" location="" basic="4" generic="49" specific="1" type="Simple Meter" listening="true" frequentListening="false" beaming="true" routing="true" max_baud_rate="40000" version="4" query_stage="CacheLoad">
<Node id="39" name="" location="" basic="4" generic="49" specific="1" type="Simple Meter" listening="true" frequentListening="false" beaming="true" routing="true" max_baud_rate="40000" version="4" query_stage="Configuration">
<Manufacturer id="0" name="">
<Product type="0" id="0" name="" />
</Manufacturer>