Skip to content

Instantly share code, notes, and snippets.

@boxgr0ve
Created January 23, 2019 16:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boxgr0ve/b74699e680cf70f4e823c1501be1fd9d to your computer and use it in GitHub Desktop.
Save boxgr0ve/b74699e680cf70f4e823c1501be1fd9d to your computer and use it in GitHub Desktop.
### TRIGGERS MOTION RECORDING ON CAMERA IN SECURITY SPY AND SAVES A PICTURE (CAPTURED IN HOMEASSISTANT) TO SEND VIA TELEGRAM WHEN A SENSOR ON LETTERBOX IS TRIGGERED
- alias: 'letterbox'
initial_state: 'on'
trigger:
- platform: state
entity_id: binary_sensor.rf_reed_sensor_2 ### THIS IS A REED SENSOR ATTACHED TO THE LETTERBOX
from: 'off'
to: 'on'
action:
### THIS COMMAND TRIGGER THE CAMERA'S RECORDING IN SECURITY SPY ###
- service: shell_command.driveway_motion_trigger
### SENDS A SIMPLE MESSAGE TO TELEGRAM (USEFUL IF YOU DON'T WANT TO SEND PICTURES) ###
- service: notify.telegram
data:
title: "Letterbox Motion"
### THIS COMMANDS CAPTURE SCREENSHOT FROM THE SECURITY SPY FEEDS, AND SAVES THEM ONTO THE RASPBERRY PI ###
- service: camera.snapshot
data:
entity_id: camera.driveway_camera
filename: /home/homeassistant/.homeassistant/camera_snapshot/driveway.jpg
### THIS COMMANDS SEND THE CAPTURED IMAGE THROUGH TELEGRAM ###
- service: notify.telegram
data:
title: one
message: two
data:
photo:
- file: /home/homeassistant/.homeassistant/camera_snapshot/driveway.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment