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

Unexpected error that causes all my switches not to work #66

Closed
JQLove2023 opened this issue Nov 13, 2023 · 27 comments · Fixed by #67
Closed

Unexpected error that causes all my switches not to work #66

JQLove2023 opened this issue Nov 13, 2023 · 27 comments · Fixed by #67
Labels
bug Something isn't working

Comments

@JQLove2023
Copy link

This error originated from a custom integration.

Logger: custom_components.localtuya.common
Source: custom_components/localtuya/core/pytuya/init.py:280
Integration: LocalTuya (documentation, issues)
First occurred: 9:40:29 AM (360 occurrences)
Last logged: 9:47:42 AM

[bfa...bgw] Connect to 192.168.2.96 failed: could not decrypt data: wrong local_key? (exception: Expecting value: line 1 column 1 (char 0))
[bfb...jy3] Connect to 192.168.2.96 failed: could not decrypt data: wrong local_key? (exception: Expecting value: line 1 column 1 (char 0))
[bfb...uhe] Connect to 192.168.2.96 failed: could not decrypt data: wrong local_key? (exception: Expecting value: line 1 column 1 (char 0))
[bf8...xt2] Connect to 192.168.2.96 failed: could not decrypt data: wrong local_key? (exception: Expecting value: line 1 column 1 (char 0))
[bf7...5sb] Connect to 192.168.2.96 failed: could not decrypt data: wrong local_key? (exception: Expecting value: line 1 column 1 (char 0))

I am sorry to disturb. But suddenly I have this coming in after restarting HA. Can I know what can I do to resolve this? Thank you :)

@JQLove2023 JQLove2023 added the bug Something isn't working label Nov 13, 2023
@xZetsubou
Copy link
Owner

xZetsubou commented Nov 13, 2023

It seems localtuya fails to connect your gateway.

  1. Check you gateway IP make sure it didn't check usually localtuya update ip for you but just make sure.
  2. Check the local key of your device go you.

If everything is good and issue still happen, Reload integration then post you entry diagnostics

Downloads diagnostics

image

@JQLove2023
Copy link
Author

JQLove2023 commented Nov 13, 2023 via email

@xZetsubou
Copy link
Owner

Your reply is empty don't use email. send it through GitHub site.

@JQLove2023
Copy link
Author

JQLove2023 commented Nov 13, 2023

config_entry-localtuya--1.json
Sorry about it. Didn't know about this. Here you go. Thank you :)

@JQLove2023
Copy link
Author

but i am able to control through tuya smart app but not through home assistant. Maybe this can give you more info :)

@xZetsubou
Copy link
Owner

Please try this.

  1. Ensure the tuya smart app and smart life are closed.
  2. Can you disconnect your gateway from network then connect it again.

The issue isn't in your sub devices it's in the gateway that doesn't refuse connection.

@JQLove2023
Copy link
Author

will try now

@JQLove2023
Copy link
Author

sorry but it doesn't work :(

@JQLove2023
Copy link
Author

JQLove2023 commented Nov 13, 2023

what else can I do to fix it? Thank you! :)
home-assistant_2023-11-13T03-45-52.732Z.log
Not sure if this will help

@JQLove2023
Copy link
Author

okay, i think i will re add the hub instead. it seems to be working for some reason instead. Thanks for your time. Sorry for the trouble :)

@xZetsubou
Copy link
Owner

I was looking what might can cause this it still not obvious. the logs reporting it might be local key but from diagnostics the localkey key seems fine so I assume it the ip? I'm doing tests on my ZigBee devices to see what can cause this ^^

@JQLove2023
Copy link
Author

I have place static internal IP on my gateway. The IP doesn't change. But when i re setup everything, it is working.. hopefully it will not re occur again. if you need any information, pls let me know, i will provide and hopefully you can find the solution too :) Thanks alot!

@xZetsubou
Copy link
Owner

So is it working now? what did you re-setup the integration or devices to gateway?

@JQLove2023
Copy link
Author

I re-setup the integration. I delete the whole hub in localtuya and re add. After which, I have to re setup every device.. haha

@JQLove2023
Copy link
Author

image
Delete the whole hub through the option

@JQLove2023
Copy link
Author

then i re add everything then it works

@xZetsubou
Copy link
Owner

Can you redownload the diagnostics again #66 (comment) I want to see if something changed :)

@JQLove2023
Copy link
Author

JQLove2023 commented Nov 13, 2023

@xZetsubou
Copy link
Owner

xZetsubou commented Nov 13, 2023

I assumed if you removed your 1st device which integration used as gateway it would've fixed it. but I did make some changes to report if gateway not usable. well I hope it won't show up!.

if the issue appear again feel free to open issue :D

@xZetsubou
Copy link
Owner

Never mind I finally caught it,

@xZetsubou xZetsubou reopened this Nov 13, 2023
xZetsubou added a commit that referenced this issue Nov 13, 2023
* ensure gateway is connedted if we use it.

* Handle fake_gateway if nodeID Not found. handle other errors

* core: don't switch to `type_0d` if version >= 3.4

* abort connect if unkown error happen

* Handle dc'd sub devices should resolve #66

* Handle dc'd sub devices should resolve #66
@JQLove2023
Copy link
Author

I'm sorry. I don't get it. May I know if I need to do anything on my end?

@xZetsubou
Copy link
Owner

xZetsubou commented Nov 13, 2023

No it's fine I think it should be fixed on next update 3.2.1 ^^, thanks for reporting this bug :)

@JQLove2023
Copy link
Author

Welcome. Pls let me know when you can upload the updated version. Thank you :)

@JQLove2023
Copy link
Author

Can I check if i should re update my localtuya to 3.2.0 or master so the issue above will not occur again? Thank you :)

@xZetsubou
Copy link
Owner

xZetsubou commented Nov 15, 2023

I will release 3.2.1 today, HACS should notify you. you can install master but I don't recommend it as HACS will notify you to update on every little the changes of master even if it's break changes.

@xZetsubou
Copy link
Owner

hey, 3.2.1 released. I hope this issue don't show up again :)

@JQLove2023
Copy link
Author

Thanks alot! 😇

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

Successfully merging a pull request may close this issue.

2 participants