How to view local Video Card on MyOpenHAB?

After the great help from the community and GitHub, I am slowly learning OpenHAB. My question now is how do I view Video stream on the MyOpenHAB?

I have IpCamera create HLS stream and on my Main UI, I have placed Video Card to show the stream. This is working well when access locally.

If I access remotely via myopenhab, the video stream won’t show. I believe this is due to the fact, Video Card source is local URL based on IpCamera HLS point. What is the correct way to make this video viewable remotely?

Thank you

Summary Update for those having similar issues

In summary, we have following options for v3.0.2.

  1. VPN - This depends on our own network, but in my case even HLS video stream works really well to the point it is nearly instant loading. It just requires me to turn on VPN connection each time.
  2. SiteMap - This option does not require VPN setup, but myopenhab setup is required. With this video element on Sitemap works with MJPEG, but not for HLS. Other drawback is at the time of this writing, this is inconsistent on iOS app version. I have to fresh open the app each time to see the MJPEG stream i.e. reopening will give me blank. Also performance wise, VPN HLS faster.

Show the exact configuration of your video-card.
Generally speaking an address containing the address localhost resp. e.g. 127.0.0.1 refers to - as the name says - local machine. That means that machine that runs the browser.

Thanks for the reply.

Yes. It is indeed pointed as local IP based because that’s what IP Camera outputting HLA or MJPEG URL.

The Widget configuration is very simple.

component: oh-video-card
config:
item: DoorbellCamera_HLSURL

The camera ITEM value is http://192.168.1.13:13145/ipcamera.m3u8 where IP address is OpenHABian itself’s IP.

I have added port forwarding on my router.

The result is the same if I use mjpeg.

I am thinking I’m missing some basic configuration here or perhaps another binding?

Do you know this thread: OH3 Widget: Building a camera widget ?

Yes. I have tried some of the example cards there. They work locally but still blank when accessed remotely.

My guess is from my local network to MyOpenHAB needs to have some sort of port forwarding but I am hoping there is actual Card or setup that takes care these on a background.

You should not forward ports as that increases the risk you get hacked, so for any ports you have opened or forwarded in your router I would suggest you reverse the changes unless it is required to setup what I mention next…

The main UI is still very new to openHAB and (since you have not posted which version you are using I will assume it is V3.x) there is still room for things to be improved, since this is not my area I really do not know the extent of what is and is not supported.

Really it does not matter because if you are wanting high res, high frame rate video in real time then you really should be setting up one of the following:

Reverse DNS
openVPN
wireguard

When you setup one of these your remote device will still show up like it is inside your local network and you will hence have all features of openHAB available, even able to change rules and setup hardware etc. With the second two you also get more safety for using banking when your on free wifi hotspots.

Wireguard is probably the best in my opinion to look at since it was designed with streaming video in mind and to be faster then openVPN. I believe any of the three can be setup using the openhabian config screens or you can go here.

pivpn/pivpn: The Simplest VPN installer, designed for Raspberry Pi (github.com)

@TechFocus
Edit: If you don’t care about real time video and are happy with only small clips sent when motion or humans are detected you can use Pushover, Telegram or other bindings to push them out to your phone without opening ports. This is the approach I use as I feel you need to choose a way that you are going to keep up with reviewing footage. If you setup a system that you wont use in 1 month when the novelty wears off, then there is little value in having setup the system if you never look at it.

1 Like

Excellent. Thank you for the detailed reply, especially explanation part. Before reading your post, I have started setting up VPN just in case. With my current network, VPN stream works flawlessly.

I was hoping there is built in remote access magic on myopenhab based on Securing Communication and Access | openHAB, especially some other automation platform actually does that.

However, I was not aware nor did not even think about the option of push notification forwarding. You are correct in sense that use of streaming from remote site is probably not that often. In fact, I have native app allows me to do that but I wanted to see if OpenHAB can potentially make a single do all home IoT related interface.

For now I will save as this is solved. I hope OpenHAB developer communities would consider simple “click” and stream magic.

Once again thank you.

Then your camera is poking a hole in your firewall (same way that myopenhab does to be fair) which can allow that company access to your network. This is why people block cameras by placing them on a subnet that is fully offline.

I really do not know what the status is for myopenhab and using custom widgets, hopefully someone that does can comment. You can use Video elements in a sitemap and that will pass and it would be interesting for you to try both to see if the VPN is higher performance.

Sitemaps | openHAB

EDIT:
I just tried the android app and it is a big improvement since I last tried it and sitemaps are working great now. I also tried the new main UI side of the android app and the widgets worked minus the video picture, but I seem to remember people posting that if you update to the latest BETA of the app it then works. Don’t know the status of the iOS app.

2 Likes

This was added to the test flight version literally a day after I first asked, it’s now present in the main AppStore version

Fantastic. As a new OpenHAB user, I have started with SiteMap (as that was something I came across the tutorial first). I then struggled to get video stream going with it. So I moved away/discovered Main UI is quite different than SiteMap. Since then I have not touched SiteMap, but with above comment I just did.

Interestingly, MJPEG video element works, but not HLS version despite following statement.

However, the MJPEG stream seems inconsistent on iOS. If I open App, it takes a little while to load, which is ok, but then if I comeback to the app from some other app, it is blank. So I have to kill the app instant and restart, and this seems fairly reproducible each time.

As far as performance, for my case VPN seems far better despite it is using HLS.

  • encoding should be set to “mjpeg” for an MJPEG video, or “HLS” for an HTTP Live Streaming playlist (file with .m3u8 extension). If you omit the encoding parameter, openHAB will attempt to automatically select the correct format.

But this certainly is one option I did not see. I think this provides analogous option to HomeSeer video stream.

Are you referring to the capability of Main UI within the iOS app? I do not have TestFlight version access as it looks like currently closed for new enrollment. The official App Store version still seems to support only Site Map. However, I thought this was indeed confusing from beginners perspective to see Main UI and App UI had to be entirely separately configured though I can see that could be advantage, it is probably not from the start. I do like OpenHAB Main UI. So if that works with Video streaming remotely within an App, I am so glad I asked here because that’s something I thought as a main limitation of OpenHAB.