New comprehensive Frigate binding

Wow, that’s great news!
Thank you very much for this great binding!

thanks for the good binding, so far almost everything is working great.

Is it possible to start an action via the binding, e.g. create a snapshot now?

See above: I think what you are asking for is similar to @fmeili1 's request? It’s a great suggestion - I’ll look at getting it added to the next release.

Hi @jgow , i discovered your work… a very good binding, congratulations ! :slight_smile:

Do you plan to release as official openhab addon ? If you agree to do this work i can help you for the approval phases (i refactored souliss binding and i must say the approval path of an oh binding it’s quite laborious).

If you are interested we should create a fork of openhab addons and add your binding , plus work on all code analysis errors

Let me know …
Luca

Hi @Luca_Calcaterra - thanks, and thanks for your kind offer of help.

The question of releasing as an ‘official’ addon is a difficult one. Currently, when it is finished (I am working on some additional functionality at the moment) I had planned to release it via the ‘marketplace’. Having written it, it is only right that OH and the community benefit from having a decent Frigate binding available.

However, essentially I wrote this binding for two reasons: 1) I needed it to be able to successfully integrate OH+Frigate in my environment and 2) it is fun to do. As I am doing this in what little spare time I have, anything that mitigates against these two reasons would be a good reason to discontinue work on it. Without wishing to appear overly negative, I really don’t have the time or the interest in jumping through ‘laborious’ approval hoops (I do enough of this in my day job - and it isn’t fun :unamused:).

I do intend to clean up and improve the code and any help with testing, bugfixes, suggestions or contribution of patches is most welcome.

So - while I am more than happy for the OH maintainers to include it if they so wished, I really don’t want to expend time eviscerating the code for reasons unrelated either to improving its functionality or to fixing bugs.

1 Like

Hi @fmeili1 - I have implemented the ability to trigger an event through a ThingAction but can’t test it fully in my environment as I am currently not able to run the required beta version of Frigate. If you are able, would you mind testing it? Any comments welcome. Note I did my testing against a 4.0.4 version of OH.
(Note the docs for this are in the README.md).

Hi @jgow
great news - and thanks a lot for your work on this binding!

I’ll try to test the external trigger feature tomorrow. In the meantime, I’ve updated my installation to OH 4.1.0 but I hope it will work. As soon as I have results, I’ll give feedback.

Hi,

many thanks for this binding @jgow ! I downloaded pre-built Version org.openhab.binding.mqtt.frigatesvr-4.0.3.jar working with OH 4.1.1. Then i added my “Server” Thing and auto-discovered my Cameras. But whatever i do, the camera things stay always “offline” with the comment “CONFIGURATION_PENDING”.

Any Idea what i may have done wrong? oO

Thanks in advance!

It’s worth rebuilding the binding against your running version of OH as you seem to have a version mismatch: check out the 4.1.1 openhab-addons branch, then build the frigateSVR binding against this (sorry I haven’t provided a .jar release for a while as I am working on new features at the moment). If you still get the issues, please reply and let me know. Build instructions are in the README.md.

I had some ‘strangeness’ in my development environment recently with a mismatch between binding version and OH version, so it is certainly worth ruling this out before going further.

I have released 1.8 of the binding (with a .jar only for 4.1.1 stable so far, as I haven’t yet got round to changing all the dates in the header files to stop the compilation process from its ridiculous whining about the comments in the headers ‘not matching pattern…’ when built against 4.2.0-SNAPSHOT because it hasn’t got this year’s date in it).

This has some fixes in the streaming servers, and all the streams seem to work with vlc. More importantly, I am slowly bringing in access to the Frigate API through ThingActions on the camera Things (and later on the server Things for the non-camera specific actions). If this is helpful to you, please give it a try. Also, please let me know if there are any Frigate APIs you would like to see as a matter of priority - and I will see if I can get these in first. The documentation for the ThingActions is in the doc/ folder.

