hoobs-org / HOOBS

Build your Smart Home with HOOBS. Connect over 2,000 Accessories to your favorite Ecosystem.
https://hoobs.org
GNU General Public License v3.0
551 stars 51 forks source link

Samsung Token Problem #1790

Closed Stewart06 closed 2 years ago

Stewart06 commented 2 years ago

Samsung Token Problem

Bonjour,

Je reviens vers vous pour le problème avec le plugin Samsung Tizen.

J’ai essayé plusieurs manipulations et autres, mais rien ne fonctionne.

A chaque fois que je redémarre le plugins mes téléviseurs me demande l’autorisation afin de récupérer le jeton.

Voici une piste :

https://github.com/tavicu/homebridge-samsung-tizen/issues/455

Hello,

I come back to you for the problem with the Samsung Tizen plugin.

I have tried several manipulations and such, but nothing works.

Every time I restart the plugins my televisions ask me for permission to retrieve the token.

Here is a lead:

https://github.com/tavicu/homebridge-samsung-tizen/issues/455

tavicu commented 2 years ago

Hi, I have took a look and it appears HOOBS is changing the folders structure that are default in Homebridge.

I am using the function cachedAccessoryPath() which gets the Storage path then add the folder accessories to the path.

The homebridge structure it's like this: homebridge/accessories

homebridge (in this case this is the Storage folder)
├── accessories
│   ├── cachedAccessories
├── persist
├── node_modules
├── package.json
├── package-lock.json 
└── config.json

HOOBS on the other hand instead of creating the accessories folder under the storage folder, it creates another folder on the same lever as the Storage folder.

hoobs
├── samsungtizenbridge (In this case this is the Storage folder)
│   ├── cache
│   ├── node_modules
│   ├── config.json
│   ├── package.json
├── samsungtizenbridge.accessories
│   ├── cachedAccessories
├── samsungtizenbridge.persist
├── bridges.conf
└── hub.conf

Now the cachedAccessoryPath() will get the Storage folder path then add accessories resulting hoobs/samsungtizenbridge/accessories/ which is wrong cause the actual folder is hoobs/samsungtizenbridge.accessories

The problem is that the plugin is trying to access or create (if it's not existing) the json file where to save the info. But the function only creates the file. So the plugin tries to create the file samsunt-tizen.json under the hoobs/samsungtizenbridge/accessories/ and the problem is that the folder accessories doesn't exists and it's failing to create the file.

I have found a workaround to create the accessories folder first if it doesn't exists which will solve the problem with HOOBS.

But i think the developers of HOOBS should also fix their problem and return the correct path with cachedAccessoryPath() function.

Stewart06 commented 2 years ago

Oui je suis d'accord avec vous que les développeurs de HOOBS devrais régler le problème, mais malheureusement j'ai bon créer des problèmes, mais personne ne répond. J'avais bien compris que le problème venait du chemin d'accès du fichier de config qui n'a pas été créé ou trouvé.

Que puis-je faire concrètement ? Je dois moi créer un dossier ? Je ne suis pas développeur donc mes compétences sont tout de même limitées.

Yes I agree with you that the developers of HOOBS should fix the problem, but unfortunately I have created problems, but no one answers. I had understood that the problem came from the path of the config file which was not created or found.

What can I actually do? Do I have to create a folder? I'm not a developer so my skills are still limited.

tavicu commented 2 years ago

What can I actually do? Do I have to create a folder? I'm not a developer so my skills are still limited.

Wait until tonight :) i will push a fix for my plugin in a few hours!

Stewart06 commented 2 years ago

Ok super merci pour le travail.

Pouvez-vous me dire si cela risque de réinitialiser les accessoires et donc supprimer mes automatisations créées sur HomeKit, car cela est vraiment désagréable à chaque fois.

Ok great thanks for the work.

Can you tell me if this may reset the accessories and therefore delete my automations created on HomeKit, because it is really unpleasant every time.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.