I'm not sure how to achieve this yet ( maybe you can help me? ) but I think that to do this I will need one or more decision trees. The scikit-learn library Descision Trees for Python might be useful to me for this purpose, applying the concept of Machine Learning on raw non-force numeric entities such as the states of Home Assistant entities.
The general idea could be this below, but it could change thanks to your helping.