Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with platform name and config.json setup #355

Open
stauffes opened this issue Jan 24, 2022 · 7 comments
Open

Issue with platform name and config.json setup #355

stauffes opened this issue Jan 24, 2022 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@stauffes
Copy link

Checklist

  • [X ] I have read the common issues wiki page
  • [X ] I have checked to make sure the plugin is up to date

Describe the bug
I am able to install the plugin on a new bridge, however, the config.json file is pre-populated with two platforms named Tuya an d TuyaLan. The UI config only displays the platform Tuya and any added devices fall underneath this platform, however when I go to run the bridge, it is not able to find any devices because it is expecting them to be under the TuyaLan platform. I have tried to install this plugin on both my Pi and a hoobs running on a virtual ubuntu with the same effect. I have had some moderate luck manually configuring the config.json, however it is often overwritten when the bridge starts again with the same issue as before. Not sure I understand why the "Tuya" platform is being populated in the config.json file or why that is what is editable in the UI.

To Reproduce
Install this plugin

Expected behavior
I would expect the config.json file to only have one platform named TuyaLan and the UI to be able to edit devices within this platform.

Environment (please complete the following information):

  • OS: Hoobs 4.1.21 running on Raspberry Pi
  • Plugin Version: 2.0.1
@stauffes stauffes added the bug Something isn't working label Jan 24, 2022
@iRayanKhan
Copy link
Owner

Will be fixed in v2.1.0, thanks for reporting!

@iRayanKhan iRayanKhan pinned this issue Feb 11, 2022
@eshventures
Copy link

I am encountering the same issue and unable to use the plug-in within Hoobs 4. It won't discover the devices. @stauffes - can you share what your work-around was in the config.json for the devices to be recognized? Thanks in advance for your help!

@eshventures
Copy link

eshventures commented Jun 12, 2022

I am encountering the same issue and unable to use the plug-in within Hoobs 4. It won't discover the devices. @stauffes - can you share what your work-around was in the config.json for the devices to be recognized? Thanks in advance for your help!

UPDATE: Played around with the code and got it working. Would be nice to see this updated in the next version though as per your comment, it will overwrite the code again on the bridge re-starting.

@davidh2075
Copy link
Contributor

Upgraded to HOOBS 4 and made the following changes to the code to get it working:

hoobs@hoobs:~ $ diff ./index_Tuya_SAVE.js /var/lib/hoobs/tuyabridge/node_modules/homebridge-tuya/index.js
27,28c27,28
< const PLUGIN_NAME = 'homebridge-tuya-lan';
< const PLATFORM_NAME = 'TuyaLan';
---
> const PLUGIN_NAME = 'homebridge-tuya';
> const PLATFORM_NAME = 'Tuya';
63c63
<     homebridge.registerPlatform(PLUGIN_NAME, PLATFORM_NAME, TuyaLan, true);
---
>     homebridge.registerPlatform(PLATFORM_NAME, TuyaLan, true);
hoobs@hoobs:~ $

05TEVE pushed a commit that referenced this issue Jan 16, 2024
…he comments in the 2.0.1 Release notes.

This will resolve Issue #355 but will be a breaking change requiring the config to be updated before restarting the homebridge.
@05TEVE
Copy link
Collaborator

05TEVE commented Feb 6, 2024

This should now be fixed as per version 3.1.0. I updated the schema so that the existing configs from the previous versions would work without changes.

@davidh2075
Copy link
Contributor

Thank you!

@davidh2075
Copy link
Contributor

I just updated to 3.1.0 on HOOBS 4 and index.js has PLATFORM_NAME as TuyaLan, not Tuya:

const OilDiffuserAccessory = require('./lib/OilDiffuserAccessory');

const PLUGIN_NAME = 'homebridge-tuya';
const PLATFORM_NAME = 'TuyaLan';

const CLASS_DEF = {

The log file showed

17/02/2024, 07:37:24 Tuya Bridge Loaded plugin 'homebridge-tuya'
17/02/2024, 07:37:24 Tuya Bridge [ DEBUG ] Registering platform 'homebridge-tuya.TuyaLan'
17/02/2024, 07:37:24 Tuya Bridge Loading 2 platforms...
17/02/2024, 07:37:24 Tuya Bridge TuyaLan No devices found. Check that you have specified them in your config.json file.

I changed TuyaLan to Tuya in index.js, restarted the Tuya bridge, and all is OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants