iRayanKhan / homebridge-tuya

A Homebridge plugin to control Tuya devices locally.
MIT License
403 stars 167 forks source link

updates coming after several years #433

Open fate8383 opened 10 months ago

fate8383 commented 10 months ago

As it is great news but over the years I have done many modification to my local plugin install such as hide logs, new local key type, add new devices, modify devices etc... this will be completely overwritten once the update is installed. Is there any way we can collect all changes in one place and apply a one off update? I cannot be the only one made local changes over the years :) not sure how to tackle that, but great that it is being updated now.

Edit: update just got pulled off.

05TEVE commented 10 months ago

Hi @fate8383 , That was me pushing a new beta version (this can be found as 3.10-beta.2). i have since reverted the latest tag back so as to not break anyones setups. I am looking to get another release out soon though once testing is completed.

If there are any particular PRs that you think would be good to merge in first i am happy to review and publish a version fro testing.

05TEVE commented 10 months ago

Thinking further through and the changes this I am going to collate the changes on the 3.1.0 branch and merge them back into main when it is time for the main release. Please raise any PRs for fixes into this branch

So far i have included

dibsies commented 10 months ago

Not sure if this has something to do with the plugin, or if it's related to my network specifcally, but I've been noticing that after a day or so I have devices that appear to go offline in homebridge with the below error. It is usually a different Tuya light every time. The connection within homebridge is lost for unknown reasons and doesn't automatically recover without restarting homebridge. Despite being marked as offline in homebridge, these devices remain connected to the network and are still controllable through the Tuya app directly.

[22/01/2024, 08:37:08] [TuyaLan] Socket had a problem and will reconnect to Hall 1 (Error: ERR_CONNECTION_TIMED_OUT) [22/01/2024, 08:37:13] [TuyaLan] Socket had a problem and will reconnect to Hall 1 (EHOSTUNREACH) [22/01/2024, 08:37:16] [TuyaLan] Socket had a problem and will reconnect to Hall 1 (Error: ERR_CONNECTION_TIMED_OUT) [22/01/2024, 08:37:22] [TuyaLan] Socket had a problem and will reconnect to Hall 1 (EHOSTUNREACH) [22/01/2024, 08:37:24] [TuyaLan] Socket had a problem and will reconnect to Hall 1 (Error: ERR_CONNECTION_TIMED_OUT) [22/01/2024, 08:37:30] [TuyaLan] Socket had a problem and will reconnect to Hall 1 (EHOSTUNREACH) [22/01/2024, 08:37:32] [TuyaLan] Socket had a problem and will reconnect to Hall 1 (Error: ERR_CONNECTION_TIMED_OUT) [22/01/2024, 08:37:38] [TuyaLan] Socket had a problem and will reconnect to Hall 1 (EHOSTUNREACH) [22/01/2024, 08:37:40] [TuyaLan] Socket had a problem and will reconnect to Hall 1 (Error: ERR_CONNECTION_TIMED_OUT) [22/01/2024, 08:37:46] [TuyaLan] Socket had a problem and will reconnect to Hall 1 (EHOSTUNREACH) [22/01/2024, 08:37:48] [TuyaLan] Socket had a problem and will reconnect to Hall 1 (Error: ERR_CONNECTION_TIMED_OUT) [22/01/2024, 08:37:54] [TuyaLan] Socket had a problem and will reconnect to Hall 1 (EHOSTUNREACH) [22/01/2024, 08:37:57] [TuyaLan] Socket had a problem and will reconnect to Hall 1 (Error: ERR_CONNECTION_TIMED_OUT)

EddieDSuza commented 10 months ago

Please also support the 3.4 protocol :)

05TEVE commented 10 months ago

Not sure if this has something to do with the plugin, or if it's related to my network specifcally, but I've been noticing that after a day or so I have devices that appear to go offline in homebridge with the below error. It is usually a different Tuya light every time. The connection within homebridge is lost for unknown reasons and doesn't automatically recover without restarting homebridge. Despite being marked as offline in homebridge, these devices remain connected to the network and are still controllable through the Tuya app directly.

[22/01/2024, 08:37:08] [TuyaLan] Socket had a problem and will reconnect to Hall 1 (Error: ERR_CONNECTION_TIMED_OUT)

[22/01/2024, 08:37:13] [TuyaLan] Socket had a problem and will reconnect to Hall 1 (EHOSTUNREACH)

[22/01/2024, 08:37:16] [TuyaLan] Socket had a problem and will reconnect to Hall 1 (Error: ERR_CONNECTION_TIMED_OUT)

[22/01/2024, 08:37:22] [TuyaLan] Socket had a problem and will reconnect to Hall 1 (EHOSTUNREACH)

[22/01/2024, 08:37:24] [TuyaLan] Socket had a problem and will reconnect to Hall 1 (Error: ERR_CONNECTION_TIMED_OUT)

[22/01/2024, 08:37:30] [TuyaLan] Socket had a problem and will reconnect to Hall 1 (EHOSTUNREACH)

[22/01/2024, 08:37:32] [TuyaLan] Socket had a problem and will reconnect to Hall 1 (Error: ERR_CONNECTION_TIMED_OUT)

[22/01/2024, 08:37:38] [TuyaLan] Socket had a problem and will reconnect to Hall 1 (EHOSTUNREACH)

[22/01/2024, 08:37:40] [TuyaLan] Socket had a problem and will reconnect to Hall 1 (Error: ERR_CONNECTION_TIMED_OUT)

