lovelylain / hass_ingress

Home Assistant ingress feature, add additional ingress panels to your Home Assistant frontend.
Apache License 2.0
31 stars 6 forks source link

Getting Blue Iris NVR working #4

Closed mutasim closed 3 months ago

mutasim commented 3 months ago

(Great library btw - this has really been a missing piece of the puzzle for me)

Opening this issue to working through setting up Blue Iris NVR. I haven't got it fully working yet but here's my progress so far..

Config:

blue_iris:
  title: Blue Iris
  icon: mdi:camera
  url: http://<ip address of blue iris pc>:<blue iris port>
  expire_time: 60 # currently experimenting with this to tackle some issues with streams not loading after coming back to the app
  ui_mode: toolbar
  index: /ui3.htm

The UI loads, the cameras load intermittently and I'm getting the following error:

JSON API unreachable at "/json?_login". This is may be the result of using a reverse-proxy server incorrectly.

Perhaps I need to look at this sub_filter stuff?

lovelylain commented 3 months ago

A URL contains several parts: domain name, port, and path. The domain name and port of HA are shared when the ingress proxy is used, so different services must be identified through paths. Hass ingress will assign a path prefix to each service. If the service only uses relative paths There will be no problem, if it uses the absolute path it will access the HA resources incorrectly. For unsupported backend services, you can try to use nginx's sub_filter to fix the absolute paths in the response. Visit https://github.com/lovelylain/hass_ingress/issues/1#issuecomment-1983617932 for more details.

mutasim commented 3 months ago

@lovelylain thanks for your help.

Thankfully Blue Iris has a setting called 'virtual directory' designed for proxy services. It sets the absolute paths accordingly to this virtual directory and expects that it will be stripped off by the proxy.

Screenshot 2024-03-13 at 06 48 26

I can confirm with the above config and the correct 'virtual directory' path, Blue Iris is working as expected!!

mutasim commented 3 months ago

Update for anyone else trying to setup Blue Iris. I'm getting intermittent errors loading the live streams when I come back to the tab after a certain amount of time. It doesn't clear if I navigate away from the tab, only if I kill the Home Assistant iOS app and reload.

I tried to implement an expire_time of 60 (I assume that's seconds), but I think I'm still seeing the issue. I'll continue to observe over the next week and confirm if it's still happening and if I can confirm when it happens.

ChirpyTurnip commented 1 month ago

So I now have this running and have the following problem:

Using the javascript H264 player the latency problems have vanished and it was only ~1 second behind. But after a while (for example if I leave the tab to go to another) when I come back to the HA tab which still shows the BlueIris frame it now says:

The video stream was lost. Attempting to reconnect. Protocol error the stream did not start with "blue". The videostream was lost. Due to rapid failures, automatic reconnection will resume at [time].

And yet it worked perfectly when first connection was made?

If I change the codec back to webcodecs or html5 then the error persists. Similarly reloading the browser tab or dropping off and coming back to the HA side bar item also fails...once the connection is lost it is all over.....

Now curiously I can select another group of cameras and they will connect....but returning the first group it fails again....which makes this problem even weirder as it is all the same configuration and the same BI instance....and the fact that some views include all the cameras from the view that now refuses to load also shows it's not the cameras themselves....

It's just.....weird. Broken but working. Working but broken.

Any ideas?

TinyShark commented 1 month ago

I get this too and think it's a Blue Iris problem? I have emailed support but heard nothing back. Perhaps email them too and nudge them into looking at it

ChirpyTurnip commented 1 month ago

I know have the case where on this particular client I only get "Authorization required" and the page completely refuses to load. Clearing cache, restarting browser etc....nothing works. And yet the page works fine from other PCs.....just the one that had the problems is refusing to play now.....

mutasim commented 1 month ago

I’m getting this more often in the last week or so…. Not sure why.. anyone else still plagued by this?

ChirpyTurnip commented 1 month ago

I made some other changes and it hasn't come back. See here...