OH 4.1.1
Binding 1.8
Frigate 0.13.1.

Hey, has anything changed with the new 1.8 Binding regarding the CameraThings? The ServerThing with the Birdeye View works, the CamThings are also displayed online, but I no longer receive an update of the camera items.

I didn’t have this problem with the 1.7 binding. I have already created a new CameraThing. In Frigate I have a stream for Record and a SubStream for Detect for each camera. I have also entered ffmpegCameraNameOverride in the CameraThing.

I only see that the Snapshot_Time is updated to NULL. In Frigate itself, the events are recorded normally as a clip and snapshot

In the MQTT Broker it looks like this.
image

Interesting…I’ll have a look at this. It is working here and I haven’t seen a failure where an event is not being picked up by the binding.
There have been some quite significant changes ‘under the bonnet’ between v1.7 and 1.8, mostly to the inter-Thing communications (openHAB doesn’t provide a mechanism for Thing handlers to ‘know’ about each other, and nested bridges aren’t supported, so I have had to work around this for architectures such as Frigate). I will check this.
In the meantime, if you have upgraded the binding and you haven’t done this already, could you try re-creating your Things (particularly the camera Thing) as I have added new channels in v1.8, and sometimes these are not picked up when just the binding .jar is updated.

I have now deleted all Things/Items and recreated the ServerThing and a CameraThing. Of the four items used in the CameraThing, only the Event Start Time is updated. In Frigate itself, everything works, everything is recorded, snapshots are created, etc.

OH: 4.1.1 Release Build
Binding: org.openhab.binding.mqtt.frigatesvr-4.1.1.jar
Frigate: 0.13.1-34FB1C2

ServerThing

UID: mqtt:frigateServer:mqttbroker:camera_nvr
label: Camera NVR
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: false
  streamWhitelist: DISABLE
  ffTempDir: ""
  ffMJPEGStartProducerOnLoad: false
  ffHLSTranscodeCommands: -acodec copy -vcodec copy
  ffMinFramesToStart: 10
  serverURL: http://nvr:5000/
  serverKeepAlive: 5
  ffDASHStartProducerOnLoad: false
  ffKeepalivesBeforeExit: 2
bridgeUID: mqtt:broker:mqttbroker
channels:
  - id: fgAPIVersion
    channelTypeUID: mqtt:fgAPIVersion
    label: API version
    description: Version of current Frigate API
    configuration: {}
  - id: fgUI
    channelTypeUID: mqtt:fgUI
    label: Frigate UI URL
    description: URL to Frigate user interface
    configuration: {}
  - id: fgAPIForwarderURL
    channelTypeUID: mqtt:fgAPIForwarderURL
    label: URL of API forwarder
    description: Local URL of Frigate HTTP API forwarder
    configuration: {}
  - id: fgBirdseyeURL
    channelTypeUID: mqtt:fgBirdseyeURL
    label: Birdseye stream URL
    description: URL to re-streamed birdseye view
    configuration: {}

CameraThing

UID: mqtt:frigateCamera:mqttbroker:Hof-nvr-fknetwork-de5000
label: Camera Hof
thingTypeUID: mqtt:frigateCamera
configuration:
  ffDASHPackageCommands: -seg_duration 1 -streaming 1
  ffmpegCameraNameOverride: Hof_sub
  ffDASHTranscodeCommands: -acodec copy -vcodec copy
  ffMJPEGTranscodeCommands: -q:v 5 -r 2 -vf scale=640:-2 -update 1
  ffHLSStartProducerOnLoad: false
  enableStream: false
  serverID: mqtt:frigateServer:mqttbroker:camera_nvr
  ffTempDir: ""
  ffMJPEGStartProducerOnLoad: false
  ffHLSTranscodeCommands: -acodec copy -vcodec copy
  ffMinFramesToStart: 10
  ffDASHStartProducerOnLoad: false
  ffKeepalivesBeforeExit: 2
  cameraName: Hof
