Config fetching fix and template improvement (if sensor is not available)