         self.unit = unit
 
         super.init(dailyItems: dailyItems, timeZone: timeZone)
+    }
+
+    public required convenience init?(rawValue: RawValue) {
+        guard let
+            rawUnit = rawValue["unit"] as? String,
+            timeZoneName = rawValue["timeZone"] as? String,
+            rawItems = rawValue["items"] as? [RepeatingScheduleValue.RawValue] else
+        {
+            return nil
+        }
+
+        self.init(unit: HKUnit(fromString: rawUnit), dailyItems: rawItems.flatMap { RepeatingScheduleValue(rawValue: $0) }, timeZone: NSTimeZone(name: timeZoneName))
     }
 
     public func at(time: NSDate) -> HKQuantity {

    public override init?(dailyItems: [RepeatingScheduleValue], timeZone: NSTimeZone? = nil) {
        super.init(dailyItems: dailyItems, timeZone: timeZone)
    }
}

    return lhs.startDate == rhs.startDate && lhs.value == rhs.value
}

extension RepeatingScheduleValue: RawRepresentable {
    public typealias RawValue = [String: AnyObject]

    public init?(rawValue: RawValue) {
        guard let startTime = rawValue["startTime"] as? Double,
            value = rawValue["value"] as? Double else {
                return nil
        }

        self.init(startTime: startTime, value: value)
    }

    public var rawValue: RawValue {
        return [
            "startTime": startTime,
            "value": value
        ]
    }
}


public class DailyValueSchedule: RawRepresentable {
    public typealias RawValue = [String: AnyObject]

    private let referenceTimeInterval: NSTimeInterval
    private let repeatInterval = NSTimeInterval(hours: 24)

