Habitica: Auto-accept quest invitation

Automatically accept quest invitations from your Habitica party.

(this is an upcoming feature in the Habitica integration that is not yet available in Home Assistant)

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

blueprint:
  name: "Habitica: Auto-accept quest invitation"
  description: Automatically accept quest invitations from your Habitica party.
  author: tr4nt0r
  homeassistant:
    min_version: 2024.11.0
  domain: automation
  input:
    pending_quest_invitation:
      name: "Pending quest invitation sensor"
      description: "Select the pending quest invitation sensor for your character. The automation will trigger when the sensor changes from 'off' to 'on'."
      selector:
        entity:
          filter:
            - domain: binary_sensor
              integration: habitica
    notification_title:
      name: "Notification title"
      description: "The title of the persistent notification shown when a quest invitation is auto-accepted."
      default: "You have been invited to a quest!"
      selector:
        text:
    notification_message:
      name: "Notification message"
      description:  "The body text of the persistent notification displayed upon successfully auto-accepting a quest invitation."
      selector:
        template:
      default: >-
        ![{{action_response["key"]}}](https://habitica-assets.s3.amazonaws.com/mobileApp/images/inventory_quest_scroll_{{action_response["key"]}}.png)

        The invitation has been accepted, and the quest {% if
        action_response["active"] %}has already started. {% else %}is waiting
        for other party members to join. {% endif %}
variables:
  entity: !input pending_quest_invitation
  entry: '{{ config_entry_id(entity) }}'
triggers:
  - trigger: state
    entity_id: !input pending_quest_invitation
    from: "off"
    to: "on"
actions:
  - action: habitica.accept_quest
    data:
      config_entry: '{{ config_entry_id(entity) }}'
    response_variable: action_response
  - action: notify.persistent_notification
    data:
      title: !input notification_title
      message: !input notification_message
mode: single