Add motion_hass
This commit is contained in:
parent
257619e5cd
commit
dced66e626
5 changed files with 30 additions and 0 deletions
8
files/motion_hass.service
Normal file
8
files/motion_hass.service
Normal file
|
@ -0,0 +1,8 @@
|
|||
[Service]
|
||||
Type=simple
|
||||
#RemainAfterExit=yes
|
||||
User=motion
|
||||
ExecStart=/usr/local/bin/motion_hass.py --config /etc/motion_hass.conf
|
||||
|
||||
[Unit]
|
||||
OnFailure=status_email_antoniodelgado@%n.service
|
7
files/motion_hass.timer
Normal file
7
files/motion_hass.timer
Normal file
|
@ -0,0 +1,7 @@
|
|||
[Timer]
|
||||
OnBootSec=10sec
|
||||
OnUnitActiveSec=10sec
|
||||
Unit=motion_hass.service
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -137,3 +137,9 @@
|
|||
daemon_reload: true
|
||||
name: transfer_recordings.timer
|
||||
enabled: true
|
||||
|
||||
- name: Ensure motion_hass is configured
|
||||
template:
|
||||
src: templates/motion_hass.conf.j2
|
||||
dest: /etc/motion_hass.conf
|
||||
backup: yes
|
||||
|
|
|
@ -20,3 +20,7 @@
|
|||
owner: motion
|
||||
group: motion
|
||||
mode: 0750
|
||||
|
||||
- name: Ensure motion_hass is installed
|
||||
ansible.builtin.pip:
|
||||
name: git+ssh://git@repos.susurrando.com:1122/srv/git.repos/motion_hass.git
|
||||
|
|
5
templates/motion_hass.conf.j2
Normal file
5
templates/motion_hass.conf.j2
Normal file
|
@ -0,0 +1,5 @@
|
|||
hass_token='{{ vault_haos_api_calls_token }}'
|
||||
hass_uri='http://192.168.1.248:8123'
|
||||
motion_config='/etc/motion/motion.conf'
|
||||
# debug_level='DEBUG'
|
||||
on_movie_end="/usr/local/bin/process_motion_event.sh --move-to /srv/expendable_data/motion 192.168.1.251:/srv/expendable_data/ --move-to-port 1122 --remove-picture --email-destination '{{ recipient }}' --home-assistant-url http://192.168.1.248:8123 --home-assistant-token '{{ vault_haos_api_calls_token }}' --signal-destination '+358401871182' -e 'on_movie_end' -t '%t' -w '%w' -J '%J' -i '%i' -C '%C' -o '%o' -c '%$' -v '%v' -D '%D' -h '%h' -K '%K' -L '%L' -f '%f' -Q '%Q' -F '%fps' -q '%q' -N '%N' -n '%n' -h '%host'"
|
Loading…
Reference in a new issue