JanJaapKo / DysonPureLink

Handles Dyson Pure Link in Domoticz as plugin
12 stars 2 forks source link

Invalid login again with 2FA #40

Closed Krakinou closed 3 years ago

Krakinou commented 3 years ago

Hi, It seems that the authentication stop working again. I tried the workaround of reauthenticating through the mobile app to get a new auth code, but to no avail. Here are the logs:

 2021-07-20 23:30:34.265 [6e3ff220] Status: Dyson Pure: (Dyson Pure) Entering work loop.
2021-07-20 23:30:34.265 [72d61220] Status: Dyson Pure: (Dyson Pure) Started.
2021-07-20 23:30:35.367 [6e3ff220] Dyson Pure: (Dyson Pure) Debug logging mask set to: PYTHON PLUGIN DEVICE CONNECTION MESSAGE
2021-07-20 23:30:35.367 [6e3ff220] Dyson Pure: (Dyson Pure) Parameter count: 25
2021-07-20 23:30:35.367 [6e3ff220] Dyson Pure: (Dyson Pure) Parameter 'HardwareID':'6'
2021-07-20 23:30:35.367 [6e3ff220] Dyson Pure: (Dyson Pure) Parameter 'HomeFolder':'/opt/yunohost/domoticz/plugins/DysonPureLink/'
2021-07-20 23:30:35.367 [6e3ff220] Dyson Pure: (Dyson Pure) Parameter 'StartupFolder':'/opt/yunohost/domoticz/'
2021-07-20 23:30:35.368 [6e3ff220] Dyson Pure: (Dyson Pure) Parameter 'UserDataFolder':'/opt/yunohost/domoticz/'
2021-07-20 23:30:35.368 [6e3ff220] Dyson Pure: (Dyson Pure) Parameter 'Database':'/opt/yunohost/domoticz/domoticz.db'
2021-07-20 23:30:35.368 [6e3ff220] Dyson Pure: (Dyson Pure) Parameter 'Language':'fr'
2021-07-20 23:30:35.368 [6e3ff220] Dyson Pure: (Dyson Pure) Parameter 'Author':'Jan-Jaap Kostelijk'
2021-07-20 23:30:35.368 [6e3ff220] Dyson Pure: (Dyson Pure) Parameter 'Name':'Dyson Pure'
2021-07-20 23:30:35.368 [6e3ff220] Dyson Pure: (Dyson Pure) Parameter 'Address':'192.168.0.31'
2021-07-20 23:30:35.368 [6e3ff220] Dyson Pure: (Dyson Pure) Parameter 'Port':'1883'
2021-07-20 23:30:35.368 [6e3ff220] Dyson Pure: (Dyson Pure) Parameter 'Key':'DysonPureLink'
2021-07-20 23:30:35.368 [6e3ff220] Dyson Pure: (Dyson Pure) Parameter 'Mode1':'364654'
2021-07-20 23:30:35.368 [6e3ff220] Dyson Pure: (Dyson Pure) Parameter 'Mode2':'2'
2021-07-20 23:30:35.368 [6e3ff220] Dyson Pure: (Dyson Pure) Parameter 'Mode3':'Removed sensitive data'
2021-07-20 23:30:35.368 [6e3ff220] Dyson Pure: (Dyson Pure) Parameter 'Mode4':'Verbose'
2021-07-20 23:30:35.369 [6e3ff220] Dyson Pure: (Dyson Pure) Parameter 'Mode5':'Removed sensitive data'
2021-07-20 23:30:35.369 [6e3ff220] Dyson Pure: (Dyson Pure) Parameter 'Mode6':'Chambre'
2021-07-20 23:30:35.369 [6e3ff220] Dyson Pure: (Dyson Pure) Parameter 'DomoticzVersion':'2021.1'
2021-07-20 23:30:35.369 [6e3ff220] Dyson Pure: (Dyson Pure) Parameter 'DomoticzHash':'8547c5b7e'
2021-07-20 23:30:35.369 [6e3ff220] Dyson Pure: (Dyson Pure) Parameter 'DomoticzBuildTime':'2021-04-17 17:29:11'
2021-07-20 23:30:35.369 [6e3ff220] Dyson Pure: (Dyson Pure) Configuration count: 5
2021-07-20 23:30:35.369 [6e3ff220] Dyson Pure: (Dyson Pure) Configuration 'MajorVersion':'4'
2021-07-20 23:30:35.370 [6e3ff220] Dyson Pure: (Dyson Pure) Configuration 'MinorVersion':'0'
2021-07-20 23:30:35.370 [6e3ff220] Dyson Pure: (Dyson Pure) Configuration 'patchVersion':'3'
2021-07-20 23:30:35.370 [6e3ff220] Dyson Pure: (Dyson Pure) Configuration 'plugin version':'4.0.3'
2021-07-20 23:30:35.370 [6e3ff220] Dyson Pure: (Dyson Pure) Device count: 22
2021-07-20 23:30:35.370 [6e3ff220] Dyson Pure: (Dyson Pure) Device: 1 - ID: 37, Name: 'Dyson Pure - Fan mode', nValue: 0, sValue: '10'
2021-07-20 23:30:35.370 [6e3ff220] Dyson Pure: (Dyson Pure) Device: 2 - ID: 40, Name: 'Dyson Pure - Night mode', nValue: 0, sValue: 'OFF'
2021-07-20 23:30:35.370 [6e3ff220] Dyson Pure: (Dyson Pure) Device: 3 - ID: 41, Name: 'Dyson Pure - Fan speed', nValue: 0, sValue: '0'
2021-07-20 23:30:35.370 [6e3ff220] Dyson Pure: (Dyson Pure) Device: 4 - ID: 42, Name: 'Dyson Pure - Oscilation mode', nValue: 0, sValue: 'OFF'
2021-07-20 23:30:35.370 [6e3ff220] Dyson Pure: (Dyson Pure) Device: 5 - ID: 43, Name: 'Dyson Pure - Standby monitor', nValue: 1, sValue: '20'
2021-07-20 23:30:35.370 [6e3ff220] Dyson Pure: (Dyson Pure) Device: 6 - ID: 44, Name: 'Dyson Pure - Remaining filter life', nValue: 4151, sValue: '4151'
2021-07-20 23:30:35.370 [6e3ff220] Dyson Pure: (Dyson Pure) Device: 7 - ID: 49, Name: 'Dyson Pure - Air quality setpoint', nValue: 1, sValue: '20'
2021-07-20 23:30:35.370 [6e3ff220] Dyson Pure: (Dyson Pure) Device: 8 - ID: 45, Name: 'Température Chambre', nValue: 1, sValue: '27.3;59;1'
2021-07-20 23:30:35.371 [6e3ff220] Dyson Pure: (Dyson Pure) Device: 9 - ID: 46, Name: 'COV Chambre', nValue: 1, sValue: '1'
2021-07-20 23:30:35.371 [6e3ff220] Dyson Pure: (Dyson Pure) Device: 10 - ID: 48, Name: 'Dyson Pure - Dust', nValue: 1, sValue: '1'
2021-07-20 23:30:35.371 [6e3ff220] Dyson Pure: (Dyson Pure) Device: 11 - ID: 47, Name: 'Dyson Pure - Sleep timer', nValue: 0, sValue: '0'
2021-07-20 23:30:35.371 [6e3ff220] Dyson Pure: (Dyson Pure) Device: 12 - ID: 38, Name: 'Dyson Pure - Fan state', nValue: 0, sValue: '10'
2021-07-20 23:30:35.371 [6e3ff220] Dyson Pure: (Dyson Pure) Device: 13 - ID: 55, Name: 'Dyson Pure - Fan focus mode', nValue: 0, sValue: ''
2021-07-20 23:30:35.371 [6e3ff220] Dyson Pure: (Dyson Pure) Device: 14 - ID: 54, Name: 'Dyson Pure - Fan mode auto', nValue: 0, sValue: ''
2021-07-20 23:30:35.371 [6e3ff220] Dyson Pure: (Dyson Pure) Device: 15 - ID: 50, Name: 'Dyson Pure - Dust (PM 2,5)', nValue: 0, sValue: ''
2021-07-20 23:30:35.371 [6e3ff220] Dyson Pure: (Dyson Pure) Device: 16 - ID: 51, Name: 'Dyson Pure - Dust (PM 10)', nValue: 0, sValue: ''
2021-07-20 23:30:35.371 [6e3ff220] Dyson Pure: (Dyson Pure) Device: 17 - ID: 56, Name: 'Dyson Pure - Nitrogen Dioxide Density (NOx)', nValue: 0, sValue: ''
2021-07-20 23:30:35.371 [6e3ff220] Dyson Pure: (Dyson Pure) Device: 18 - ID: 57, Name: 'Dyson Pure - Heat mode', nValue: 0, sValue: '10'
2021-07-20 23:30:35.371 [6e3ff220] Dyson Pure: (Dyson Pure) Device: 19 - ID: 58, Name: 'Dyson Pure - Heat target', nValue: 0, sValue: '19'
2021-07-20 23:30:35.371 [6e3ff220] Dyson Pure: (Dyson Pure) Device: 20 - ID: 39, Name: 'Dyson Pure - Heating state', nValue: 0, sValue: '10'
2021-07-20 23:30:35.371 [6e3ff220] Dyson Pure: (Dyson Pure) Device: 21 - ID: 52, Name: 'Dyson Pure - Particles (PM 25)', nValue: 0, sValue: ''
2021-07-20 23:30:35.371 [6e3ff220] Dyson Pure: (Dyson Pure) Device: 22 - ID: 53, Name: 'Dyson Pure - Particles (PM 10)', nValue: 0, sValue: ''
2021-07-20 23:30:35.372 [6e3ff220] Dyson Pure: (Dyson Pure) Starting version: 4.0.3
2021-07-20 23:30:35.372 [6e3ff220] Dyson Pure: (Dyson Pure) checking versions: current '4.0.3', config '4.0.3'
2021-07-20 23:30:35.373 [6e3ff220] Dyson Pure: (Dyson Pure) No devices found in plugin configuration, request from Dyson cloud account
2021-07-20 23:30:35.373 [6e3ff220] Dyson Pure: (Dyson Pure) === start making connection to Dyson account, new method as of 2021 ===
2021-07-20 23:30:35.374 [6e3ff220] Dyson Pure: (Dyson Pure) building request: method POST, path /v3/userregistration/email/userstatus, params {'country': 'NL'}, data {'email': 'Removed sensitive data'}, auth None
2021-07-20 23:30:35.731 [6e3ff220] Dyson Pure: (Dyson Pure) Local context:
2021-07-20 23:30:35.731 [6e3ff220] Dyson Pure: (Dyson Pure) ----> 'Devices' '{1: <Domoticz.Device object at 0x69cdd7a0>, 2: <Domoticz.Device object at 0x69cdd800>, 3: <Domoticz.Device object at 0x69cdd860>, 4: <Domoticz.Device object at 0x69cdd8c0>, 5: <Domoticz.Device object at 0x69cdd920>, 6: <Domoticz.Device object at 0x69cdd980>, 7: <Domoticz.Device object at 0x69cdd9e0>, 8: <Domoticz.Device object at 0x69cdda40>, 9: <Domoticz.Device object at 0x69cddaa0>, 10: <Domoticz.Device object at 0x69cddb00>, 11: <Domoticz.Device object at 0x69cddb60>, 12: <Domoticz.Device object at 0x69cddbc0>, 13: <Domoticz.Device object at 0x69cddc20>, 14: <Domoticz.Device object at 0x69cddc80>, 15: <Domoticz.Device object at 0x69cddce0>, 16: <Domoticz.Device object at 0x69cddd40>, 17: <Domoticz.Device object at 0x69cddda0>, 18: <Domoticz.Device object at 0x69cdde00>, 19: <Domoticz.Device object at 0x69cdde60>, 20: <Domoticz.Device object at 0x69cddec0>, 21: <Domoticz.Device object at 0x69cddf20>, 22: <Domoticz.Device object at 0x69cddf80>}'
2021-07-20 23:30:35.732 [6e3ff220] Dyson Pure: (Dyson Pure) ----> 'Domoticz' '<module 'Domoticz' (built-in)>'
2021-07-20 23:30:35.732 [6e3ff220] Dyson Pure: (Dyson Pure) ----> 'Images' '{}'
2021-07-20 23:30:35.732 [6e3ff220] Dyson Pure: (Dyson Pure) ----> 'Parameters' '{'HardwareID': 6, 'HomeFolder': '/opt/yunohost/domoticz/plugins/DysonPureLink/', 'StartupFolder': '/opt/yunohost/domoticz/', 'UserDataFolder': '/opt/yunohost/domoticz/', 'WebRoot': '', 'Database': '/opt/yunohost/domoticz/domoticz.db', 'Language': 'fr', 'Version': '', 'Author': 'Jan-Jaap Kostelijk', 'Name': 'Dyson Pure', 'Address': '192.168.0.31', 'Port': '1883', 'SerialPort': '', 'Username': '', 'Password': '', 'Key': 'DysonPureLink', 'Mode1': '364654', 'Mode2': '2', 'Mode3': 'Removed sensitive data', 'Mode4': 'Verbose', 'Mode5': 'Removed sensitive data', 'Mode6': 'Chambre', 'DomoticzVersion': '2021.1', 'DomoticzHash': '8547c5b7e', 'DomoticzBuildTime': '2021-04-17 17:29:11'}'
2021-07-20 23:30:35.732 [6e3ff220] Dyson Pure: (Dyson Pure) ----> 'Settings' '{'DB_Version': '148', 'Title': 'Maison', 'LightHistoryDays': '30', 'MeterDividerEnergy': '1000', 'MeterDividerGas': '100', 'MeterDividerWater': '100', 'RandomTimerFrame': '25', 'ElectricVoltage': '230', 'CM113DisplayType': '0', '5MinuteHistoryDays': '1', 'SensorTimeout': '60', 'SensorTimeoutNotification': '0', 'UseAutoUpdate': '1', 'UseAutoBackup': '0', 'CostEnergy': '2149', 'CostEnergyT2': '2149', 'CostEnergyR1': '800', 'CostEnergyR2': '800', 'CostGas': '6218', 'CostWater': '16473', 'UseEmailInNotifications': '1', 'SendErrorNotifications': '0', 'EmailPort': '587', 'EmailAsAttachment': '0', 'DoorbellCommand': '0', 'SmartMeterType': '0', 'EnableTabLights': '1', 'EnableTabTemp': '1', 'EnableTabWeather': '1', 'EnableTabUtility': '1', 'EnableTabCustom': '1', 'EnableTabScenes': '1', 'EnableTabFloorplans': '1', 'NotificationSensorInterval': '600', 'NotificationSwitchInterval': '0', 'RemoteSharedPort': '6144', 'Language': 'fr', 'DashboardType': '0', 'MobileType': '0', 'WindUnit': '0', 'TempUnit': '0', 'WeightUnit': '0', 'SecStatus': '0', 'SecOnDelay': '30', 'AuthenticationMethod': '0', 'ReleaseChannel': '0', 'RaspCamParams': '-w 800 -h 600 -t 1', 'UVCParams': '-S80 -B128 -C128 -G80 -x800 -y600 -q100', 'AcceptNewHardware': '1', 'ZWavePollInterval': '30', 'ZWaveEnableDebug': '0', 'ZWaveNetworkKey': '0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10', 'ZWaveEnableNightlyNetworkHeal': '0', 'BatteryLowNotification': '15', 'AllowWidgetOrdering': '1', 'ActiveTimerPlan': '1', 'HideDisabledHardwareSensors': '0', 'EnableEventScriptSystem': '1', 'EventSystemLogFullURL': '1', 'DisableDzVentsSystem': '0', 'DzVentsLogLevel': '3', 'LogEventScriptTrigger': '1', 'WebTheme': 'simple-gray', 'FloorplanPopupDelay': '750', 'FloorplanFullscreenMode': '0', 'FloorplanAnimateZoom': '1', 'FloorplanShowSensorValues': '1', 'FloorplanShowSwitchValues': '1', 'FloorplanShowSceneNames': '1', 'FloorplanRoomColour': 'darkgreen', 'FloorplanActiveOpacity': '25', 'FloorplanInactiveOpacity': '5', 'TempHome': '20', 'TempAway': '15', 'TempComfort': '22.0', 'DegreeDaysBaseTemperature': '18.0', 'HTTPURL': 'aHR0cHM6Ly93d3cuc29tZWdhdGV3YXkuY29tL3B1c2h1cmwucGhwP3VzZXJuYW1lPSNGSUVMRDEmcGFzc3dvcmQ9I0ZJRUxEMiZhcGlrZXk9I0ZJRUxEMyZmcm9tPSNGSUVMRDQmdG89I1RPJm1lc3NhZ2U9I01FU1NBR0U=', 'HTTPPostContentType': 'YXBwbGljYXRpb24vanNvbg==', 'ShowUpdateEffect': '0', 'ShortLogInterval': '5', 'SendErrorsAsNotification': '0', 'IFTTTEnabled': '0', 'EmailEnabled': '1', 'Location': '48.906389;2.334201', 'ClickatellEnabled': '0', 'ClickatellAPI': '0', 'ClickatellTo': '0', 'EmailFrom': 'Removed sensitive data', 'EmailServer': 'Removed sensitive data', 'EmailTo': 'Removed sensitive data', 'EmailPassword': 'Removed sensitive data', 'EmailUsername': 'Removed sensitive data', 'FCMEnabled': '0', 'HTTPEnabled': '0', 'HTTPField1': '0', 'HTTPField2': '0', 'HTTPField3': '0', 'HTTPField4': '0', 'HTTPPostData': '0', 'HTTPPostHeaders': '0', 'HTTPTo': '0', 'KodiIPAddress': '224.0.0.1', 'KodiEnabled': '0', 'KodiPort': '9777', 'KodiTimeToLive': '5', 'LmsPlayerMac': '0', 'LmsDuration': '5', 'LmsEnabled': '0', 'ProwlAPI': '0', 'ProwlEnabled': '0', 'PushALotAPI': '0', 'PushALotEnabled': '0', 'PushbulletAPI': '0', 'PushbulletEnabled': '0', 'PushoverAPI': '0', 'PushoverUser': '0', 'PushoverEnabled': '0', 'PushsaferAPI': '0', 'PushsaferImage': '0', 'PushsaferEnabled': '0', 'TelegramAPI': '0', 'TelegramChat': '0', 'TelegramEnabled': '0', 'WebLocalNetworks': '127.0.0.*;192.168.0.*', 'WebRemoteProxyIPs': '0', 'SecPassword': 'Removed sensitive data', 'ProtectionPassword': 'Removed sensitive data', 'MyDomoticzUserId': '0', 'MyDomoticzSubsystems': '0', 'OneWireSensorPollPeriod': '0', 'OneWireSwitchPollPeriod': '0', 'IFTTTAPI': '0', 'MaxElectricPower': '6000', 'ClickatellFrom': '0', 'WebUserName': 'Removed sensitive data', 'WebPassword': 'Removed sensitive data'}'
2021-07-20 23:30:35.732 [6e3ff220] Dyson Pure: (Dyson Pure) ----> '_plugin' '<plugin.DysonPureLinkPlugin object at 0x697eadd0>'
2021-07-20 23:30:35.733 [6e3ff220] Dyson Pure: (Dyson Pure) ----> 'debug' 'False'
2021-07-20 23:30:35.733 [6e3ff220] Dyson Pure: (Dyson Pure) ----> 'json' '<module 'json' from '/usr/lib/python3.7/json/__init__.py'>'
2021-07-20 23:30:35.733 [6e3ff220] Dyson Pure: (Dyson Pure) ----> 'time' '<module 'time' (built-in)>'
2021-07-20 23:30:35.733 [6e3ff220] Dyson Pure: (Dyson Pure) Heartbeat interval set to: 10.
2021-07-20 23:30:35.360 [6e3ff220] Status: Dyson Pure: (Dyson Pure) Initialized author 'Jan-Jaap Kostelijk'
2021-07-20 23:30:35.730 [6e3ff220] Error: Dyson Pure: (Dyson Pure) Dyson request failed: '401, Unauthorized'
2021-07-20 23:30:35.731 [6e3ff220] Error: Dyson Pure: (Dyson Pure) 'onStart' failed 'DysonInvalidAuth'.
2021-07-20 23:30:35.731 [6e3ff220] Error: Dyson Pure: (Dyson Pure) ----> Line 651 in '/opt/yunohost/domoticz/plugins/DysonPureLink/plugin.py', function onStart
2021-07-20 23:30:35.731 [6e3ff220] Error: Dyson Pure: (Dyson Pure) ----> Line 172 in '/opt/yunohost/domoticz/plugins/DysonPureLink/plugin.py', function onStart
2021-07-20 23:30:35.731 [6e3ff220] Error: Dyson Pure: (Dyson Pure) ----> Line 134 in '/opt/yunohost/domoticz/plugins/DysonPureLink/cloud/account.py', function login_email_otp
2021-07-20 23:30:35.731 [6e3ff220] Error: Dyson Pure: (Dyson Pure) ----> Line 120 in '/opt/yunohost/domoticz/plugins/DysonPureLink/cloud/account.py', function request 
JanJaapKo commented 3 years ago

Right, same here. I'll dive into it. Have you stored your local credentials somewhere? for backup? not that there is a way to enter them though.....

JanJaapKo commented 3 years ago

I tried to setup a new instance of the plugin with correct credentials after first opening the Dyson app (no login or whatso ever) and all worked as expected. @Krakinou can you verify if that works for you as well?

Krakinou commented 3 years ago

OK, so this is very strange : My current plugin was not working. So I created a new hardware : This requested a new OTP code that I set up : the new hardware was correctly working. Then I deleted this hardware and "modified" the existing one (that I want to keep as it has all the historical data) : This also requested a new OTP code that I entered and now it's working. So: my issue is solved but there is definitly something strange going on. Maybe the OTP code need to be refreshed from time to time?

JanJaapKo commented 3 years ago

I added a note to the installation instruction to log in to the app first, as that seems to clear some thing in the Dyson cloud to allow the plugin to log in as well.