Preview
๐ด History Log
u/chefchip1965
This shortcut takes the sleep history from the health app and generates a detail log which shows when you begin sleeping and when you awake, the number of hours slept and flags your preset goals.
๐ = target goal, >6
๐งก = acceptable goal =6
โค = too little, <6
It shows the monthly averages for bedtime, wake time and hours slept. Duration slept, max min and average.
An arrow in the last sleep day shows if you slept more or less than the night before.
The goals are on the hour. You can change them for your personal needs
It is currently set up to work with Sleep++
This should work when your sleep tracker will let you output duration in the following format - hh:mm
You need to change the get health samples if you don't use Sleep++ if the data does not show right to output the data.
What's New
Fixed bug
What it does
185 actions-
Comment๐ด History Log u/chefchip1965 This shortcut takes the sleep history from the health app and generates a detail log which shows when you begin sleeping and when you awake, the number of hours slept and flags your preset goals. ๐ = target goal, >6 ๐งกโฆ
-
Format Date
-
Set VariableYesterday
-
Format Date
-
Set VariableToday
-
Format Date
-
Repeat
-
Find Health Samples
-
Add to Variable
-
Nothing
-
Find Health Samples
-
Add to Variable
-
Adjust Date
-
Set VariableYesterday
-
Adjust Date
-
Set VariableToday
-
CommentGoals are entered below in the # of seconds, below is 7, 6, and 5 hours in seconds
-
Dictionary
-
Set VariableGoals
-
CommentThe dd below generates the current day of the month so the log displays sleep for the entire month.
-
Set VariableToday
-
Date
-
Set VariableYesterday
-
Nothing
-
Format Date
-
CommentChange the settings in this action to deliver the results needed for processing.
-
Count
-
Set VariableDatacount
-
Repeat with Each
-
Get Details of Health Sample
-
CommentConvert time to seconds
-
Calculate Statistics
-
Add to Variable
-
CommentFind maximum duration
-
Calculate Statistics
-
CommentConvert to time format
-
Date
-
Adjust Date
-
Format Date
-
Set VariableMaxduration
-
CommentFind minimum sleep duration
-
Calculate Statistics
-
CommentConvert to time format
-
Date
-
Adjust Date
-
Format Date
-
Set VariableMinduration
-
CommentFind average sleep duration
-
Calculate Statistics
-
CommentConvert to time format
-
Date
-
Adjust Date
-
Format Date
-
Set VariableAvgduration
-
Comment/Start calculate if all nighters happened. It compares the number of days of sleep data recorded to the latest day recorded. If the difference is 0 then no all nighters.
-
Count
-
Date
-
Adjust Date
-
Format Date
-
Calculate
-
Set VariableAllnighters
-
Comment/End calculate if all nighters happened
-
Repeat with Each
-
Get Details of Health Sample
-
Adjust Date
-
Format Date
-
Set VariableDay
-
Get Details of Health Sample
-
Format Date
-
Set VariableBedtime
-
Add to Variable
-
Get Details of Health Sample
-
Format Date
-
Set VariableWaketime
-
Add to Variable
-
Get Details of Health Sample
-
Calculate Statistics
-
Set VariableTodayduration
-
Date
-
Adjust Date
-
Format Date
-
Set VariableDuration
-
Nothing
-
If
-
Calculate
-
Get Details of Health Sample
-
Get Item from List
-
Calculate Statistics
-
If
-
Text
-
If
-
Text
-
Set VariableTrend
-
If
-
If
-
Text
-
Set VariableTrend
-
If
-
Nothing
-
If
-
Add to Variable
-
Text
-
If
-
If
-
Add to Variable
-
Text
-
If
-
Add to Variable
-
Text
-
Set VariableSleepgoal
-
CommentIdentify max and min duration nights
-
If
-
Text
-
If
-
If
-
Text
-
If
-
Text
-
Set VariableDuration
-
Text
-
Add to Variable
-
CommentCalculate counts for goals
-
Count
-
Count
-
Count
-
Nothing
-
CommentCalculate average wake time
-
Repeat with Each
-
Split Text
-
Get Item from List
-
Split Text
-
Get Item from List
-
Add to Variable
-
Get Item from List
-
Add to Variable
-
CommentCalculate wake time averages
-
Calculate Statistics
-
Round Number
-
Calculate Statistics
-
Round Number
-
Text
-
Set VariableAvgwaketime
-
CommentCalculate average bedtime. This is a bit tricky because you have to take into account that you may go to bed after midnight. In order to take care of that straight math will not work. The way I did it was to treat the clock as a linear line and sepaโฆ
-
Repeat with Each
-
Split Text
-
Get Item from List
-
If
-
Split Text
-
Get Item from List
-
Split Text
-
Get Item from List
-
If
-
Calculate
-
Add to Variable
-
If
-
If
-
Get Item from List
-
Split Text
-
Get Item from List
-
Add to Variable
-
Nothing
-
CommentAverage converted linear hours list
-
Repeat with Each
-
Split Text
-
Get Item from List
-
Split Text
-
Get Item from List
-
Add to Variable
-
CommentCalculate bedtime average
-
Calculate Statistics
-
Round Number
-
If
-
Calculate
-
Set VariableAvgbedtimehour
-
Text
-
If
-
Set VariableAvgbedtimehour
-
Text
-
Set VariableA
-
Calculate Statistics
-
Round Number
-
Set VariableAvgbedtimeminutes
-
Text
-
Set VariableAvgbedtime
-
Show AlertSleep History Log
Ratings & Reviews
Write a ReviewNo reviews yet. Be the first to share what you think!