@kymnyth You can look on my GitHub, for an example. I have just updated my raw config of my lovelace to Github. Iāll push the rest of the config to github in the next few hours when i return from work.
You can use this example to assist you with installing custom components for Lovelace. There will also be many posts on the forum for installing custom JavaScript.
I restarted everything tried to connect to the stream and look the logs again. there are no errors and it says itās starting the stream but Iām not getting any picture. Iām running this on a raspberry pi, is it possible itās just too underpowered to act as a proxy for the stream?
I am also running a similar setup to you. I am running all my infrastructure on another VLAN to Hasiso however I am using PFSense and Hassio is a container on an Intel NUC Gen7.
What is the controller for you Unifi camera?
Iāve updated my Github with all the settings I am using.
I am using the CKG2+ with Unifi Protect. The reason I was questioning the ability of the Raspberry Pi 3 to keep up was due to the fact a direct stream works but not using the hassio as a proxy for the stream to a browser.
@noodlemctwoodle My configuration is identical to yours and I did try and connect to homeassistant on the same subnet and Iām still unable to see the stream. The snapshots have worked from the beginning. I appreciate your help.
@noodlemctwoodle Here is a description of the testing I have done from a network/firewall perspective.
I have 2 subnets IOT and MAIN.
HASSIO is on IOT my cameras are on MAIN.
My original firewall rules drop all traffic from IOT to MAIN except specific ip address/port combinations that are required (example: access to my plex server from my tvs/shield).
Originally configured firewall rules:
Accept tcp/udp access from my HASSIO (10.8.7.7) to my cameras (10.10.10.X addresses) for snapshot access - this has worked from the beginning.
Accept tcp/udp access from my HASSIO to CKG2+/Unifi Protect (10.10.10.3:7447) - this didnāt allow streams
To verify it wasnāt a firewall rule issue I changed firewall to:
Accept all IOT tcp/udp to MAIN temporarily. - Streaming still did not work from MAIN subnet
through HASSIO, vlc access works from MAIN subnet
I changed firewall to limit a bit while continuing to test:
Accept IOT to CKG2Ā± no access to stream from MAIN network through HASSIO, vlc access still worked
Accept tcp/udp to Cameras for snapshot access - snapshots still work
I thought this may be a firewall issue so I decided to do testing from the IOT subnet. Streamed directly from camera to a computer and my nvidia shield which is on the IOT subnet works both with the firewall wide open IOT-> MAIN and locked down to only have access to the CKG2+ ports and camera ips.
As for streaming directly from camera IP. My understanding is I would have to put the camera in standalone mode which would prevent the use of unifi protect which I would prefer not to do.
@kymnyth For testing are you able to put the Raspberyy Pi into you MAIN subnet and see if the stream works?
My setup is mariginally diffeernt to your I have an Infrastructure subnet, Clients subnet and a IOT subnet.
All my UNIFI gear, Firewall, Switches, APs and UnRAID are in the Infrastructure subnet, my docker host, Shield TV and Windows PCs and any other trusted device is in the Clients subnet.
Then things I dont trust are in the IOT such as SONOFF and other unbranded Cinese systems.
I have a FIrewall rule that allows all traffic outbound from the Infrastructure subnet to the Clients subnet on any protocol.
IOT is blocked from access to the WAN and access to the Infrastructure subnet. It is only allowed to communicate to the Hassio container on specific TCP/UDP.
Ideally to troubleshoot the problem I would get all the components on the same subnet without any restrictions and see if it works. Once you have confirmed that setup works without issue you can then complicate the setup
You should be able to get the live stream working in HomeAssistant without affecting the Unifi Protectā¦ My protect is working flawlessly and all the cameras are manageable within both the cloud managed and locally manged instances.
Have you tried adjusting the resolution as suggested in this post
I now have the hassio rbp, my client system and the CKG2+ all on the same subnet. I switched to the lowest resolution option in unifi protect for the rtsp feed and I am still not able to get any output.
Not sure what the difference is but it doesnāt seem to be how I am configuring the camera and stream. Instead of running on a raspberry pi I tried installing Ubuntu on an atom based mini computer and HASSIO into a docker. I only added a camera to the configuration thus far. The camera is working. There are a number of other differences as well. I will have to work my way through transferring the rest of my configuration and see if I can figure out what was causing the problem. Perhaps the pi was just under-powered.
I finally got this working but I am not sure why. I rebuilt everything on another atom based mini computer and proceeded to get it working. I will mention the differences in this configuration vs my previous which are few.
The entire configuration of lovelace was done through the configuration ui vs before I used editing the ui-lovelace.yaml directly.
Running on a bit more powerful piece of hardware
Other than that, there were really no differences.
I did notice that when accessing the camera live streams I often had to expand and contract the browser window to get it to be refresh and display. Perhaps it was working before and it just wasnāt refreshing properly. I did let it sit for quite a while so I doubt that is it. Hope some help can be gleaned from this by someone else.
Has anyone tried to stream the cameraās over AirPlay?
My camera streams are working fine in the picture entity card, but if I stream it to the AppleTV, it just spins and spins trying to load on the AppleTV.
Doing the same action from my Foscam cameras works just fine.