How strongly did the identity of the smaller German states persist?
National identities did develop in the early 19th century, and specifically in Germany the problem of the nationalists was that there was no available political entity to attach themselves to, but already at the Wartburgfest in 1817 students demanded German unification
Die politische Zerissenheit Deutschlands soll der politischen, religiösen und wirtschaftlichen Einheit weichen.
The political disunity of Germany should be replace by political, religious and economic unity.
Similar the failed German revolution of 1848 tried to established a unified Germany, notice the prominent placement of German flags in this picture. ( From Wikipedia) So at least among the educated, German identity was quite established in the first half of the 19th century.
On the other hand in 1915 Ernst Jünger wrote in Storms of steel
In der ganzen Armee wird man keinen Mann finden, der so verläßlich, einfach und ohne Phrase seine Pflicht tut wie der Niedersachse.
In the entire army no one will carry out his duty as dependable and without complaining as the man from Lower Saxony.
So a distinct regional identity was still present at that time. In total, I think that it very much depended not only on the specific time but on the context if someone's identity is more German or more regional at any given time.