Android TV notifications - TvOverlay

Thanks so much for your reply and help. I do have the mobile app installed. I am able to perform tests. In home assistance, I just been testing the notifications from the developer tools. I apologize if this is not the proper way to send over the info.

Below is what I have in the configuration.yaml

notify:
  - name: TvOverlayNotify
    platform: rest
    method: POST_JSON
    resource: http://192.168.4.210:5001/notify 
    verify_ssl: false
    title_param_name: title
    data:
      id: "{{ data.id | default(null) }}" # string | main text | default: null
      appTitle: "{{ data.appTitle  | default('Home Assistant') }}" # string | extra info text | default: null
      color: "{{ data.color | default('#049cdb') }}" # string | color tint for smallIcon. accepts 6 or 8 digit color hex. the '#' is optional | default: null
      image: "{{ data.image | default(null) }}" # string | accepts mdi icons, image urls and Bitmap encoded to Base64 | default: null
      video: "{{ data.video | default(null) }}" # string | video url. supports rtps, hls, dash, smoothstreaming | default: null
      smallIcon: "{{ data.smallIcon | default(null) }}" # string | accepts mdi icons, image urls and Bitmap encoded to Base64 | default: null
      largeIcon: "{{ data.largeIcon | default(null) }}" # string | accepts mdi icons, image urls and Bitmap encoded to Base64 | default: null
      corner: "{{ data.corner  | default(null) }}" # string | position on the screen. accept values: bottom_start, bottom_end, top_start, top_end | default: null (uses hot corner)
      seconds: "{{ data.seconds | default(null) }}" # int | duration that the notification will stay visible in seconds | default: null (uses duration setting)
      
  - name: TvOverlayNotifyFixed
    platform: rest
    method: POST_JSON
    resource: http://192.168.4.210/notify_fixed
    verify_ssl: false
    title_param_name: title
    data:
      id: "{{ data.id | default(null) }}" # string | can be used to edit or remove the fixed notification | default: [random]
      text: "{{ data.text  | default(null) }}" # string | main text | default: null
      icon: "{{ data.icon | default(null) }}" # string | accepts mdi icons, image urls and Bitmap encoded to Base64 | default: null
      textColor: "{{ data.textColor | default(null) }}" # string | accepts 6 or 8 digit color hex. the '#' is optional | default: #FFFFFF
      iconColor: "{{ data.iconColor | default(null) }}" # string | accepts 6 or 8 digit color hex. the '#' is optional | default: #FFFFFF
      borderColor: "{{ data.borderColor | default(null) }}" # string | accepts 6 or 8 digit color hex. the '#' is optional | default: #FFFFFF
      backgroundColor: "{{ data.backgroundColor | default(null) }}" # string | accepts 6 or 8 digit color hex. the '#' is optional | default: #66000000
      shape: "{{ data.shape | default(null) }}" # string | frame style. accept values: circle, rounded, rectangular | default: "rounded"
      visible: "{{ data.visible | default(true) }}" # boolean || if false, removes the fixed notification with matching id || default: true
      expiration: "{{ data.expiration | default(null) }}" # string or int | when the notification will be removed. valid formats: 1695693410 (Epoch time), 1y2w3d4h5m6s (duration format) or 123 (for seconds) | default:  null

tvoverlay:
  url: http://192.168.4.210:5001/set/overlay
  method: POST
  verify_ssl: false
  headers:
    accept: 'application/json'
  content_type:  'application/json; charset=utf-8'
  payload: '{{ payload }}'

This is what I have been using to test the video feed. It works when I have an image. With the video, only the notification is displayed without the video.

action: notify.tvoverlaynotify
data:
  message: The garage door has been open for 10 minutes.
  data:
    title: Test
    video: >-
      rtsp://username:[email protected]:554/cam/realmonitor?channel=8&subtype=1

Try this

action: notify.tvoverlaynotify
data:
  message: The garage door has been open for 10 minutes.
  data:
    title: Test
    video: rtsp://username:[email protected]:554/cam/realmonitor?channel=8&subtype=1

@nodinosaur wow, just installed your app and it looks very promising after the first few minutes.

