#!/bin/bash # Authenticate to Home Assistant using the long-lived token # This creates a session that can be used for web UI access HA_URL="http://homeassistant.local:8123" TOKEN="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJlOWM3YmRjMmY2ZTM0ZTliOTAzMjg2M2NlYWNjODM5ZSIsImlhdCI6MTc2NjkxNjk0MiwiZXhwIjoyMDgyMjc2OTQyfQ.r02yFKwxGKWr07Pil7Bp3IHhjJXrSBOhkdOGh5VzKk4" echo "Attempting to authenticate with token..." # Try to use the token to create a web session # Home Assistant might accept the token as a cookie or header # Actually, for web UI, we need to use trusted networks or saved session # But let's try using the token in a different way - via a bookmarklet or # by setting it as a cookie echo "For web UI auto-login, you have two options:" echo "" echo "1. TRUSTED NETWORKS (Recommended - no keyboard needed)" echo " - Add IP 192.168.68.193 to Home Assistant trusted networks" echo " - See: ~/scripts/setup-trusted-networks-instructions.txt" echo "" echo "2. Use the token to create an authenticated session via API" echo " This requires some setup but might work..."