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

Could not find accessory in dictionary #22

Closed
bosco90 opened this issue Jun 3, 2021 · 14 comments
Closed

Could not find accessory in dictionary #22

bosco90 opened this issue Jun 3, 2021 · 14 comments

Comments

@bosco90
Copy link

bosco90 commented Jun 3, 2021

Hello,
I get the error "Could not find accessory in dictionary" for every of my 10 accessories, and the only two that shows up in HomeKit are the Bimar Air Purifier (that still doesn't work, it keep spinning) and a light that is very slow to respond.

The other accessories are 4 lights, 3 outlet and an oil diffuser.

How can I solve this?

Thanks a lot!

@Hanh94
Copy link
Contributor

Hanh94 commented Jun 3, 2021

Hi @bosco90 , Try removing homebridge-tuya-platform from node_modules and npm install homebridge-tuya-platform

@bosco90
Copy link
Author

bosco90 commented Jun 3, 2021

Thanks for the answer, this actually removed the error but devices still no appearing, now only the purifier shows up but still no working.

In the HomeBridge log the devices are listed, with properties and all but not inside HomeKit

I've noticed this in the HomeBridge log, might be helpful:

TuyaOpenAPI response: {"code":1106,"msg":"權限拒絕","success":false,"t":1622709430377} path = /v1.0/devices/6cb2c761afc1e455d3rakk/functions
TuyaOpenAPI getDeviceFunctions undefined

@Hanh94
Copy link
Contributor

Hanh94 commented Jun 3, 2021

@bosco90 ,When starting the homebridge-tuya-platform plugin service for the first time, devices need to be added to HomeKit by scanning the code or entering the PIN code. Later additions and deletions of devices will be automatically mapped to HomeKit based on MQTT.

@bosco90
Copy link
Author

bosco90 commented Jun 3, 2021

My homebridge instance is already added in the Home App as I have other plugins for non tuta related devices, I've tried to add it again as a child bridge and just a light was added

@Hanh94
Copy link
Contributor

Hanh94 commented Jun 3, 2021

@bosco90 , We have received your question, it seems that the Accessory corresponding to the Tuya device was not added to the final platformAccessories. Could you please provide the log of the Accessory object in the final platformAccessories array so that we can locate the specific issue

@Hanh94
Copy link
Contributor

Hanh94 commented Jun 3, 2021

I guess the HomeBridge 'cachedAccessories' file caches previously created tuya devices, causing the homebridge-tuya-platform plugin to get the device not be created. You can go to the ' 'Accessories' and' Persist 'directories and delete the files in them, then try to restart HomeBridge

@bosco90
Copy link
Author

bosco90 commented Jun 3, 2021

Just tried this cache thing, nothing changed.
Hopefully this is the log you requested (if not, give me some hints on how to find it):

LightAccessory statusArr. [
{ code: 'switch_led', value: false },
{ code: 'work_mode', value: 'colour' },
{ code: 'bright_value', value: 255 },
{ code: 'temp_value', value: 102 },
{ code: 'colour_data', value: '{"h":350.0,"s":255.0,"v":140.0}' },
{ code: 'scene_data', value: '{"h":37.5,"s":255.0,"v":189.0}' },
{
code: 'flash_scene_1',
value: '{"bright":255,"frequency":80,"hsv":[{"h":120.0,"s":255.0,"v":255.0}],"temperature":255}'
},
{
code: 'flash_scene_2',
value: '{"bright":255,"frequency":128,"hsv":[{"h":0.0,"s":255.0,"v":255.0},{"h":120.0,"s":255.0,"v":255.0},{"h":240.0,"s":255.0,"v":255.0},{"h":0.0,"s":0.0,"v":0.0},{"h":0.0,"s":0.0,"v":0.0},{"h":0.0,"s":0.0,"v":0.0}],"temperature":255}'
},
{
code: 'flash_scene_3',
value: '{"bright":255,"frequency":80,"hsv":[{"h":0.0,"s":255.0,"v":255.0}],"temperature":255}'
},
{
code: 'flash_scene_4',
value: '{"bright":255,"frequency":5,"hsv":[{"h":0.0,"s":255.0,"v":255.0},{"h":120.0,"s":255.0,"v":255.0},{"h":60.0,"s":255.0,"v":255.0},{"h":300.0,"s":255.0,"v":255.0},{"h":240.0,"s":255.0,"v":255.0},{"h":0.0,"s":0.0,"v":0.0}],"temperature":255}'
}
]
LightAccessory functionArr. [
{
code: 'switch_led',
desc: 'switch led',
name: 'switch led',
type: 'Boolean',
values: '{}'
},
{
code: 'bright_value',
desc: 'bright value',
name: 'bright value',
type: 'Integer',
values: '{"min":25,"scale":0,"unit":"","max":255,"step":1}'
},
{
code: 'work_mode',
desc: 'work mode',
name: 'work mode',
type: 'Enum',
values: '{"range":["white","colour"]}'
},
{
code: 'colour_data',
desc: 'colour data',
name: 'colour data',
type: 'Json',
values: '{"h":{"min":1,"scale":0,"unit":"","max":360,"step":1},"s":{"min":1,"scale":0,"unit":"","max":255,"step":1},"v":{"min":1,"scale":0,"unit":"","max":255,"step":1}}'
},
{
code: 'scene_data',
desc: 'scene data',
name: 'scene data',
type: 'Json',
values: '{"h":{"min":1,"scale":0,"unit":"","max":360,"step":1},"s":{"min":1,"scale":0,"unit":"","max":255,"step":1},"v":{"min":1,"scale":0,"unit":"","max":255,"step":1}}'
},
{
code: 'flash_scene_1',
desc: 'flash scene 1',
name: 'flash scene 1',
type: 'Json',
values: '{"h":{"min":1,"scale":0,"unit":"","max":360,"step":1},"s":{"min":1,"scale":0,"unit":"","max":255,"step":1},"v":{"min":1,"scale":0,"unit":"","max":255,"step":1}}'
},
{
code: 'flash_scene_2',
desc: 'flash scene 2',
name: 'flash scene 2',
type: 'Json',
values: '{"h":{"min":1,"scale":0,"unit":"","max":360,"step":1},"s":{"min":1,"scale":0,"unit":"","max":255,"step":1},"v":{"min":1,"scale":0,"unit":"","max":255,"step":1}}'
},
{
code: 'flash_scene_3',
desc: 'flash scene 3',
name: 'flash scene 3',
type: 'Json',
values: '{"h":{"min":1,"scale":0,"unit":"","max":360,"step":1},"s":{"min":1,"scale":0,"unit":"","max":255,"step":1},"v":{"min":1,"scale":0,"unit":"","max":255,"step":1}}'
},
{
code: 'flash_scene_4',
desc: 'flash scene 4',
name: 'flash scene 4',
type: 'Json',
values: '{"h":{"min":1,"scale":0,"unit":"","max":360,"step":1},"s":{"min":1,"scale":0,"unit":"","max":255,"step":1},"v":{"min":1,"scale":0,"unit":"","max":255,"step":1}}'
}
]
(node:662447) U

@Hanh94
Copy link
Contributor

Hanh94 commented Jun 3, 2021

Does the plugin show any errors when it starts?

@bosco90
Copy link
Author

bosco90 commented Jun 3, 2021

Nope

@Hanh94
Copy link
Contributor

Hanh94 commented Jun 3, 2021

@bosco90 , I tried to uninstall the homebridge-tuya-platform in the HomeBridge UI, then reinstall, start the subbridge service, and scan the code to make a match. Everything worked, Please try it again.

If that still doesn't work, we support dynamic logging in V1.1.4. See "Adding:..." "Register Platform Accessory...", if printed description of the device Accessory instance that has been created.

The worst way to find it is in the. HomeBridge directory, delete the files under the 'Accessories' and 'Persist' folders, remove the family on HomeKit, Restarting the HomeBridge and Subbridge services and retrying the configuration.
(note ⚠️⚠️⚠️ : this will reset the original configuration of all your devices, please proceed with caution)

@rcoletti116
Copy link
Contributor

I am having a similar problem. I have 7 active devices. 2 are not yet supported (no problem). The other 5 are supported, and the API response in logs shows success, but only 2 devices get added. They are all lightbulbs that support the same functions (Power, Brightness, Temperature). I've tried everything you have said here, but get the same behavior each time.

@Hanh94
Copy link
Contributor

Hanh94 commented Jun 4, 2021

Hi @bosco90 @rcoletti116 , sorry for the bad experience.
This seems to be [Identical devices, the company behaviors] (#24) @ rcoletti116 found that the problems are concerned, The device creation was interrupted. We will fix the problem as soon as possible.
Please provide the configuration information in config.schema.json in tickets to help us verify this issue, We will respond quickly on tickets, Thank you very much.

@Hanh94
Copy link
Contributor

Hanh94 commented Jun 4, 2021

Hi @bosco90 @rcoletti116, Thanks again for your feedback.
we have optimized the plugin in v1.1.5, please update and try again
If you encounter any problem during use, please timely feedback to us, we will respond to you in the first time and deal with it for you.

@bosco90
Copy link
Author

bosco90 commented Jun 7, 2021

Hi @Hanh94, sorry for the late follow up.
With the latest update I was able to add all the accessories in HomeKit.
Everything works fine except for the Air Purifier, it becomes unresponsive when I try to use it, I'll check other issues and in case open a new as it's a different problem.

Thanks a lot for the help so far!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants