Coffee Machine Reminder Blueprint - iOS & Android

Coffee Machine Reminder Blueprint - iOS & Android

Interactive notifications to prevent your coffee machine from staying on too long

This blueprint helps you manage your coffee machine (or any switch) by sending interactive notifications when it’s been on for too long. You can quickly choose to keep it on or turn it off directly from the notification. If there’s no response, it automatically turns off after a configurable timeout.

Features :star2:

Core Features (All Versions)

  • Configurable runtime monitoring (default: 40 minutes)
  • Configurable response timeout (default: 5 minutes)
  • Interactive notifications with action buttons
  • Automatic notification cleanup
  • Support for multiple devices
  • Automatic turn-off with confirmation notification
  • Simple switch entity configuration

iOS-Specific Features :iphone:

  • Time-sensitive notification support
  • iOS-optimized notification format
  • Long-press action handling

Android-Specific Features :robot:

  • Custom notification channels
  • Haptic feedback (vibration patterns)
  • High-priority notifications
  • Sticky notifications until acted upon
  • Tap action handling

Language Support :earth_africa:

  • :de: German (Deutsch)
  • :uk: English

Requirements

For iOS Version

  • iOS device(s) with Home Assistant Companion app
  • A switch entity (e.g., coffee machine, smart plug)

For Android Version

  • Android device(s) with Home Assistant Companion app
  • A switch entity (e.g., coffee machine, smart plug)

Installation :inbox_tray:

Choose the version that matches your device and preferred language:

iOS Versions

Android Versions

Configuration

  1. Import the blueprint that matches your device and language preference
  2. Create a new automation using the imported blueprint
  3. Configure the following:
    • Select your coffee machine’s switch entity
    • Choose your target device(s)
    • Adjust the runtime and timeout if needed (optional)
    • Customize notification texts (optional)

Customization Options

  • Runtime: How long the switch should be on before sending a notification
  • Response Timeout: How long to wait for user response before auto-turn-off
  • Notification Tag: Custom identifier for notification management
  • All Notification Texts: Fully customizable messages and button labels

Usage Example

  1. Coffee machine is turned on at 8:00 AM
  2. At 8:40 AM (after default 40 minutes), you receive a notification
  3. You can either:
    • Choose “Keep On” to continue using the machine
    • Choose “Turn Off” to switch it off
    • Do nothing, and it will auto-turn-off after 5 minutes (default)

Source Code & Updates

Support & Feedback

  • Feel free to leave comments or suggestions below
  • Create issues on GitHub for bug reports
  • Star the repository if you find it useful!

License

This blueprint is licensed under the MIT License - feel free to use, modify, and share!


:pray: If you find this blueprint helpful, please give it a like and share your experience!

2 Likes

Hi. This fails to recognise my devices. Is there an issue?

1 Like

@Maneridiet as @PaulG pointed out, your code filters out all devices, so none ever show - at least on your android version. I did not test the iOS

btw, you can always combine the iOS and Android versions, no real reason to keep them separate. Check out my blueprints for examples on this.

here’s the fixed code for this one…

