diff --git a/pyfritzhome/fritzhome.py b/pyfritzhome/fritzhome.py
index <HASH>..<HASH> 100644
--- a/pyfritzhome/fritzhome.py
+++ b/pyfritzhome/fritzhome.py
@@ -95,15 +95,18 @@ class Fritzhome(object):
 
     def login(self):
         """Login and get a valid session ID."""
-        (sid, challenge) = self._login_request()
-        if sid == '0000000000000000':
-            secret = self._create_login_secret(challenge, self._password)
-            (sid2, challenge) = self._login_request(username=self._user,
-                                                    secret=secret)
-            if sid2 == '0000000000000000':
-                _LOGGER.warning("login failed %s", sid2)
-                raise LoginError(self._user)
-        self._sid = sid2
+        try:
+            (sid, challenge) = self._login_request()
+            if sid == '0000000000000000':
+                secret = self._create_login_secret(challenge, self._password)
+                (sid2, challenge) = self._login_request(username=self._user,
+                                                        secret=secret)
+                if sid2 == '0000000000000000':
+                    _LOGGER.warning("login failed %s", sid2)
+                    raise LoginError(self._user)
+                self._sid = sid2
+        except xml.parsers.expat.ExpatError:
+            raise LoginError(self._user)
 
     def logout(self):
         """Logout."""
LoginError when connect to non fritzbox

If connection is tried to an other device other then fitzbox
the returen value cannot be parsed. Throw a LoginError exception.