Skip to content
TheChatArchiveThe Chat Archive
Mistralmagistral-medium-2506· Mistral AIHugging Face LMArena Human Preference 140K

use ntfy server running on Debian to notify my iPhone when my MacBook battery is fully…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Claudeclaude-opus-4-20250514-thinking-16k’s answer.
  1. User

    use ntfy server running on Debian to notify my iPhone when my MacBook battery is fully charged

  2. Mistral Assistant

    To set up notifications for when your MacBook battery is fully charged using an ntfy server running on Debian, follow these steps:

    1. Create a shell script on your MacBook to monitor the battery status. The script should check if the battery is at 100% and plugged in using the pmset -g batt command.

    2. Use a flag file to ensure the notification is only sent once when the battery reaches 100%.

    3. Use curl to send a notification to your ntfy server when the battery is fully charged. The script should look like this:

    #!/bin/bash
    
    FLAG_FILE="/tmp/battery_fully_charged.flag"
    NTFY_SERVER="http://my-ntfy-server:80"
    TOPIC="mymacbook_battery"
    MESSAGE="MacBook battery is fully charged!"
    
    battery_status=$(pmset -g batt)
    
    if [[ $battery_status == *"AC"* && $battery_status == *"100%; charged;"* ]]; then
        if [ ! -f "$FLAG_FILE" ]; then
            curl -X POST -d "$MESSAGE" "$NTFY_SERVER/$TOPIC"
            touch "$FLAG_FILE"
        fi
    else
        if [ -f "$FLAG_FILE" ]; then
            rm "$FLAG_FILE"
        fi
    fi
    
    1. Save the script to /usr/local/bin/check_battery.sh and make it executable with chmod +x /usr/local/bin/check_battery.sh.

    2. Set up a cron job to run the script every 5 minutes by adding the following line to your crontab (crontab -e):

    */5 * * * * /usr/local/bin/check_battery.sh
    
    1. On your iPhone, install the ntfy app and subscribe to the topic mymacbook_battery.

    2. Ensure your ntfy server is accessible from your MacBook and properly configured to send notifications to your iPhone.

    This setup will notify your iPhone via the ntfy server whenever your MacBook battery is fully charged.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.