A method for controlling a heating/cooling system located in a domestic environment of a user, said method comprising, by means of a computer: a) for each user (Ui) of a number M of users (U1, U2, U3, U4) including said user, based on information received from at least one presence sensor (PSi) located in its respective domestic environment (Hi) of said each user (Ui), detecting occurrences of an occupancy-related event carried out by said each user (Ui) in said respective domestic environment (Hi), said occupancy-related event being indicative of a change of status of said domestic environment (Hi) between an occupied status and a non-occupied status; b) for said each user (Ui), providing respective counts of occurrences of said occupancy-related event in a plurality of timeslots; c) merging said respective counts of occurrences of said occupancy-related event in said plurality of timeslots relating to said number M of users (U1, U2, U3, U4) and applying a model thereto, so as to provide a forecast of a domestic environment occupancy routine of said user; and d) based on said forecast of said domestic environment occupancy routine of said user, determining a setting of said heating/cooling system located in said domestic environment of said user and providing at least one control signal suitable for operating said heating/cooling system according to said determined setting, wherein step b) also comprises normalizing said counts of occurrences of said occupancy-related event in said plurality of timeslots, thereby providing proportions of occurrences of said occupancy-related event in said plurality of timeslots in a domestic environment occupancy routine of said each user (Ui), wherein at step b) smoothed proportions of occurrences of said occupancy-related event in said plurality of timeslots are calculated for said each user (Ui) by applying a smoothing kernel to said proportions of occurrences of said occupancy-related event in said plurality of timeslots, said smoothing kernel distributing a proportion of occurrences of said occupancy-related event in a certain timeslot over at least one timeslot preceding said certain timeslot and over at least one timeslot following said certain timeslot, wherein step c) comprises merging said smoothed proportions of occurrences of said occupancy-related event in said plurality of timeslots calculated for said number M of users (U1, U2, U3, U4) in a matrix (M entry, M exit), each column of said matrix (M entry, M exit) comprising said smoothed proportions of occurrences of said occupancy-related event in said plurality of timeslots calculated for said each user (Ui), and said applying said model comprises processing said matrix (M entry, M exit) to determine: (i) a first matrix (cpentry, cpexit), each column of said first matrix (cpentry, φ exit) comprising probabilities that a certain habit generates a certain time sequence of occupancy-related events in said plurality of timeslots; and (ii) a second matrix (θ entry, θ exit), each column of said second matrix (θ entry, θ exit) indicating proportions of a plurality of habits in said domestic environment occupancy routine of said each user (Ui), and said forecast of said domestic environment occupancy routine of said user is calculated as an internal product between said first matrix (cpentry, cpexit) and said second matrix (θ entry, θ exit), said internal product resulting in a forecast matrix (F entry, Fexit), a column of said forecast matrix (F entry, F exit) comprising probabilities that said occupancy-related event occurs in said plurality of timeslots for said user (Ui). a) for each user (Ui) of a number M of users (U1, U2, U3, U4) including said user, based on information received from at least one presence sensor (PSi) located in its respective domestic environment (Hi) of said each user (Ui), detecting occurrences of an occupancy-related event carried out by said each user (Ui) in said respective domestic environment (Hi), said occupancy-related event being indicative of a change of status of said domestic environment (Hi) between an occupied status and a non-occupied status; b) for said each user (Ui), providing respective counts of occurrences of said occupancy-related event in a plurality of timeslots; c) merging said respective counts of occurrences of said occupancy-related event in said plurality of timeslots relating to said number M of users (U1, U2, U3, U4) and applying a model thereto, so as to provide a forecast of a domestic environment occupancy routine of said user; and d) based on said forecast of said domestic environment occupancy routine of said user, determining a setting of said heating/cooling system located in said domestic environment of said user and providing at least one control signal suitable for operating said heating/cooling system according to said determined setting, (i) a first matrix (cpentry, cpexit), each column of said first matrix (cpentry, φ exit) comprising probabilities that a certain habit generates a certain time sequence of occupancy-related events in said plurality of timeslots; and (ii) a second matrix (θ entry, θ exit), each column of said second matrix (θ entry, θ exit) indicating proportions of a plurality of habits in said domestic environment occupancy routine of said each user (Ui),