I built a little bedside clock that displays:
- The date and time
- The number of hours I've slept (really, the number of hours that have passed since I last turned off my bedside lamps)
- My sleep "progress" -- when full, I've slept for >=8h.
The important variables to keep updated are:
lights-out-time
- timestamp lights were turned out at.lights-out-time-relative
- number of hours/m that have passed sincelights-out-time
.sleep-time-percent
- % of 8hlights-out-time-relative
is
I keep these updated using a Node-RED flow.