[22/01/2024, 08:37:46] [TuyaLan] Socket had a problem and will reconnect to Hall 1 (EHOSTUNREACH)

[22/01/2024, 08:37:48] [TuyaLan] Socket had a problem and will reconnect to Hall 1 (Error: ERR_CONNECTION_TIMED_OUT)

[22/01/2024, 08:37:54] [TuyaLan] Socket had a problem and will reconnect to Hall 1 (EHOSTUNREACH)

[22/01/2024, 08:37:57] [TuyaLan] Socket had a problem and will reconnect to Hall 1 (Error: ERR_CONNECTION_TIMED_OUT)

I haven't encountered this yet on my setup, however I have fixed IP addresses for all of my devices so haven't tested how it behaves when the device shifts. Let me see if I can replicate this.

05TEVE commented 10 months ago

protocol Unfortunately I don't have any 3.4 devices to test with. Is there a particular device that you are having issues with?

EddieDSuza commented 10 months ago

protocol Unfortunately I don't have any 3.4 devices to test with. Is there a particular device that you are having issues with?

Actually all of the newly released / sold devices are on the 3.4 protocol. With regards to which devices - they are the GU10 Wifi Tuya Bulbs

matheus-apolonio commented 10 months ago

Same for me, but with the 3.5 protocol :/ In my case, it's a smart RGB bulb

It's getting an "UDP error" in both latest-version and the newest beta-version:

1/23/2024, 6:30:27 PM] [homebridge-tuya] Discovery - UDP from 192.168....:6667 {random-guid}

05TEVE commented 9 months ago

So i have got my hands on a device that is using Tuya Protocol 3.5, but it may take some time to figure out the fix. I'm looking to release the 3.1.0 version early next week so that some of the bugs on existing devices Tuya Protocol 3.3 issues can be fixed.

Contributions towards a fix for the 3.4 and 3.5 would be greatly appreciated. Even if someone has a rough idea of what changes need to be done that would be an awesome start.

fate8383 commented 9 months ago

I see now update v3 is published but I see the problem like #411 mentions and I fixed it completely modifying an existing air purifier PR that I found working with mine. I am a little illiterate when it comes to making my own PR so any suggestions? If I update to v3 all my purifier settings will be gone in the plugin code.

05TEVE commented 9 months ago

I see now update v3 is published but I see the problem like #411 mentions and I fixed it completely modifying an existing air purifier PR that I found working with mine. I am a little illiterate when it comes to making my own PR so any suggestions? If I update to v3 all my purifier settings will be gone in the plugin code.

Are you able to provide details of what the changes you made are? Code snippets etc? If so i can try add these into the 3.1.1 version i am working on? :)

fate8383 commented 9 months ago

I see now update v3 is published but I see the problem like #411 mentions and I fixed it completely modifying an existing air purifier PR that I found working with mine. I am a little illiterate when it comes to making my own PR so any suggestions? If I update to v3 all my purifier settings will be gone in the plugin code.

Are you able to provide details of what the changes you made are? Code snippets etc? If so i can try add these into the 3.1.1 version i am working on? :)

I will do my best, traveling at the moment. Tomorrow earliest I can try. Thanks

tkso1997 commented 9 months ago

So i have got my hands on a device that is using Tuya Protocol 3.5, but it may take some time to figure out the fix. I'm looking to release the 3.1.0 version early next week so that some of the bugs on existing devices Tuya Protocol 3.3 issues can be fixed.

Contributions towards a fix for the 3.4 and 3.5 would be greatly appreciated. Even if someone has a rough idea of what changes need to be done that would be an awesome start.

Not entirely sure whether this could help - but I saw that tinytuya (python used in homeassistant) has support for 3.4 devices. Here is the initial commit of the 3.4 introduction: https://github.com/jasonacox/tinytuya/pull/179/commits/0c68f4b4d40c16fb82586a37afe43588116920e4

fate8383 commented 9 months ago

I see now update v3 is published but I see the problem like #411 mentions and I fixed it completely modifying an existing air purifier PR that I found working with mine. I am a little illiterate when it comes to making my own PR so any suggestions? If I update to v3 all my purifier settings will be gone in the plugin code.

Are you able to provide details of what the changes you made are? Code snippets etc? If so i can try add these into the 3.1.1 version i am working on? :)

I will do my best, traveling at the moment. Tomorrow earliest I can try. Thanks

well simply put, i failed :) i do not have any best way possible to find all changes to be added to PR. I can share the entire air purifier .js file as an atacchment, if this helps. But still this does not help for example Air purifier is not even in the UI settings of the plugin so i had to modify the config to pick the correct .js. Please let me know and sorry.

05TEVE commented 8 months ago

Hi @fate8383 , if you can attach the full file here i should be able to get it added into 3.1.1 along with the UI settings. You may have to put up with a few annoying messages testing from my side however as i don't have a device to test this properly. :)

fate8383 commented 8 months ago

AirPurifierAccessory.js.zip Hi sure, here it is, no need to test anything from my end but go ahead if need be. You will see edited parts with Siguro air purifier, and it works :)

05TEVE commented 8 months ago

Hey @fate8383, I have pushed the changes in the file as 3.1.1-beta.10. Please test an let me know if there are any issues.

If anyone else here has an existing air purifier that they can test with that would be great to ensure that there are no breaking changes here :)