Problème Démon Gardena-Husquarna (3)

Voilà… troisième topic sur le même sujet, désolé, à chaque fois des développements. Et je continue à demander de l’aide à @Mips :slight_smile:

Après avoir installé un équipement Husqvarna, j’ai également installé un équipement Gardena (controlleur vannes irrigation). Le controlleur est reconnu dans l’application iOS Gardena, et sur Husqvarna Developer Portal, on a bien toutes les applications connectées:

Pourtant, impossible de lancer le démon, voici le log en mode debug :

[2021-07-17 13:52:30][INFO] : Starting daemon
[2021-07-17 13:52:30][INFO] : Log level : debug
[2021-07-17 13:52:30][DEBUG] : Socket port : 55070
[2021-07-17 13:52:30][DEBUG] : Socket host : localhost
[2021-07-17 13:52:30][DEBUG] : PID file : /tmp/jeedom/gardena/deamon.pid
[2021-07-17 13:52:30][DEBUG] : Writing PID 16968 to /tmp/jeedom/gardena/deamon.pid
[2021-07-17 13:52:30][DEBUG] : Init request module v2.21.0
[2021-07-17 13:52:30][DEBUG] : Starting new HTTP connection (1): 127.0.0.1:80
[2021-07-17 13:52:30][DEBUG] : http://127.0.0.1:80 "GET /plugins/gardena/core/php/jeegardena.php?test=1&apikey=XXXXXXXXXXXXXX HTTP/1.1" 200 2
[2021-07-17 13:52:30][DEBUG] : Encoding `client_id` "16c6d714-7225-4bc6-be07-XXXXXXXX" with `client_secret` as Basic auth credentials.
[2021-07-17 13:52:30][DEBUG] : Requesting url https://api.authentication.husqvarnagroup.dev/v1/oauth2/token using method POST.
[2021-07-17 13:52:30][DEBUG] : Supplying headers {'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'} and data {'grant_type': 'password', 'username': 'shop@xxxx.com', 'password': 'XXXXXXXX'}
[2021-07-17 13:52:30][DEBUG] : Passing through key word arguments {'timeout': None, 'auth': <requests.auth.HTTPBasicAuth object at 0x7475bff0>, 'verify': True, 'proxies': None}.
[2021-07-17 13:52:30][DEBUG] : Starting new HTTPS connection (1): api.authentication.husqvarnagroup.dev:443
[2021-07-17 13:52:31][DEBUG] : https://api.authentication.husqvarnagroup.dev:443 "POST /v1/oauth2/token HTTP/1.1" 200 1048
[2021-07-17 13:52:31][DEBUG] : Request to fetch token completed with status 200.
[2021-07-17 13:52:31][DEBUG] : Request url was https://api.authentication.husqvarnagroup.dev/v1/oauth2/token
[2021-07-17 13:52:31][DEBUG] : Request headers were {'User-Agent': 'python-requests/2.21.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8', 'Content-Length': '61', 'Authorization': 'Basic MTZjNmQ3MTQtNzIyNS00YmM2LWJlMDctZDRiYjY0ZTI1MzYzOg=='}
[2021-07-17 13:52:31][DEBUG] : Request body was grant_type=password&username=xxxx%40xxxx.com&password=XXXXXXXX
[2021-07-17 13:52:31][DEBUG] : Response headers were {'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '1048', 'Connection': 'keep-alive', 'Date': 'Sat, 17 Jul 2021 11:52:31 GMT', 'x-amzn-RequestId': '7fe94e08-9d04-4804-90aa-0978e7ec4941', 'X-DNS-Prefetch-Control': 'off', 'Referrer-Policy': 'no-referrer', 'X-Permitted-Cross-Domain-Policies': 'none', 'X-XSS-Protection': '0', 'Access-Control-Allow-Origin': '*', 'Expect-CT': 'max-age=0', 'Surrogate-Control': 'no-store', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains', 'x-amzn-Remapped-Content-Length': '1048', 'X-Frame-Options': 'SAMEORIGIN', 'Access-Control-Allow-Headers': 'Origin,X-Requested-With,X-Internal-Request-Id,X-External-Request-Id,Content-Type,Accept,X-IAM-Session,Authorization,Authorization-Provider', 'x-amzn-Remapped-Connection': 'keep-alive', 'x-amz-apigw-id': 'CnOj7F-JDoEFa6A=', 'Cache-Control': 'no-store, no-cache, must-revalidate, proxy-revalidate', 'Expires': '0', 'X-Internal-Request-Id': '938366778', 'X-Content-Type-Options': 'nosniff', 'ETag': 'W/"418-mBGMDbrwEqxI2+uTvv5EKaHcbFw"', 'Access-Control-Allow-Methods': 'GET, POST, OPTIONS, PUT, PATCH, DELETE', 'Pragma': 'no-cache', 'x-amzn-Remapped-Date': 'Sat, 17 Jul 2021 11:52:31 GMT', 'X-Cache': 'Miss from cloudfront', 'Via': '1.1 6b0e09b8a7d995016df1513b4b11c17e.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'ZRH50-C1', 'X-Amz-Cf-Id': 'jAbm31kqr6S3WElda9vCne5dX5Zpc-fxBQkgIkmSEP2FnPf03MJpnw=='} and content {"access_token":"XXXXXXXXXXXXXXx","scope":"iam:read","expires_in":86399,"refresh_token":"9f14bc48-12d1-4f45-ba55-XXXXXXXX","provider":"husqvarna","user_id":"1f27b7de-f050-4841-a767-XXXXXXXX","token_type":"Bearer"}.
[2021-07-17 13:52:31][DEBUG] : Invoking 0 token response hooks.
[2021-07-17 13:52:31][DEBUG] : Obtained token {'access_token': 'XXXXXXXXXXXXXXx', 'scope': ['iam:read'], 'expires_in': 86399, 'refresh_token': '9f14bc48-12d1-4f45-ba55-XXXXXXXX', 'provider': 'husqvarna', 'user_id': '1f27b7de-f050-4841-a767-XXXXXXXX', 'token_type': 'Bearer', 'expires_at': 1626609150.4710205}.
[2021-07-17 13:52:31][INFO] : Authentication done
[2021-07-17 13:52:31][INFO] : updating locations
[2021-07-17 13:52:31][DEBUG] : Invoking 0 protected resource request hooks.
[2021-07-17 13:52:31][DEBUG] : Adding token {'access_token': 'XXXXXXXXXXXXXXx', 'scope': ['iam:read'], 'expires_in': 86399, 'refresh_token': '9f14bc48-12d1-4f45-ba55-XXXXXXXX', 'provider': 'husqvarna', 'user_id': '1f27b7de-f050-4841-a767-XXXXXXXX', 'token_type': 'Bearer', 'expires_at': 1626609150.4710205} to request.
[2021-07-17 13:52:31][DEBUG] : Requesting url https://api.smart.gardena.dev/v1/locations using method GET.
[2021-07-17 13:52:31][DEBUG] : Supplying headers {'Authorization-Provider': 'husqvarna', 'X-Api-Key': '16c6d714-7225-4bc6-be07-XXXXXXXX', 'Authorization': 'Bearer XXXXXXXXXXXXXXx'} and data None
[2021-07-17 13:52:31][DEBUG] : Passing through key word arguments {'allow_redirects': True}.
[2021-07-17 13:52:31][DEBUG] : Starting new HTTPS connection (1): api.smart.gardena.dev:443
[2021-07-17 13:52:31][DEBUG] : https://api.smart.gardena.dev:443 "GET /v1/locations HTTP/1.1" 401 0
[2021-07-17 13:52:31][ERROR] : Fatal error : Expecting value: line 1 column 1 (char 0)
[2021-07-17 13:52:31][INFO] : Shuting down
[2021-07-17 13:52:31][DEBUG] : Removing PID file /tmp/jeedom/gardena/deamon.pid
[2021-07-17 13:52:31][DEBUG] : Exit 0

Toute suggestion serait la bienvenue…

Merci!

Salut,

Essaye de régénérer ta clé api, en cherchant avec la même erreur sur community on trouve ce sujet :wink: :

Et attention en mode debug les logs contiennent des infos sensibles

edit: ok apparement elles avaient déjà été masquées

Oui cette fois j’ai fait attention :grinning_face_with_smiling_eyes:

Merci, j’ai dû la regénérer quelques fois mais en effet cela résout le problème! Désolé je n’avais pas trouvé cette solution lors de la recherche sur le forum.

1 « J'aime »

Ce sujet a été automatiquement fermé après 24 heures suivant le dernier commentaire. Aucune réponse n’est permise dorénavant.