Prises en charge des devices avec l'application Smartlife/tuya

Cool :slight_smile: Merci d’avoir re-testé !

@Lokkye tu me tiens au courant dès que les reviews de PR sont bons pour que je re-review :wink:

bonjour @Lokkye
j’arrive peut etre un peu tard, mais pour moi mes trois devices Tuya fonctionnent correctement en on/off.


un bandeau led couleur autour de la TV
une ampoule couleur
et un interrupteur mural on/off
J’ai des volets roulants avec des inters 3e et 4e generation, mais j’ai vu que ce n’est pas pris en charge , ni la couleur des lampes.
Pour info je gere tout ça par Node red
Merci pour ton travail et la clarté de la doc pour ouvrir le compte Tuya et si je peux aidé pour les futurs tests, ce sera avec plaisir
:wink:

C’est jamais trop tard pour les tests, merci :slight_smile:

Pour les volets, je n’ai pas fais l’integration mais si tu m’envoie les logs de gladys lorsque tu click sur « scanner », je devrais pouvoir les rajouter facilement.

Pour la couleur, c’est bizarre car j’ai une ampoule de couleur et cela fonctionne bien chez moi. Est ce que tu pourrais supprimer le device et m’envoyer les log lorsque tu scanne les devices.

bonjour @Lokkye
voici les logs apres avoir lancer un scan,

2023-07-03T10:33:35+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "flash_scene_4" code is not managed
2023-07-03T10:33:35+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:33:35+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "work_mode" code is not managed
2023-07-03T10:33:35+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "colour_data" code is not managed
2023-07-03T10:33:35+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "scene_data" code is not managed
2023-07-03T10:33:35+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "countdown" code is not managed
2023-07-03T10:33:35+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control_data" code is not managed
2023-07-03T10:33:35+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:33:35+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:33:35+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:33:35+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "percent_control" code is not managed
2023-07-03T10:33:35+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "cur_calibration" code is not managed
2023-07-03T10:33:35+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control_back_mode" code is not managed
2023-07-03T10:33:35+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "tr_timecon" code is not managed
2023-07-03T10:33:35+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:33:35+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "percent_control" code is not managed
2023-07-03T10:33:35+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "cur_calibration" code is not managed
2023-07-03T10:33:35+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control_back_mode" code is not managed
2023-07-03T10:33:35+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "tr_timecon" code is not managed
2023-07-03T10:33:35+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:33:35+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:33:35+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "countdown_1" code is not managed
2023-07-03T10:33:35+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "tr_timecon" code is not managed
2023-07-03T10:33:35+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed

j’ai tapé dans la commande " docker logs gladys-test-tuya ", je ne sais pas si c’etait ce que tu voulais?

voila les logs apres avoir supprimé la smart led couleur et le bandeau led couleur

2023-07-03T10:43:22+0200 <info> tuya.discoverDevices.js:36 (TuyaHandler.discoverDevices) 11 Tuya devices found
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "work_mode" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "bright_value" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "temp_value" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "colour_data" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "scene_data" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "flash_scene_1" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "flash_scene_2" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "flash_scene_3" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "flash_scene_4" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "work_mode" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "colour_data" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "scene_data" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "countdown" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control_data" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "percent_control" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "cur_calibration" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control_back_mode" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "tr_timecon" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "percent_control" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "cur_calibration" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control_back_mode" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "tr_timecon" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "countdown_1" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "tr_timecon" code is not managed
2023-07-03T10:43:24+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:43:29+0200 <info> device.destroy.js:62 (DeviceManager.destroy) Deleting device tuya-bffe51721bd393b51cq9pr, device has 15 states in DB
2023-07-03T10:43:37+0200 <info> tuya.discoverDevices.js:36 (TuyaHandler.discoverDevices) 11 Tuya devices found
2023-07-03T10:43:37+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "work_mode" code is not managed
2023-07-03T10:43:37+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "bright_value" code is not managed
2023-07-03T10:43:37+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "temp_value" code is not managed
2023-07-03T10:43:37+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "colour_data" code is not managed
2023-07-03T10:43:37+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "scene_data" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "flash_scene_1" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "flash_scene_2" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "flash_scene_3" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "flash_scene_4" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "work_mode" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "colour_data" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "scene_data" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "countdown" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control_data" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "percent_control" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "cur_calibration" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control_back_mode" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "tr_timecon" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "percent_control" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "cur_calibration" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control_back_mode" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "tr_timecon" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "countdown_1" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "tr_timecon" code is not managed
2023-07-03T10:43:38+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:43:45+0200 <info> tuya.discoverDevices.js:36 (TuyaHandler.discoverDevices) 11 Tuya devices found
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "work_mode" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "bright_value" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "temp_value" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "colour_data" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "scene_data" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "flash_scene_1" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "flash_scene_2" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "flash_scene_3" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "flash_scene_4" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "work_mode" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "colour_data" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "scene_data" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "countdown" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control_data" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "percent_control" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "cur_calibration" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control_back_mode" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "tr_timecon" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "percent_control" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "cur_calibration" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control_back_mode" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "tr_timecon" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "countdown_1" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "tr_timecon" code is not managed
2023-07-03T10:43:46+0200 <warn> tuya.convertFeature.js:17 (convertFeature) Tuya function with "control" code is not managed

