Hello there!
if you have the time, I would like you to comment on the result you got, if your scenario is different than mine: I am trying to get this binding to work with OpenHAB 4.2.1 and Frigate 0.14.1; I’m open to suggestions on ways to debug this behaviour, if is not the intended one. Otherwise, I’d be glad to know what I am missing.
I compiled the repository at the main branch and commit 14007fd
, checking it out inside the openhab-addons repo at version 4.2.1.
Following the build instructions I obtained a JAR for OpenHAB 4.2.1 and after copying it inside the addon folder of a running OpenHAB 4.2.1 instance, it was detected and loaded without errors.
However, I am not able to add cameras after creating the Frigate server Thing in OpenHAB:
I am running Frigate 0.14.1
After creating correctly the frigate server Thing and going back to Things > + > MQTT Binding > Search
the Camera I am using from the Frigate configuration is discovered automatically, then I click on it and choose a name and in the end it never gets past the offline status “CONFIGURATION_PENDING waiting for status”. The OpenHAB logs do not report any error or warning, nor the Frigate logs do.
Using the TRACE log level when adding the camera device does not reveal any information either; the following is what appear on the log at DEBUG level when adding the camera device I would like to use:
16:53:22.986 [INFO ] [ig.discovery.internal.PersistentInbox] - Added new thing 'mqtt:frigateCamera:460b8fd214:libreria_sala-127-0-0-15000' to inbox.
16:53:22.987 [INFO ] [openhab.event.InboxAddedEvent ] - Discovery Result with UID 'mqtt:frigateCamera:460b8fd214:libreria_sala-127-0-0-15000' has been added.
...
16:54:29.405 [DEBUG] [rnal.handlers.frigateSVRServerHandler] - keep-alive: device is online
16:54:30.287 [INFO ] [openhab.event.InboxRemovedEvent ] - Discovery Result with UID 'mqtt:frigateCamera:460b8fd214:libreria_sala-127-0-0-15000' has been r
emoved.
16:54:30.294 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:frigateCamera:460b8fd214:libreria_sala-127-0-0-15000' changed from UNINITIALIZED to
INITIALIZING
16:54:30.297 [INFO ] [rnal.handlers.frigateSVRCameraHandler] - camera libreria_sala INITIALIZATION handler called
16:54:30.297 [INFO ] [rnal.handlers.frigateSVRCameraHandler] - camera: SetOffline called, stopping streamer
16:54:30.297 [INFO ] [rnal.handlers.frigateSVRCameraHandler] - camera libreria_sala: unsubscribing from MQTT
16:54:30.298 [INFO ] [rnal.handlers.frigateSVRCameraHandler] - unsubscribe: connection is null
16:54:30.298 [DEBUG] [rnal.handlers.frigateSVRCameraHandler] - offlining device
16:54:30.298 [INFO ] [vr.internal.servlet.frigateSVRServlet] - StopServer called: stopping streaming server
16:54:30.298 [INFO ] [rnal.handlers.frigateSVRCameraHandler] - camera libreria_sala: bridge going online
16:54:30.299 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:frigateCamera:460b8fd214:libreria_sala-127-0-0-15000' changed from INITIALIZING to O
FFLINE (BRIDGE_OFFLINE)
16:54:30.299 [INFO ] [rnal.handlers.frigateSVRCameraHandler] - cam going online: requesting status: frigateSVR/mqtt:frigateServer:460b8fd214:frigate_auriga/lib
reria_sala/camOnLine
16:54:30.299 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:frigateCamera:460b8fd214:libreria_sala-127-0-0-15000' changed from OFFLINE (BRIDGE_O
FFLINE) to OFFLINE (CONFIGURATION_PENDING)
16:54:30.300 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:frigateCamera:460b8fd214:libreria_sala-127-0-0-15000' changed from OFFLINE (CONFIGUR
ATION_PENDING) to OFFLINE (CONFIGURATION_PENDING): waiting for status
16:54:34.417 [DEBUG] [rnal.handlers.frigateSVRServerHandler] - keep-alive: device is online
For reference, this is the YAML of the frigate server Thing:
UID: mqtt:frigateServer:460b8fd214:frigate_auriga
label: frigateSVR Auriga
thingTypeUID: mqtt:frigateServer
configuration:
ffDASHPackageCommands: -seg_duration 1 -streaming 1
serverClientID: ""
ffDASHTranscodeCommands: -acodec copy -vcodec copy
enableAPIForwarder: true
ffMJPEGTranscodeCommands: -q:v 5 -r 2 -vf scale=640:-2 -update 1
ffmpegLocation: /usr/bin/ffmpeg
ffHLSStartProducerOnLoad: false
enableStream: true
streamWhitelist: DISABLE
ffTempDir: ""
ffMJPEGStartProducerOnLoad: false
ffHLSTranscodeCommands: -acodec copy -vcodec copy
ffMinFramesToStart: 10
serverURL: http://127.0.0.1:5000
serverKeepAlive: 5
HTTPTimeout: 100
ffDASHStartProducerOnLoad: false
ffKeepalivesBeforeExit: 2
bridgeUID: mqtt:broker:460b8fd214
location: Sala
And here it is the YAML of the Camera Thing:
UID: mqtt:frigateCamera:460b8fd214:libreria_sala-127-0-0-15000
label: "Camera : libreria_sala"
thingTypeUID: mqtt:frigateCamera
configuration:
ffDASHPackageCommands: -seg_duration 1 -streaming 1
ffmpegCameraNameOverride: ""
ffDASHTranscodeCommands: -acodec copy -vcodec copy
ffMJPEGTranscodeCommands: -q:v 5 -r 2 -vf scale=640:-2 -update 1
ffHLSStartProducerOnLoad: false
enableStream: true
serverID: mqtt:frigateServer:460b8fd214:frigate_auriga
ffTempDir: ""
ffMJPEGStartProducerOnLoad: false
ffHLSTranscodeCommands: -acodec copy -vcodec copy
ffMinFramesToStart: 10
ffDASHStartProducerOnLoad: false
ffKeepalivesBeforeExit: 2
cameraName: libreria_sala
bridgeUID: mqtt:broker:460b8fd214
Finally, the configuration snippet in Frigate for that camera I am exposing to MQTT
go2rtc:
streams:
libreria_sala:
- rtsp://user:passwd@192.168.1.90:554/live2.sdp
cameras:
libreria_sala:
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/libreria_sala
input_args: preset-rtsp-restream
roles:
- detect
detect:
enabled: true
width: 1280
height: 720