PiPup - Android TV app for notifications

It’s a shame this doesn’t support RTMP/RTSP. I intended to use it to send a security camera stream when Frigate’s person detection triggered. Currently, I’m opening VLC when the TV is on standby, and using PiPup to send a snapshot if not. Not ideal, but a good opportunity for me to learn how to configure Home Assistant.

Here’s my rest command configuration:

  pipup:
    url: !secret pipup_host
    content_type: 'application/json'
    verify_ssl: false
    method: 'post'
    timeout: 20
    payload: >
      {
      "duration": "{{ duration }}",
      "position": "{{ position }}",
      "title": "{{ title }}",
      "titleColor": "{{ titleColor }}",
      "titleSize": "{{ titleSize }}",
      "message": "{{ message }}",
      "messageColor": "{{ messageColor }}",
      "messageSize": "{{ messageSize }}",
      "backgroundColor": "{{ backgroundColor }}",
      "media": { "{{ mediaType }}": {
        "uri": "{{ uri }}", "width": "{{ width }}"
      }}
      }

Here’s the automation I described above:

  - alias: "Person Detected"
    trigger:
      platform: mqtt
      topic: frigate/events
    action:
      - choose:
        - alias: "If Standby, VLC"
          conditions:
            - condition: state
              entity_id: media_player.tv
              state: "standby"
          sequence:
            - service: androidtv.adb_command
              data:
                entity_id: media_player.tv
                command: >-
                  input keyevent KEYCODE_WAKEUP
            - service: androidtv.adb_command
              data:
                entity_id: media_player.tv
                command: >-
                  am start -a android.intent.action.VIEW -d
                  <RTSP_URL> -n
                  org.videolan.vlc/.gui.video.VideoPlayerActivity
        default:
          - service: rest_command.pipup
            data:
              title: "Home Assistant"
              message: "A {{trigger.payload_json['after']['label']}} was seen in {{trigger.payload_json['after']['camera']}}."
              backgroundColor: "#DD000000"
              duration: 10
              messageColor: "#FFFFFF"
              messageSize: 10
              position: 2
              titleColor: "#50BFF2"
              titleSize: 15
              mediaType: "image"
              uri: "https://<HA_URL>/api/frigate/notifications/{{trigger.payload_json['after']['id']}}/thumbnail.jpg"
              width: 640
2 Likes