Una vez instalado y configurado Frigate el siguiente paso lógico es integrarlo en nuestro Home Assistant.
Lo primero será crea una serie de cámaras MQTT
x
27
27
1
mqtt
2
3
camera
4
5
name mqtt_foscam_1
6
unique_id mqtt_foscam_1
7
topic frigate/foscam_1/person/snapshot
8
9
name mqtt_foscam_2
10
unique_id mqtt_foscam_2
11
topic frigate/foscam_2/person/snapshot
12
13
name mqtt_foscam_3
14
unique_id mqtt_foscam_3
15
topic frigate/foscam_3/person/snapshot
16
17
name mqtt_hikvision_1
18
unique_id mqtt_hikvision_1
19
topic frigate/HIKVISION_1/person/snapshot
20
21
name mqtt_hikvision_2
22
unique_id mqtt_hikvision_2
23
topic frigate/HIKVISION_2/person/snapshot
24
25
name mqtt_ic_3116w
26
unique_id mqtt_ic_3116w
27
topic frigate/IC-3116W/person/snapshot
Lo siguiente crear los sensores de deteccions de movimiento.
xxxxxxxxxx
1
82
82
1
####################################################################
2
# Sensores camaras frigate
3
####################################################################
4
5
name"Frigate NVR"
6
icon hass cctv
7
state_topic"frigate/available"
8
payload_on"online"
9
payload_off"offline"
10
device_class connectivity
11
12
name movimiento_foscam_1
13
device_class motion
14
off_delay10
15
state_topic"frigate/events"
16
value_template
17
{% if (value_json['after']['camera'] == 'foscam_1') and (value_json['after']['label'] == 'person') and (value_json['after']['stationary'] == false)
18
and (value_json['after']['has_snapshot'] == true ) %}
19
ON
20
{% else %}
21
OFF
22
{% endif %}
23
24
name movimiento_foscam_2
25
device_class motion
26
off_delay10
27
state_topic"frigate/events"
28
value_template
29
{% if (value_json['after']['camera'] == 'foscam_2') and (value_json['after']['label'] == 'person') and (value_json['after']['stationary'] == false)
30
and (value_json['after']['has_snapshot'] == true ) %}
31
ON
32
{% else %}
33
OFF
34
{% endif %}
35
36
name movimiento_foscam_3
37
device_class motion
38
off_delay10
39
state_topic"frigate/events"
40
value_template
41
{% if (value_json['after']['camera'] == 'foscam_3') and (value_json['after']['label'] == 'person') and (value_json['after']['stationary'] == false)
42
and (value_json['after']['has_snapshot'] == true ) %}
43
ON
44
{% else %}
45
OFF
46
{% endif %}
47
48
name movimiento_hikvision_1
49
device_class motion
50
off_delay10
51
state_topic"frigate/events"
52
value_template
53
{% if (value_json['after']['camera'] == 'HIKVISION_1') and (value_json['after']['label'] == 'person') and (value_json['after']['stationary'] == false)
54
and (value_json['after']['has_snapshot'] == true ) %}
55
ON
56
{% else %}
57
OFF
58
{% endif %}
59
60
name movimiento_hikvision_2
61
device_class motion
62
off_delay10
63
state_topic"frigate/events"
64
value_template
65
{% if (value_json['after']['camera'] == 'HIKVISION_2') and (value_json['after']['label'] == 'person') and (value_json['after']['stationary'] == false)
66
and (value_json['after']['has_snapshot'] == true ) %}
67
ON
68
{% else %}
69
OFF
70
{% endif %}
71
72
name movimiento_ic_3116w
73
device_class motion
74
off_delay10
75
state_topic"frigate/events"
76
value_template
77
{% if (value_json['after']['camera'] == 'IC-3116W') and (value_json['after']['label'] == 'person') and (value_json['after']['stationary'] == false)
78
and (value_json['after']['has_snapshot'] == true ) %}
79
ON
80
{% else %}
81
OFF
82
{% endif %}
Una vez creados y funcionando ya podemos empezar con las automatizaciones , en este caso por ejemplo automatizaciones que guardan en jpg el snapshot que nos ha llegado por mqtt en función de cada cámara y lo envia por Telegram dando aviso por texto y añadiendo la imagen
xxxxxxxxxx
1
153
153
1
id'nuevo snapshot recibido camara 1'
2
alias'nuevo snapshot recibido camara 1'
3
variables
4
filepath /config/www/cam_captures/1_ now().year _ now().month _ now().day _ now().hour _ now().minute _ now().second .jpg
5
trigger
6
platform state
7
entity_id binary_sensor.movimiento_foscam_1
8
from'off'
9
to'on'
10
action
11
service camera.snapshot
12
data
13
entity_id camera.mqtt_foscam_1
14
filename'{{ filepath }}'
15
delay 00 0005
16
service notify.notif_telegram_ha_camaras
17
data
18
title Enviar imagenes
19
message Cam. 1 now().strftime("%d/%m %H:%M:%S")
20
data
21
photo
22
file'{{ filepath }}'
23
capture Snapshoot
24
caption Cam. 1 now().strftime("%d/%m %H:%M:%S")
25
26
id'nuevo snapshot recibido camara 2'
27
alias'nuevo snapshot recibido camara 2'
28
variables
29
filepath /config/www/cam_captures/2_ now().year _ now().month _ now().day _ now().hour _ now().minute _ now().second .jpg
30
trigger
31
platform state
32
entity_id binary_sensor.movimiento_foscam_2
33
from'off'
34
to'on'
35
action
36
service camera.snapshot
37
data
38
entity_id camera.mqtt_foscam_2
39
filename'{{ filepath }}'
40
delay 00 0005
41
service notify.notif_telegram_ha_camaras
42
data
43
title Enviar imagenes
44
message Cam. 2 now().strftime("%d/%m %H:%M:%S")
45
data
46
photo
47
file'{{ filepath }}'
48
capture Snapshoot
49
caption Cam. 2 now().strftime("%d/%m %H:%M:%S")
50
51
52
id'nuevo snapshot recibido camara 3'
53
alias'nuevo snapshot recibido camara 3'
54
variables
55
filepath /config/www/cam_captures/3_ now().year _ now().month _ now().day _ now().hour _ now().minute _ now().second .jpg
56
trigger
57
platform state
58
entity_id binary_sensor.movimiento_foscam_3
59
from'off'
60
to'on'
61
action
62
service camera.snapshot
63
data
64
entity_id camera.mqtt_foscam_3
65
filename'{{ filepath }}'
66
delay 00 0005
67
service notify.notif_telegram_ha_camaras
68
data
69
title Enviar imagenes
70
message Cam. 3 now().strftime("%d/%m %H:%M:%S")
71
data
72
photo
73
file'{{ filepath }}'
74
capture Snapshoot
75
caption Cam. 3 now().strftime("%d/%m %H:%M:%S")
76
77
78
id'nuevo snapshot recibido camara 4'
79
alias'nuevo snapshot recibido camara 4'
80
variables
81
filepath /config/www/cam_captures/4_ now().year _ now().month _ now().day _ now().hour _ now().minute _ now().second .jpg
82
trigger
83
platform state
84
entity_id binary_sensor.movimiento_hikvision_1
85
from'off'
86
to'on'
87
action
88
service camera.snapshot
89
data
90
entity_id camera.mqtt_hikvision_1
91
filename'{{ filepath }}'
92
delay 00 0005
93
service notify.notif_telegram_ha_camaras
94
data
95
title Enviar imagenes
96
message Cam. 4 now().strftime("%d/%m %H:%M:%S")
97
data
98
photo
99
file'{{ filepath }}'
100
capture Snapshoot
101
caption Cam. 4 now().strftime("%d/%m %H:%M:%S")
102
103
104
id'nuevo snapshot recibido camara 5'
105
alias'nuevo snapshot recibido camara 5'
106
variables
107
filepath /config/www/cam_captures/5_ now().year _ now().month _ now().day _ now().hour _ now().minute _ now().second .jpg
108
trigger
109
platform state
110
entity_id binary_sensor.movimiento_hikvision_2
111
from'off'
112
to'on'
113
action
114
service camera.snapshot
115
data
116
entity_id camera.mqtt_hikvision_2
117
filename'{{ filepath }}'
118
delay 00 0005
119
service notify.notif_telegram_ha_camaras
120
data
121
title Enviar imagenes
122
message Cam. 5 now().strftime("%d/%m %H:%M:%S")
123
data
124
photo
125
file'{{ filepath }}'
126
capture Snapshoot
127
caption Cam. 5 now().strftime("%d/%m %H:%M:%S")
128
129
130
id'nuevo snapshot recibido camara 6'
131
alias'nuevo snapshot recibido camara 6'
132
variables
133
filepath /config/www/cam_captures/6_ now().year _ now().month _ now().day _ now().hour _ now().minute _ now().second .jpg
134
trigger
135
platform state
136
entity_id binary_sensor.movimiento_ic_3116w
137
from'off'
138
to'on'
139
action
140
service camera.snapshot
141
data
142
entity_id camera.mqtt_ic_3116w
143
filename'{{ filepath }}'
144
delay 00 0005
145
service notify.notif_telegram_ha_camaras
146
data
147
title Enviar imagenes
148
message Cam. 6 now().strftime("%d/%m %H:%M:%S")
149
data
150
photo
151
file'{{ filepath }}'
152
capture Snapshoot
153
caption Cam. 6 now().strftime("%d/%m %H:%M:%S")
También lo añadimos a nuestro panel lovelace
xxxxxxxxxx
1
43
43
1
type vertical-stack
2
cards
3
type entities
4
title Camaras
5
show_nametrue
6
show_statefalse
7
show_header_togglefalse
8
columns 3
9
entities
10
entity binary_sensor.frigate_nvr
11
name Frigate NVR
12
entity camera.mqtt_foscam_1
13
name Camara 1
14
entity camera.mqtt_foscam_2
15
name Camara 2
16
entity camera.mqtt_foscam_3
17
name Camara 3
18
entity camera.mqtt_hikvision_1
19
name Camara 4
20
entity camera.mqtt_hikvision_2
21
name Camara 5
22
entity camera.mqtt_ic_3116w
23
name Camara 6
24
25
type entities
26
title Sensores movimiento Camaras
27
show_nametrue
28
show_statefalse
29
show_header_togglefalse
30
columns 3
31
entities
32
entity binary_sensor.movimiento_foscam_1
33
name Camara 1
34
entity binary_sensor.movimiento_foscam_2
35
name Camara 2
36
entity binary_sensor.movimiento_foscam_3
37
name Camara 3
38
entity binary_sensor.movimiento_hikvision_1
39
name Camara 4
40
entity binary_sensor.movimiento_hikvision_2
41
name Camara 5
42
entity binary_sensor.movimiento_ic_3116w
43
name Camara 6
Y este seria el resultado al activarse la detección de movimiento

Y con esto y un bizcocho ……..