Bom Dia,
Tenho um script a correr para que sempre que alguém abre a porta receber por mail uma notificação com 6 fotos.
Tudo corria muito bem até ter alterado para começar a enviar a notificação para o Telegram.
O script
burglar:
alias: Alarm
sequence:
- service: camera.snapshot
data:
filename: /tmp/snapshot_1.jpeg
- delay:
seconds: 2
- service: camera.snapshot
data:
filename: /tmp/snapshot_2.jpeg
- delay:
seconds: 2
- service: camera.snapshot
data:
filename: /tmp/snapshot_3.jpeg
- delay:
seconds: 2
- service: camera.snapshot
data:
filename: /tmp/snapshot_4.jpeg
- delay:
seconds: 2
- service: camera.snapshot
data:
filename: /tmp/snapshot_5.jpeg
- delay:
seconds: 2
- service: camera.snapshot
data:
filename: /tmp/snapshot_6.jpeg
- service: shell_command.camera_convert --> Onde acontece o Erro
- service: notify.telegram
data:
title: 'Porta Aberta'
message: 'A Porta está Aberta'
data:
photo:
- file: /tmp/snapshot_1.jpeg
- file: /tmp/snapshot_2.jpeg
- file: /tmp/snapshot_3.jpeg
- file: /tmp/snapshot_4.jpeg
- file: /tmp/snapshot_5.jpeg
- file: /tmp/snapshot_6.jpeg
shell_command.camera_convert
#!/bin/bash
convert /tmp/snapshot_1.jpeg /tmp/snapshot_1.jpeg
convert /tmp/snapshot_2.jpeg /tmp/snapshot_2.jpeg
convert /tmp/snapshot_3.jpeg /tmp/snapshot_3.jpeg
convert /tmp/snapshot_4.jpeg /tmp/snapshot_4.jpeg
convert /tmp/snapshot_5.jpeg /tmp/snapshot_5.jpeg
convert /tmp/snapshot_6.jpeg /tmp/snapshot_6.jpeg
Erro
convert-im6.q16: Not a JPEG file: starts with 0xef 0xbb `/tmp/snapshot_1.jpeg' @ error/jpeg.c/JPEGErrorHandler/322.
convert-im6.q16: no images defined `/tmp/snapshot_1.jpeg' @ error/convert.c/ConvertImageCommand/3258.
convert-im6.q16: Not a JPEG file: starts with 0xef 0xbb `/tmp/snapshot_2.jpeg' @ error/jpeg.c/JPEGErrorHandler/322.
convert-im6.q16: no images defined `/tmp/snapshot_2.jpeg' @ error/convert.c/ConvertImageCommand/3258.
convert-im6.q16: Not a JPEG file: starts with 0xef 0xbb `/tmp/snapshot_3.jpeg' @ error/jpeg.c/JPEGErrorHandler/322.
convert-im6.q16: no images defined `/tmp/snapshot_3.jpeg' @ error/convert.c/ConvertImageCommand/3258.
convert-im6.q16: Not a JPEG file: starts with 0xef 0xbb `/tmp/snapshot_4.jpeg' @ error/jpeg.c/JPEGErrorHandler/322.
convert-im6.q16: no images defined `/tmp/snapshot_4.jpeg' @ error/convert.c/ConvertImageCommand/3258.
convert-im6.q16: Not a JPEG file: starts with 0xef 0xbb `/tmp/snapshot_5.jpeg' @ error/jpeg.c/JPEGErrorHandler/322.
convert-im6.q16: no images defined `/tmp/snapshot_5.jpeg' @ error/convert.c/ConvertImageCommand/3258.
convert-im6.q16: Not a JPEG file: starts with 0xef 0xbb `/tmp/snapshot_6.jpeg' @ error/jpeg.c/JPEGErrorHandler/322.
convert-im6.q16: no images defined `/tmp/snapshot_6.jpeg' @ error/convert.c/ConvertImageCommand/3258.