A method for condition-based maintenance of a device of an industrial automation system, characterized in that the method comprises: - a) obtaining measurements comprising measurement values from at least one sensor installed for monitoring the device inside the industrial automation system, by a first network interface outside of the industrial automation system and capable of communications with the at least one sensor or a processing unit connected to the at least sensor; - b) obtaining, by a second network interface outside of the industrial automation system and capable of communications with the device inside of the industrial automation system or a processing unit connected to the device, information indicating two or more operational parameters of the device; - c) determining, by a controller operatively connected to the first and second network interfaces, on the basis of a linear model based on computational models of the two or more operational parameters of the device, one or more threshold levels for the measurement values indicating a maintenance need of the device, wherein at least one of the threshold levels is adapted on the basis of the linear model and the operational parameters of the device, wherein the linear model defines the threshold levels as a function of the operational parameters; - d) estimating, by the controller, one or more time instants associated with a change of the maintenance need of the device on the basis of the obtained measurements and at least one of the threshold levels; repeating a), b) c) and d) over one or more time periods, and adapting at least one of the previous estimated time instants on the basis of the obtained measurements in a subsequent time period; and the method further comprises: - scheduling at least one maintenance operation before said at least one adapted estimated time instant. - a) obtaining measurements comprising measurement values from at least one sensor installed for monitoring the device inside the industrial automation system, by a first network interface outside of the industrial automation system and capable of communications with the at least one sensor or a processing unit connected to the at least sensor; - b) obtaining, by a second network interface outside of the industrial automation system and capable of communications with the device inside of the industrial automation system or a processing unit connected to the device, information indicating two or more operational parameters of the device; - c) determining, by a controller operatively connected to the first and second network interfaces, on the basis of a linear model based on computational models of the two or more operational parameters of the device, one or more threshold levels for the measurement values indicating a maintenance need of the device, wherein at least one of the threshold levels is adapted on the basis of the linear model and the operational parameters of the device, wherein the linear model defines the threshold levels as a function of the operational parameters; - d) estimating, by the controller, one or more time instants associated with a change of the maintenance need of the device on the basis of the obtained measurements and at least one of the threshold levels; repeating a), b) c) and d) over one or more time periods, and adapting at least one of the previous estimated time instants on the basis of the obtained measurements in a subsequent time period; and the method further comprises: - scheduling at least one maintenance operation before said at least one adapted estimated time instant.