         rval["absolute"] = absolute
         rval["duration"] = duration.minutes
         rval["amount"] = amount
+        rval["automatic"] = automatic
         return rval
     }
 }

    public let absolute: Double?
    public let temp: RateType
    public let duration: TimeInterval
    
    public init(timestamp: Date, enteredBy: String, temp: RateType, rate: Double, absolute: Double?, duration: TimeInterval, amount: Double? = nil, id: String? = nil, syncIdentifier: String? = nil, insulinType: String?) {
        self.rate = rate
        self.absolute = absolute
        self.temp = temp
        self.duration = duration
        self.amount = amount
        
        // Commenting out usage of surrogate ID until supported by Nightscout
        super.init(timestamp: timestamp, enteredBy: enteredBy, id: id, eventType: .tempBasal, syncIdentifier: syncIdentifier, insulinType: insulinType)

        self.duration = TimeInterval(minutes: durationMinutes)
        self.amount = entry["amount"] as? Double
        self.absolute = entry["absolute"] as? Double
        self.automatic = entry["automatic"] as? Bool ?? true

        super.init(entry)
    }
