PiPup - Android TV app for notifications

  frontdoor_noaudio:
    rtsp://127.0.0.1:8554/frontdoor_sub?video

That will grab only the video from the stream leaving the audio out. No ffmpeg involved.

?video

And then in my automation, I’ll use this url in pipup.

http://xxxxxx.xxx:1984/webrtc.html?src=frontdoor_noaudio

1 Like

Awesome, Cheers! I must’ve missed that in the docs. didn’t realise there was the special param on their own rtsp loopback.‘?video’

It can be on any rtsp link. Not only loopback. I try to loopback to a single url to the Camera to prevent multiple streams from opening against the camera itself though.

Ahh interesting, I will play around with it now that my videos aren’t stopping. With it being on demand the connections would be minimal then released when the popup closes so should be alright to get rtsp straight from device for my use case.

EDIT: turns out rtsp://DEVICE_IP:DEVICE_PORT/unicast?video doesn’t even work so will stick with the loop back

Your example and help has now allowed me to easily understand how go2rtc disables audio and its simply done in Javascript so I’ve ended up porting my own view and am using RTSPToWeb and no need for extra streams etc. I am currently preferring RTSPToWeb as it’s a bit more stable on my streams but I’m ready to port everything over to go2rtc once it matures a bit as I’m wanting to have the MJPEG conversion also but without the startup delay (This is benificial for Google Hubs)… Thanks again for your quick responses and saving me more frustrations!

NOTE: Also creating my own view has allowed me to also remove the controls from appearing briefly and showing a poster image (camera snapshot) instead of the big play icon while its loading.

That’s not correct. It literally strips the audio stream from the stream itself. It doesn’t do this in javascript.

Buty glad you got something working. For me go2rtc is completely stable and has been for months.

It is correct. I literally just did it

let offer = await webrtc.createOffer({
      offerToReceiveAudio:false, # this code right here is what tells the video not to render audio
      offerToReceiveVideo:true
});

I mean, I literally did that on a completely different system to go2rtc and has the exact same result…
No need for loopbacks no need for extra connections or streams.

Now if the param ?video happens to strip audio from other sources like mse, hls etc then it might be possible that the audio may be being stripped internally or they just toggle the component not to render audio (I haven’t studied the code so can’t clarify) either way. that code above is literally stripping the audio (choosing not to accept it) which is the same regardless.

It isn’t correct. Just because you disabled the audio stream in javascript doesn’t mean go2rtc strips it in javascript. lol. It literally sends the stream with a blank audio stream. Check you logs in debug.

frontdoor_noaudio:
    rtsp://127.0.0.1:8554/frontdoor_sub?video

That will produce a stream without audio. It doesn’t disable it in javascript.

You can literally create a new generic camera pointing to

rtsp://IP:1984/webrtc.html?src=frontdoor_noaudio

and it will not have audio in the stream. and there is no javascript in that flow with rtsp streams and no webpage.

Disabled the audio stream??? You literally just said it lol. what is the definition of stripping? disabling, removing etc isn’t it? I am literally talking about webrtc and I clearly stated “easily understand how go2rtc disables audio and its simply done in Javascript” in regards to webrtc and the video element displayed on pipup and how the video element thinks that the video will produce audio. I also wouldn’t be surprised if a stream has no audio but that toggle being set to true would probably still result in pausing videos…

I never once said how go2rtc processes things internally or how they’re stripping the audio from sources etc. I simply said I discovered how to strip/disable the audio from JS for the video element.

I have got PiPup running OK on my Bravia TV but I need to manually launch the app after each reboot.

I have tried an app called Launch at Boot, but it doesn’t find PiPup to give me the option to start the app at boot. Does anyone have any other suggestions for how I can achieve this please?

Many thanks.

I came across this as well. I just set up a fairly naive automation in HA to just launch it every morning before I get up for the day.

Note: this automation does two things, since I also run a custom screensaver on my TCL Google TV, called YoWindow, that seemed to have the same issue with reboots. If all you want to do is start PiPup, cut out everything from the first delay call onward. I’m also running the original PiPup, I’m not sure if some of recent the variants that allow the web/video popups would need an adjusted command…I haven’t had a chance to mess around with them yet.

alias: Make sure pipup is running daily on TCL TV
description: ''
trigger:
  - platform: time
    at: '05:00:00'
condition: []
action:
  - service: androidtv.adb_command
    continue_on_error: true
    data:
      command: am start -n nl.rogro82.pipup/nl.rogro82.pipup.MainActivity
    target:
      entity_id: media_player.tcl_tv
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - service: logbook.log
    continue_on_error: true
    data:
      name: TCL TV ADB PipUp Response
      message: '{{state_attr(''media_player.tcl_tv'', ''adb_response'') }}'
      entity_id: media_player.tcl_tv
  - service: androidtv.adb_command
    continue_on_error: true
    data:
      command: am start -n yo.app/yo.activity.MainActivity
    target:
      entity_id: media_player.tcl_tv
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - service: logbook.log
    continue_on_error: true
    data:
      name: TCL TV ADB YoWindow Response
      message: '{{state_attr(''media_player.tcl_tv'', ''adb_response'') }}'
      entity_id: media_player.tcl_tv
