The ZEO Data Decoder Library Documentation describes what the data for the Bedside unit records. I assume it is the same as the Mobile version.
base_hypnogram
Records the sleep stages on a 30 second time scale. The base_hypnogram tag contains a space-separated list of numbers. The first element represents the time period starting at the time specified in the hypnogram_start time tag and ending 30 seconds later. The sleep stages are encoded as integers according to the following mapping: (deep and deep_2 both represent deep sleep)
0. undefined
- wake
- REM
- light
- deep
- (not used)
- deep_2
display_hypnogram
Records the sleep stages on a 5 minute time scale. The display_hypnogram tag contains a space separated list of numbers. The first element represents the time period starting at the time specified in the hypnogram_start time tag and ending 5 minutes later. The sleep stages are encoded as integers according to the following mapping: - undefined
- wake
- REM
- light
- deep
I hope this helps.
As to the display of data, I pulled the CSV data into excel. Put time in first column, Sleep number in Second column and then set up columns for Awake, REM, Light, and Deep.
To make the graph look like the ZEO plots I reversed the numbers (although I could reverse the Y axis scale on the excel chart to fit the numbers correctly).
To populate the cells under those columns I referenced the sleep number column and for awake put =IF(B2=1,4,"") {since I used 4 for awake not 1}, REM =IF(B2=2,3,""), Light =IF(B2=3,2,""), Deep =IF(B2=4,1,""). The result is filling each of these columns with blanks or the number I used for that state when I was in that state. Then I put together a clustered column chart for each of the four columns and matched the column colors to what ZEO had used. I also adjusted the column width to fill the full time interval. TIme was my x axis.
All of the effort was to see if I could reasonably duplicate the daily web display. I was satisfied with the results, but the process needs to be automated to make this approach practical.
Enjoy