Salut @Lokkye !

Comme je disais dans le chat j’ai enfin pu récupérer un appareil Tuya en passant chez Action ce week-end :smiley:

J’ai trouvé une prise connectée LSC Smart Connect à 8,99€, ça vaut le coup !

La prise est plutôt compacte, et design :

J’installe l’app Tuya, et je créé un compte, puis je clique sur « ajouter un appareil »:

J’appuie 5 secondes sur le bouton de la prise pour la réinitialiser :

La prise Tuya devient visible :

Je rentre le mot de passe Wi-Fi :

La prise est connectée avec succès :

Je la renomme pour mettre un nom plus clair :

La prise devient contrôlable en un clic :

Côté Gladys, après configuration du compte développeur Tuya, je vois bien ma prise :

Et je peux la contrôler depuis le tableau de bord :

@Lokkye Pour moi c’est un carton plein :smiley: Bien joué :clap:

Avant d’ajouter d’autres appareils, pour moi la première étape serait de faire une première release de cette version qui fonctionne déjà super :slight_smile: Est-ce que côté documentation tu es bon ? Et est-ce que la PR est prête ?

2 « J'aime »

Du coup j’ai hâte !

1 « J'aime »

Merci, c’est cool que tu n’ai pas eu de problème.
Ben la doc est dans ce post donc je pense que je devrais la mettre autre par mais je ne sais pas ou.
La PR est prête, je viens de coder les derniers retours que tu avais fait.

Bonjour, @Lokkye
tu as pu voir, pourquoi les fonctions couleur n’apparaissent pas sur mes lampes ?

Oui, je vois bien le problème. Pour le moment, je n’ai pas géré toutes les features des objets connectés.
Je viens de le faire dans la PR pour tes lampes.
Mais comme dit @pierre-gilles, on pourra facilement les rajouter après cette première étape.
Je suis en train de rebuild une image docker avec les derniers changements.

Super, beau travail :+1:
j’attends pour tester alors

Je veux bien que tu fasses une PR sur la documentation :slight_smile:

La documentation est open-source:

Exemple d’une PR pour ajouter la documentation d’une nouvelle intégration:

Je regarde ça et je te fais un retour

@Lokkye J’ai fais une review de la PR : Tuya Integration by callemand · Pull Request #1788 · GladysAssistant/Gladys · GitHub

Rien de très sérieux, c’est une belle PR :clap: Bravo pour ce super taff !

Je pense du coup il manque 2 choses :

  • La PR pour la documentation (tu peux très largement réutiliser celle que tu as faites sur le forum)
  • Les quelques fix de la review. Une fois la documentation faites, tu peux limite aussi l’ajouter en lien sur le côté comme on fait dans d’autres intégrations :

Une fois que c’est prêt, dis moi et je ferais un test final et si c’est bon je merge en prod !

Pour la suite de l’intégration, si jamais tu as besoin d’autres matériels @Lokkye, n’hésite pas, je t’envoie du matériel avec plaisir comme la première fois :slight_smile:

Beau boulot :clap:

Je viens de faire la PR pour la documentation :

Je viens de push la correction des retours sur la PR et je viens de rajouter le tab pour la documentation

Une nouvelle image docker sera prête dans environ 1h (delogzway/gladys:tuya)

1 « J'aime »

Pour la documentation c’est bon pour moi !

Par contre le lien sur le côté cause un crash du front chez moi :

Attention que user soit bien defined quand tu appel ce component :slight_smile:

Autre remarque par rapport au « componentWillReceiveProps »:

C’est le même souci que l’autre PR, le risque ici c’est que si les props sont mise à jour (sans que forcément le device change), ça reset complètement le device dans le state ( Après, dans ce cas là, c’est peut-être pas un souci, je veux juste être sûr que tu es conscient du comportement ) :slight_smile:

Oui j’avais oublié juste pour le setup :frowning: J’ai fais le fix sur la PR.

Normalement, sur ce cas là, il ne devrais pas y avoir de problème. (Mais je suis pas fan de la solution, je vais voir si avec un useEffect binder sur les changements de la props « device ». je le ferais dans un second temps)

1 « J'aime »

Je pense que c’est bon comme ça pour ce component, pas la peine de changer :slight_smile:

useEffect je suis pas très pour, les hooks react c’est vraiment un nid à bug je trouve :smile:

Merci pour les correctifs @Lokkye, c’est bon pour moi !! :partying_face:

Je viens de merger l’intégration sur master, qui partira dans la prochaine version de Gladys :clap: :clap: :clap:

1 « J'aime »

Disponible dans Gladys Assistant 4.26 :

Je ferme ce sujet, n’hésitez pas à créer un autre sujet pour les prochaines évolutions :sunglasses:

4 « J'aime »