A Python tool to analyze macOS sleep logs generated by pmset -g log
and provide insights into wake-up events and their causes.
This project uses uv
for dependency management. Install uv
first if you haven't already:
curl -LsSf https://astral.sh/uv/install.sh | sh
Then install the project:
uv sync
pmset -g log | uv run pmset_analyzer.py
=== macOS Sleep Log Analysis ===
📊 Total wake events: 4866
📅 Log period: 2025-06-24 19:25:22 to 2025-06-25 08:12:22
🔍 Wake Sources:
• Deep Idle [CDN]: 4866 times (100.0%)
🚨 Top Wake Causes:
• wifibt: 9733 times (39.2%)
• SMC.OutboxNotEmpty: 5102 times (20.6%)
• smc.70070000: 4866 times (19.6%)
• SMC.OutboxNotEmpty/: 4630 times (18.7%)
⏱️ Average wake duration: 6.3 seconds
🔄 Shortest wake: 5 seconds
⏰ Longest wake: 81 seconds
🔄 Wake Frequency Analysis:
• Average time between wakes: 0.2 minutes
• Frequent wakes (< 5 min apart): 4862 occurrences
⚠️ Most Active Drivers/Components:
• SMC (System Management Controller): 14599 wake events (58.9%)
• Wireless (WiFi/Bluetooth): 9737 wake events (39.3%)
• Other: 467 wake events (1.9%)
📋 Recent Wake Events:
• 2025-06-25 08:09:38: smc.70070000 wifibt SMC.OutboxNotEmpty/UserActivit... (0s)
• 2025-06-25 08:09:32: smc.70070000 wifibt SMC.OutboxNotEmpty/ (6s)
• 2025-06-25 08:09:23: smc.70070000 wifibt SMC.OutboxNotEmpty/ (6s)
When using the -v
flag, the tool also shows example log entries for each top wake cause:
🚨 Top Wake Causes:
• wifibt: 9733 times (39.2%)
📝 Example log entries:
2025-06-24 19:25:22 +0200 DarkWake: DarkWake from Deep Idle [CDN] : due to smc.70070000 wifibt SM...
DriverReason: DriverReason:wifibt - DriverDetails:
2025-06-24 19:25:34 +0200 DarkWake: DarkWake from Deep Idle [CDN] : due to smc.70070000 wifibt SM...
• SMC.OutboxNotEmpty: 5102 times (20.6%)
📝 Example log entries:
2025-06-24 19:25:22 +0200 DarkWake: DarkWake from Deep Idle [CDN] : due to smc.70070000 wifibt SM...
DriverReason: DriverReason:SMC.OutboxNotEmpty - DriverDetails:
2025-06-24 19:25:34 +0200 DarkWake: DarkWake from Deep Idle [CDN] : due to smc.70070000 wifibt SM...
- Fork the repository
- Create a feature branch
- Make your changes
- Test with your own sleep logs
- Submit a pull request
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Copyright 2025 pmset-analyzer contributors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.