I tested it and honestly it seems complicated, actually I couldn’t do it.
So we have to create a scene to retrieve the sensor’s last state and then, we have access to the value in another scene. But then what’s the name of the value?
EDIT : I think I pretty much found my question here : Utiliser la fonctionnalité d'un device comme valeur dans "Continuer seulement si" et "Changement d'état" - #4 par guim31