Temporal constraints with multiple granularities in Smart Homes