Thank you. I didn’t see x-amz-cf-pop, but with verbose logging I can catch the outbound remote IP in curl or with invoke-webrequest pretty nicely, and it is rotating, so it could be very helpful. Here’s my latest logging script. Including the timestamps is also a great idea.
I didn’t quite see what I was expecting. Could still be some additional load balancing going on that I’m not getting details for here. What we do see for sure is that the timestamp is stale for the incorrect information, in the case below,
Door status changed to: closed at 07/07/2025 12:03:46 (Server IP: 52.20.85.235, Door Timestamp: 07/07/2025 15:33:01)
Door status changed to: closed at 07/07/2025 12:03:50 (Server IP: 54.84.56.5, Door Timestamp: 07/07/2025 15:33:01)
So far, I’ve seen it can take 5 minutes to settle down, and 2 minutes. So no particularly interesting pattern there yet.
Door status changed to: open at 07/07/2025 12:03:42 (Server IP: 52.20.85.235, Door Timestamp: 07/07/2025 16:03:37)
Door status changed to: closed at 07/07/2025 12:03:46 (Server IP: 52.20.85.235, Door Timestamp: 07/07/2025 15:33:01)
Door status changed to: open at 07/07/2025 12:03:49 (Server IP: 52.20.85.235, Door Timestamp: 07/07/2025 16:03:37)
Door status changed to: closed at 07/07/2025 12:03:50 (Server IP: 54.84.56.5, Door Timestamp: 07/07/2025 15:33:01)
Door status changed to: open at 07/07/2025 12:03:52 (Server IP: 54.84.56.5, Door Timestamp: 07/07/2025 16:03:37)
Door status changed to: closed at 07/07/2025 12:03:53 (Server IP: 54.84.56.5, Door Timestamp: 07/07/2025 15:33:01)
Door status changed to: open at 07/07/2025 12:03:54 (Server IP: 54.84.56.5, Door Timestamp: 07/07/2025 16:03:37)
Door status changed to: closed at 07/07/2025 12:03:57 (Server IP: 54.84.56.5, Door Timestamp: 07/07/2025 15:33:01)
Door status changed to: open at 07/07/2025 12:03:58 (Server IP: 54.84.56.5, Door Timestamp: 07/07/2025 16:03:37)
Door status changed to: closed at 07/07/2025 12:04:00 (Server IP: 54.84.56.5, Door Timestamp: 07/07/2025 15:33:01)
Door status changed to: open at 07/07/2025 12:04:02 (Server IP: 54.84.56.5, Door Timestamp: 07/07/2025 16:03:37)
Door status changed to: closed at 07/07/2025 12:04:05 (Server IP: 54.84.56.5, Door Timestamp: 07/07/2025 15:33:01)
Door status changed to: open at 07/07/2025 12:04:06 (Server IP: 54.84.56.5, Door Timestamp: 07/07/2025 16:03:37)
Door status changed to: closed at 07/07/2025 12:04:09 (Server IP: 54.84.56.5, Door Timestamp: 07/07/2025 15:33:01)
Door status changed to: open at 07/07/2025 12:04:12 (Server IP: 54.86.139.148, Door Timestamp: 07/07/2025 16:03:37)
Door status changed to: closed at 07/07/2025 12:04:14 (Server IP: 54.86.139.148, Door Timestamp: 07/07/2025 15:33:01)
Door status changed to: open at 07/07/2025 12:04:19 (Server IP: 54.86.139.148, Door Timestamp: 07/07/2025 16:03:37)
Door status changed to: closed at 07/07/2025 12:04:20 (Server IP: 54.86.139.148, Door Timestamp: 07/07/2025 15:33:01)
Door status changed to: open at 07/07/2025 12:04:21 (Server IP: 54.86.139.148, Door Timestamp: 07/07/2025 16:03:37)
Door status changed to: closed at 07/07/2025 12:04:23 (Server IP: 54.86.139.148, Door Timestamp: 07/07/2025 15:33:01)
$previousStatus = $null
$hostName = "api.smartthings.com"
$VerbosePreference = 'SilentlyContinue' # Suppress verbose output
while ($true) {
# Resolve the hostname to get the IP address
$serverIP = (Resolve-DnsName -Name $hostName -Type A).IPAddress | Select-Object -First 1
# Make the API request using Invoke-WebRequest
$response = Invoke-WebRequest -Uri "https://api.smartthings.com/v1/devices/b3ce7cb1-8636-4b6b-9046-e38a627a5a72/status" `
-Method Get `
-Headers @{ "Authorization" = "Bearer d4812352-41a9-4976-ac6f-... }
# Parse the JSON response
$jsonResponse = $response.Content | ConvertFrom-Json
$currentStatus = $jsonResponse.components.main.doorControl.door.value
$doorTimestamp = $jsonResponse.components.main.doorControl.door.timestamp
if ($currentStatus -ne $previousStatus) {
Write-Host "Door status changed to: $currentStatus at $(Get-Date) (Server IP: $serverIP, Door Timestamp: $doorTimestamp)"
$previousStatus = $currentStatus
}
Start-Sleep -Seconds 1
}