Something for your consideration: maybe you should create your own thread where we can discuss with you when needed. It will also give you more visibility and might grow your user base.

Thanks and happy new year everyone

1 Like

@ Imygaf … same results. the notification works, but no video. I will keep a look out for another solution. Thank you so much for taking the time to look at this.

Sorry to hear that, I know it can get quite frustrating when it doesn’t work. This is what I have

service: notify.tvoverlaynotify
data:
  message: Motion Detected
  data:
    id: front_door
    color: "#FFF000"
    largeIcon: mdi:cctv
    corner: top_start
    seconds: 12
    video: rtsp://user:[email protected]/Streaming/Channels/502

Works for me. Are you sure path is correct, does it work elsewhere?

I tried this as well and same results. Everything displays but the video stream. My rtsp stream works in VLC, HA generic camera, webrtc and go2rtc.

Thank you for the approval, I am glad you like it so far :slight_smile:

You’re right I ought to, maybe I’ll do it this weekend

2 Likes

Any plans to change the look of the notifications? I get a portrait shaped notification, with the writing at the bottom. Not exactly the neatest looking, so it would be nice to be able to make formatting changes, like align text within the popup etc.

Hi Steve,

I don’t understand what you mean, please could you show me or DM me a picture of what you see?

For me looks like this:
20

Text is aligned, I have an icon representing the camera type and as you know you can change colours of the frame too.
(grey , black , indigo , green , red , cyan , teal , amber , pink . add your own custom color. i.e. #282C35)

A generic camera example:
Mobile Push notifcation camera snapshot example automation

and I have shared the icons:
Graphical assets

(With the the next release you’ll be able to hide the frame completely).

Maybe in a future release I can add further styling, but there are other features that take priority.
A new version of the app is currently being tested that has a lot of tweaks, including frameless, the configuration docs are here:
Config

Hi @nodinosaur,
Thank you for your app. It’s great.
Could be possible to select a not fixed notification layout at rest/mqtt level?

For instance:
First create the desired layouts (for my needs i have created 3 different color background: info (cyan), warning (orange) and danger (red))
Then call the layout through rest or mqtt (like layout: danger)

Thanks

Hi @Novocaine ,

Yes, I was already planning to do a “generic” message layout where a users can define colours and messages, possibly even attach an image.

It is on the feature request list and it will be in a future build.

Until I add a What’s new section (coming soon) you can keep track of what has been added to each build on the releases page

Cheers

1 Like

Regarding the TV-Overlay, where do we post the code exactly? In automations or scripts?

@nodinosaur Appreciate your work, but please create a seperate thread for your app to avoid confusion, this thread is about TVOverlay app, thanks.

1 Like

code goes in your configuration.yaml file
I had to restart home assistant to get the new actions to show up. The quick reload option doesn’t work.

Use the rtsp link from go2rtc. for whatever reason, the direct rtsp link to my Unifi G4 Doorbell doesn’t work (port number and rtsps changed to rtsp). But I went into the go2rtc UI and used the rtsp link it gives for the doorbell feed and that one worked fine

1 Like

Does anyone know why the image won’t show up but everythting else does?

action: notify.shield
data:
  title: Outside Motion Dectected
  message: TEST
  data:
    duration: 10
    position: "bottom-right"
    fontsize: "medium"
    transparency: "20%"
    color: "blue"
    interrupt: 1
    image: "/local/snapshots/outside_camera_snapshot.jpg"

I’ve also tried:
image: ‘/local/snapshots/outside_camera_snapshot.jpg’
&
image: /local/snapshots/outside_camera_snapshot.jpg

I get no errors - just no snapshot

Not sure but I think you need full external path. Https:// etc

All good! its:

image: /config/www/snapshots/outside_camera_snapshot.jpg

Full code for those in the future having the same issue:

action: notify.shield
data:
  title: Outside Motion Dectected
  message: "{{ ai['text'] }}"
  data:
    duration: 10
    position: bottom-right
    fontsize: small
    transparency: 20%
    color: blue
    interrupt: 0
    image: /config/www/snapshots/outside_camera_snapshot.jpg