Federer is still without a title this year and has been battling injuries. The former No. 1 underwent meniscus surgery after losing in the Australian Open semifinals to Novak Djokovic and then missed the French Open because of a back injury.
The top-ranked Djokovic won his first French Open title on Sunday to complete a career Grand Slam.
"It's been a difficult year for me, to put it mildly," Federer said on Monday, adding he has had no setbacks in the last three weeks.
"Now, I am feeling really well. "It's OK after all the years to miss a major," said Federer, who had played a record 65 straight Grand Slams since 1999.
The 17-time Grand Slam champion is the top-seeded player at the inaugural edition of the Mercedes Cup on grass and has a bye into the second round.
"If I survive a couple of matches, when you are in the semifinals, you start thinking about the title. But to think now about the title here would be a little premature," he said.
"Now it's important to come back from injuries. That's really the only thing that matters for me."
The 34-year-old Swiss great said he was pleased about the opportunity to add another grass-court event in the build-up to Wimbledon.
He is also scheduled to play next week in Halle, his traditional warm-up for Wimbledon, where he's won a record eight titles. Federer, who is now ranked No. 3, praised Djokovic's win in Paris, saying it was "super for tennis, world class."
"It was wonderful the way he did it," Federer said of Djokovic's triumph, which brought him to 12 Grand Slam titles.