blueprint:
  name: "Coffee Machine – Reminder after runtime (Android interactive)"
  description: "Monitors a switch (e.g. coffee machine). If it stays on longer than the configured time (default: 40 minutes), an interactive Android notification is sent. You can then choose: Keep On or Turn Off. If there is no response within the answer time (default: 5 minutes), the switch will be turned off automatically. In all cases the notification will be cleared afterwards."
  domain: automation
  source_url: "https://github.com/Maneridiet/home-assistant-blueprints#coffee-prompt"
  input:
    coffee_switch:
      name: "Coffee machine switch"
      description: "The switch to monitor and turn off if needed."
      selector:
        entity:
          domain: switch

    run_time:
      name: "Runtime until reminder"
      description: "How long the switch must stay on before the notification is sent."
      default: "00:40:00"
      selector:
        duration: {}

    response_timeout:
      name: "Response timeout"
      description: "How long to wait for a reply before turning the switch off automatically."
      default: "00:05:00"
      selector:
        duration: {}

    notify_devices:
      name: "Target devices (Android)"
      description: "One or more Android devices with the Home Assistant Companion App that should receive the push notification."
      selector:
        device:
          multiple: true
          filter:
            integration: mobile_app

    notification_tag:
      name: "Notification tag"
      description: "Identifier used to clear the notification later. Default is coffee_prompt."
      default: "coffee_prompt"
      selector:
        text: {}

    title_running:
      name: "Title – reminder"
      description: "Title of the notification when the coffee machine has been running for too long."
      default: "Coffee machine has been running for 40 minutes"
      selector:
        text: {}

    message_running:
      name: "Message – reminder"
      description: "Notification text. Example: Tap to choose: Keep On or Turn Off."
      default: "Tap to choose: Keep On or Turn Off"
      selector:
        text: {}

    title_auto_off:
      name: "Title – auto turned off"
      description: "Title of the notification when the switch was turned off automatically."
      default: "Coffee machine turned off"
      selector:
        text: {}

    message_auto_off:
      name: "Message – auto turned off"
      description: "Notification text when the switch was turned off due to no response."
      default: "No response within 5 minutes – turned off automatically."
      selector:
        text: {}

    keep_title:
      name: "Action text – Keep On"
      description: "Label for the button to keep the coffee machine running."
      default: "Keep On"
      selector:
        text: {}

    off_title:
      name: "Action text – Turn Off"
      description: "Label for the button to turn off the coffee machine."
      default: "Turn Off"
      selector:
        text: {}

mode: single
max_exceeded: silent

trigger:
  - platform: state
    entity_id: !input coffee_switch
    to: "on"
    for: !input run_time

condition: []

action:
  # 1) Send interactive notification to selected devices
  - service: notify.notify
    target:
      device_id: !input notify_devices
    data:
      title: !input title_running
      message: !input message_running
      data:
        actions:
          - action: "KEEP_ON"
            title: !input keep_title
          - action: "TURN_OFF"
            title: !input off_title
        tag: !input notification_tag

  # 2) Wait for a response from notification action
  - wait_for_trigger:
      - platform: event
        event_type: mobile_app_notification_action
        event_data:
          action: "KEEP_ON"
          tag: !input notification_tag
      - platform: event
        event_type: mobile_app_notification_action
        event_data:
          action: "TURN_OFF"
          tag: !input notification_tag
    timeout: !input response_timeout
    continue_on_timeout: true

  # 3) Handle the response
  - choose:
      - conditions:
          - condition: template
            value_template: "{{ wait.trigger and wait.trigger.event.data.action == 'TURN_OFF' }}"
        sequence:
          - service: switch.turn_off
            target:
              entity_id: !input coffee_switch
          - service: notify.notify
            target:
              device_id: !input notify_devices
            data:
              title: !input title_auto_off
              message: !input message_auto_off
              data:
                tag: !input notification_tag
      - conditions:
          - condition: template
            value_template: "{{ wait.trigger and wait.trigger.event.data.action == 'KEEP_ON' }}"
        sequence:
          - service: notify.notify
            target:
              device_id: !input notify_devices
            data:
              message: "clear_notification"
              data:
                tag: !input notification_tag
    default:
      - service: switch.turn_off
        target:
          entity_id: !input coffee_switch
      - service: notify.notify
        target:
          device_id: !input notify_devices
        data:
          title: !input title_auto_off
          message: !input message_auto_off
          data:
            tag: !input notification_tag

  # 4) Clear notification after action
  - service: notify.notify
    target:
      device_id: !input notify_devices
    data:
      message: "clear_notification"
      data:
        tag: !input notification_tag

Hey, thanks for the response. I’m new to blueprints, so tried to paste your code in to the existing blueprints code, but it came up as an error. Can you please advise how to get your revised code to work?