mode: single

/Edit: I should also have noted that you’d have to setup the Android TV integration in HA to have access to the androidtv.adb_command service.

brilliant! thanks

Hey,

I finally got this one working and it seems to be running better than “Notifications for Android”, at least for me.

I can get the image and web working, but not video. Maybe I misunderstood the video capability, but is it possible somehow to show a love feed of my UniFi Protect cameras?

Thanks.

1 Like

Hi all, I just finally got this configured using this blog post with the go2rtc addon. When I push the notifications to my Nvidia Shield Pro (2019) box that is attached to my TV I got an error message the pop up displays a “Clear Text Not Permitted” error. From my research it seems like it is due to me using only http instead of https. Is there anyway to use just http as I’m only using this internally to my LAN and have no desire to use it externally?

Appreciate any advice I can get.

I have same problem. Any ideas how to resolve this issue? Maybe @seanblanchfield knows the answer.

It’s nearly a year since I did this work, so my memory is a bit fuzzy. I don’t recall ever seeing the “Clear Text Not Permitted” error, but @Insearchofth1ngs’s analysis that it’s related to HTTPS sounds right. In particular, this issue in the PiPup repository describes it and links to a stackoverflow discussion about this issue more generally on Android 9+. This PR on the PiPup repository aims to fix the problem along the lines discussed in that stackoverflow post. The PR doesn’t seem to have been merged, but a build is provided. I see that @droso-hass has a fork merging both that PR and another important PR to allow javascript support, but I don’t see a build. Perhaps one of the many PiPup forks includes both of the big PRs and also provides a build.

I think I didn’t encounter this issue myself because of how I have Home Assistant set up for external access. There is a callout box in my blog post discussing how I use the Nginx Proxy Manager to allow remote access to HA with HTTPS (while maintaining local access via HTTP). I think Nginx Proxy Manager is a particularly good solution here because of how the traffic flows. HTTPS means we must to use a public domain name, but that domain name resolves to my router’s WAN IP address, where TLS port 443 is port forwarded back to Nginx Proxy Manager. When my Nvidia Shield connects to that domain to download the video stream, the traffic hairpins at my router, and never leaves my LAN. It’s basically as optimal as you could hope for, with no additional latency or bandwidth costs. It is also optimal for accessing HA remotely, and it doesn’t interfere with HA being available over cleartext HTTP inside the LAN.

So I think there’s two way forward:

  1. Try the build provided in the PR discussed above (which might be missing the javascript fix), or find another fork/build that fixes it, or fork it yourself and build it (and share the build if you do this work!).
  2. Use the Nginx Proxy Manager addon like me.

I hope that helps a bit!

1 Like

I’m not sure exactly how you are trying to display your camera stream, but direct RTSP etc is not supported by PiPup. However, if you can display the stream in a webpage, then you can make PiPup display that web page. Typically, this would mean embedding a WebRTC video in a webpage that streams from a WebRTC proxy server inside your LAN (the WebRTC Camera integration can do this for you).

See the conversation on this issue in the PiPup repository about this.
I also have a pretty detailed write up of a configuration that works well for me here: Real-Time Picture-in-Picture Camera Feeds on your TV with Home Assistant | Sean Blanchfield

1 Like

Try using this version of PiPup which should support http
Releases · desertblade/PiPup (github.com)

I had this working using Sean’s original tutorial but I found the video feed froze and stuttered a lot. I’m not sure if it was because in order to use https I had to use the external url which was then sending the feed to the web and streaming it from there. But in a 15s popup there would only be about 3-4s of actual video and the rest was freezing and stuttering.

I switched to using frigate’s MJPEG stream as described in this post. I’m using the apk linked above, http and an internal ip address.

Now my video stream is very smooth with minimal lag

2 Likes

Thanks @seanblanchfield, I’m using the go2rtc addon to translate my RTSP camera feeds coming from blue iris to WebRTC feeds. I installed the one apk in rogro82 #34 pull request, but I don’t think that has the allow clear text attribute set, so everything needs to be HTTPS. I found one that wasbuild in this my-ugly-code’s repo. I’ll probably give that a try when I get home.

Edit: The apk provided in my-uggly-code’s repo worked like a charm for me. I can finally display my doorbell cameras feed on my TV when the doorbell is pressed.

Indeed, HA doesn’t need to be running, and if you are running zwavejs2mqtt on a different device, like a raspberry PI located in the best place for Zwave connectivity, you can even set the codes in the lock directly through the web frontend, though its a bit clunky, as you have to go into the device control page in the user code section.