A method of detecting the presence of a user in a bed by associating at least one state in a plurality of states to a new value output by a drifting pressure sensor, the plurality of states comprising a state associated to the user being present in the bed and a state associated to the user being not present in the bed, the method comprising: /a/ receiving a signal from the drifting pressure sensor, said signal comprising a plurality of values (200, 201, 202, 203); /b/ clustering the plurality of values of said signal into a number of clusters (301, 302) equal to the number of the plurality of states, each cluster being associated with a respective state in the plurality of states; /c/ for the new value of the signal, associating at least one state in said plurality of states or a probability rating representing a probability to be associated with one state in said plurality of states for said new value of the signal, the associated state or the associated probability rating being determined based on at least distances (d H, d L) of said new value of the signal to respective clusters, each distance (d H, d L) being a mathematical difference in absolute value between the new value and barycenter values of the clusters (301, 302), wherein, prior to step /b/, the signal is compressed into a compressed signal having compressed values, the compressed values of the compressed signal being used as the plurality of values of the signal in step /b/, wherein said compressing comprises: /d/ initializing an average value to a first value of the signal, /e/ for each second value in a plurality of second values (201, 202, 203) of the signal output after the first value from the drifting sensor: /e1/ if a distance (Δ V) between the second value and the average value is greater than a predetermined threshold, storing the average value as a compressed value into a memory and setting the average value to the second value, /e2/ otherwise, updating the average value to a new average value as a function of the second value and the average value. /a/ receiving a signal from the drifting pressure sensor, said signal comprising a plurality of values (200, 201, 202, 203); /b/ clustering the plurality of values of said signal into a number of clusters (301, 302) equal to the number of the plurality of states, each cluster being associated with a respective state in the plurality of states; /c/ for the new value of the signal, associating at least one state in said plurality of states or a probability rating representing a probability to be associated with one state in said plurality of states for said new value of the signal, the associated state or the associated probability rating being determined based on at least distances (d H, d L) of said new value of the signal to respective clusters, each distance (d H, d L) being a mathematical difference in absolute value between the new value and barycenter values of the clusters (301, 302), wherein, prior to step /b/, the signal is compressed into a compressed signal having compressed values, the compressed values of the compressed signal being used as the plurality of values of the signal in step /b/, wherein said compressing comprises: /d/ initializing an average value to a first value of the signal, /e/ for each second value in a plurality of second values (201, 202, 203) of the signal output after the first value from the drifting sensor: /e1/ if a distance (Δ V) between the second value and the average value is greater than a predetermined threshold, storing the average value as a compressed value into a memory and setting the average value to the second value, /d/ initializing an average value to a first value of the signal, /e/ for each second value in a plurality of second values (201, 202, 203) of the signal output after the first value from the drifting sensor: /e1/ if a distance (Δ V) between the second value and the average value is greater than a predetermined threshold, storing the average value as a compressed value into a memory and setting the average value to the second value, /e2/ otherwise, updating the average value to a new average value as a function of the second value and the average value.