Tradition has it this hymn was written by Martin Luther. Unfortuneately, this isn't so. Ironically, it isn't even well known in Germany!
In 1857 James R Murray published the song in a children's songbook and called it Luther's Cradle Hymn. Unfortuneately, people believed him. The words are actually from a Lutheran Sunday
School book and were written in Philadelphia, Pennsylvania! It is frequently sung to the tune of Flow Gently Sweet Afton.