Hierarchical Task Recognition and Planning in Smart Homes with Partial Observability