Rule-based Intelligence for Domotic Environments