The Loxone Intercom provides an MJPEG stream that can be used with Frigate, but it’s not officially documented for third-party integrations.
In this guide, I’ll show you how to access the stream and integrate it into Frigate in a clean and reliable way
The Loxone intercom provides an undocumented stream which you can find under following url:
http://<ip-adress>/mjpg/video.mjpg
Here you are prompted to login via basic auth with an admin username and password. After entering it you should have access to the stream.
You would think now that you should be able to access the stream with:
<username>:<password>@<ip-adress>/mjpg/video.mjpg
But this is not the case. Loxone does not allow you to access the intercom that way. This is what makes the whole process of integrating it into Frigate tricky.
Loxone does not provide support for any protocols other than MJPEG, including RTSP on port 554 which you will most likely use for the most cameras.
MJPEG is not that good for video processing because it requires more cpu power to process compared to a RTSP-Stream.
A basic example template for the loxone intercom is the following:
loxone-intercom:
ffmpeg:
inputs:
- path: http://<your-ip>/mjpg/video.mjpg
input_args:
- -headers
- 'Authorization: Basic <your-credentials in base64>'
roles:
- detect
detect:
width: 1280
height: 720
fps: 5
As previously stated, Loxone does not permit authentication via basic authentication in the URL. It is beneficial that the Loxone Intercom does not accept basic authentication in the URL (user:pass@ip), as it prevents credentials from being exposed in plaintext in logs, browser history. This approach promotes more secure authentication management, reducing the risk of unintentional credential exposure.
But that also means it is more annoying to work with. However, a workaround is available. It is still possible to use basic authentication if you are doing it via the authorization header.
That is why we need to specify extra input_args in the config file and there we can define a basic auth header.
This wont take your credentials as they are. You need to convert them into a base 64 string.
You can do that quite easily. Open your linux server shell and execute following:
echo "<username>:<password>" | base64
This will give you your credentials encoded in base64. You need to enter it into your configuration.
Now you can save the config and restart frigate. You should be abe to see the stream of the loxone intercom.
If there are any problems, dont mind to leave a comment and I will take a look at it.