#!/bin/bash # Load environment variables from .env file source .env # Turn on the external HDD response=$(curl -s -X POST "$HA_URL/api/services/switch/turn_on" \ -H "Authorization: Bearer $HA_TOKEN" \ -H "Content-Type: application/json" \ -d "{\"entity_id\": \"$HDD_SWITCH_ENTITY\"}") echo "Powering on external HDD: $response"