bridgeUID: mqtt:broker:mqttbroker
channels:
.....
	Line 36020: 2024-02-16 09:44:54.738 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'Camera_Hof_Current_Start_time' updated to NULL
	Line 36186: 2024-02-16 09:44:58.554 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'Camera_Hof_Current_Snapshot_Time' updated to NULL
	Line 42519: 2024-02-16 09:47:37.452 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'Camera_Hof_Current_Snapshot_Time' updated to NULL
	Line 42520: 2024-02-16 09:47:37.452 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'Camera_Hof_Current_Start_time' updated to 2024-02-16T09:47:35.819432973+0100
	Line 42521: 2024-02-16 09:47:37.452 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Camera_Hof_Current_Start_time' changed from NULL to 2024-02-16T09:47:35.819432973+0100
	Line 42701: 2024-02-16 09:47:42.689 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'Camera_Hof_Current_Snapshot_Time' updated to NULL
	Line 42702: 2024-02-16 09:47:42.689 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'Camera_Hof_Current_Start_time' updated to 2024-02-16T09:47:35.819432973+0100
	Line 42929: 2024-02-16 09:47:47.858 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'Camera_Hof_Current_Snapshot_Time' updated to NULL
	Line 42930: 2024-02-16 09:47:47.858 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'Camera_Hof_Current_Start_time' updated to 2024-02-16T09:47:35.819432973+0100
	Line 43107: 2024-02-16 09:47:52.879 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'Camera_Hof_Current_Snapshot_Time' updated to NULL
	Line 43108: 2024-02-16 09:47:52.879 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'Camera_Hof_Current_Start_time' updated to 2024-02-16T09:47:51.632031917+0100
	Line 43109: 2024-02-16 09:47:52.879 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Camera_Hof_Current_Start_time' changed from 2024-02-16T09:47:35.819432973+0100 to 2024-02-16T09:47:51.632031917+0100
	Line 43110: 2024-02-16 09:47:53.077 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'Camera_Hof_Current_Snapshot_Time' updated to NULL
	Line 43111: 2024-02-16 09:47:53.077 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'Camera_Hof_Current_Start_time' updated to 2024-02-16T09:47:35.819432973+0100
	Line 43112: 2024-02-16 09:47:53.079 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Camera_Hof_Current_Start_time' changed from 2024-02-16T09:47:51.632031917+0100 to 2024-02-16T09:47:35.819432973+0100
	Line 43189: 2024-02-16 09:47:54.779 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'Camera_Hof_Current_Snapshot_Time' updated to NULL
	Line 43190: 2024-02-16 09:47:54.779 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'Camera_Hof_Current_Start_time' updated to 2024-02-16T09:47:35.819432973+0100
	Line 43258: 2024-02-16 09:47:58.087 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'Camera_Hof_Current_Snapshot_Time' updated to NULL
	Line 43259: 2024-02-16 09:47:58.088 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'Camera_Hof_Current_Start_time' updated to 2024-02-16T09:47:51.632031917+0100
	Line 43260: 2024-02-16 09:47:58.088 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Camera_Hof_Current_Start_time' changed from 2024-02-16T09:47:35.819432973+0100 to 2024-02-16T09:47:51.632031917+0100
	Line 43660: 2024-02-16 09:48:06.076 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'Camera_Hof_Current_Snapshot_Time' updated to NULL
	Line 43661: 2024-02-16 09:48:06.076 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'Camera_Hof_Current_Start_time' updated to 2024-02-16T09:47:51.632031917+0100
	Line 44388: 2024-02-16 09:48:24.465 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'Camera_Hof_Current_Snapshot_Time' updated to NULL
	Line 44389: 2024-02-16 09:48:24.465 [INFO ] [openhab.event.ItemStateUpdatedEvent ] - Item 'Camera_Hof_Current_Start_time' updated to 2024-02-16T09:47:51.632031917+0100