diff --git a/homeassistant/components/device_tracker/tplink.py b/homeassistant/components/device_tracker/tplink.py index 17beab02532..ad295099bf5 100755 --- a/homeassistant/components/device_tracker/tplink.py +++ b/homeassistant/components/device_tracker/tplink.py @@ -277,8 +277,10 @@ class Tplink4DeviceScanner(TplinkDeviceScanner): _LOGGER.info("Retrieving auth tokens...") url = 'http://{}/userRpm/LoginRpm.htm?Save=Save'.format(self.host) - # Generate md5 hash of password - password = hashlib.md5(self.password.encode('utf')).hexdigest() + # Generate md5 hash of password. The C7 appears to use the first 15 + # characters of the password only, so we truncate to remove additional + # characters from being hashed. + password = hashlib.md5(self.password.encode('utf')[:15]).hexdigest() credentials = '{}:{}'.format(self.username, password).encode('utf') # Encode the credentials to be sent as a cookie.