Skip to content

Phone Notifications in Home Assistant

bobokun edited this page Jan 7, 2021 · 17 revisions

Android Device:

Add this to your home assistant automation YAML to send notifications on new requests:

Please remember to edit the service notify.mobile_app_YOURDEVICE

alias: Notify Phone on Overseerr Requests
description: Notifies your Phone when a new Overseerr request comes in
trigger:
  - platform: numeric_state
    entity_id: sensor.overseerr_pending_requests
    above: '0'
condition: []
action:
  - service: notify.mobile_app_YOURDEVICE
    data:
      title: Pending Plex Request
      message: >
        {% if
        state_attr('sensor.overseerr_pending_requests','last_request_type') ==
        'movie' %}
          <b>{{state_attr('sensor.overseerr_pending_requests','last_request_title')}}</b> was requested by <b>{{state_attr('sensor.overseerr_pending_requests','last_request_username')}}</b> and requires approval.
        {% elif
        state_attr('sensor.overseerr_pending_requests','last_request_type') ==
        'tv'%}
          <b>{{state_attr('sensor.overseerr_pending_requests','last_request_title')}}</b> ({{state_attr('sensor.overseerr_pending_requests','last_request_num_seasons')}} out of {{state_attr('sensor.overseerr_pending_requests','last_request_total_seasons')}} seasons with {{state_attr('sensor.overseerr_pending_requests','last_request_episode_count')}} episodes) was requested by <b>{{state_attr('sensor.overseerr_pending_requests','last_request_username')}}</b> and requires approval.
        {% endif %}
      data:
        ledcColor: '#a387ff'
        color: '#a387ff'
        channel: Overseerr
        tag: |
          {{state_attr('sensor.overseerr_pending_requests','last_request_id')}}
        icon_url: >
          {{state_attr('sensor.overseerr_pending_requests','last_request_poster')}}
        actions:
          - action: approve
            title: Approve Request
          - action: deny
            title: Deny Request
mode: single


Add this to invoke the action selected above:

alias: Overseerr Approve/Deny Notification Action
description: Mobile App Notification Action to Approve/Deny
trigger:
  - platform: event
    event_type: mobile_app_notification_action
    event_data:
      action: approve
  - platform: event
    event_type: mobile_app_notification_action
    event_data:
      action: deny
condition: []
action:
  - service: overseerr.update_request
    data_template:
      request_id: |
        {{trigger.event.data.tag}}
      new_status: |
        {% if trigger.event.data.action == 'approve' %}
          approve
        {% elif trigger.event.data.action == 'deny' %} 
          decline
        {% endif %}
mode: single

IOS Device:

Clone this wiki locally