AMoo-Miki / homebridge-tuya-lan

Homebridge plugin for IoT devices that use Tuya Smart's platform
MIT License
200 stars 51 forks source link

Teckin Smart Plug SP27 #70

Open Dweller opened 5 years ago

Dweller commented 5 years ago

tuya-cli didn't work for me.. So I used Charles to get the id's and key's..

I can connect/control to the device using codetheweb/tuyapi so I'm happy that they are correct and if I use the homebrige-tuya plugin (and update TuyaPlatform as its deprecated) I can add the accessory and control it via HomeKit commands.

However with homebridge-tuya-lan

tuya-list returns {}, and TuyaLan outputs:- [08/07/2019, 10:41:23] [TuyaLan] Starting discovery... [08/07/2019, 10:41:23] Homebridge is running on port 51826. [TuyaAccessory] Discovery started. [08/07/2019, 10:42:23] [TuyaLan] Failed to discover Lamp () in time but will keep looking.

If I include the IP address it does the same

Anything I can do to help?

heathyboyj commented 5 years ago

I am also having this issue; times out after 60 seconds with the same above messages, with the device id written within the parentheses. I got the ID's using tuya-cli (had issues with the app specified in the readme; appears they've patched it to not print out the ID's and Keys when the refresh fails, so I had to use the CE Smart app instead) - have got four of these sockets sitting around waiting to be used!

Any help with this would be much appreciated.

TheHomekitWayFinder commented 5 years ago

This is due some changes in the Tuya api that codetheweb has patched in his API repository however AMoo-Miki hasn’t been online in ages and therefore hasn’t got round to updating this plugin to support the new version of the API. Note that the Homebridge-Tuya plugin is created by CodeTheWeb and was depreciated however that plugin is up to date with the version of the Tuya API as the Tuyapi repository is made by the same person. Also note that while Homebridge-Tuya is working it doesn’t support nearly as many device types, for example, I have a Kogan SmarterHome Air Conditioner but I can’t add that to the Homebridge-Tuya plugin because it doesn’t support Air Conditioners where as this plugin does but nothing works at the moment due to it not being updated. Hopefully AMoo-Miki will be back soon and will update the plugin to work with the latest version of Tuya software by using the updated TuyApi.

TharuMCD commented 5 years ago

Thanks - that is really helpful. Hopefully the creator will indeed return soon to update. Will be wonderful if I can get these working on Homebridge.

TheHomekitWayFinder commented 5 years ago

If you want you can try homebridge-tuya as supports simple outlets

heathyboyj commented 5 years ago

I did try that, but had no joy. Luckily I like a challenge - have forked the repo and will have a play around tomorrow, see if I can get it working myself!

heathyboyj commented 5 years ago

Quick update - I actually made homebridge-tuya work. After digging around, all I had to do was include "version": 3.3 into each socket's device entry within the platform. Not sure why that's not in the readme doc, or if that's a proper fix, but hey, my sockets work now :D

TharuMCD commented 5 years ago

You are a genius! Worked for me as well despite my firmware being 1.0.1.

Thanks again for helping me sort this out.

Kind regards, Michael.

On 23 Jul 2019, at 02:27, James Heath notifications@github.com<mailto:notifications@github.com> wrote:

Quick update - I actually made homebridge-tuya work. After digging around, all I had to do was include "version": 3.3 into each socket's device entry within the platform. Not sure why that's not in the readme doc, or if that's a proper fix, but hey, my sockets work now :D

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAMoo-Miki%2Fhomebridge-tuya-lan%2Fissues%2F70%3Femail_source%3Dnotifications%26email_token%3DAJGOLZ22CNPBNS3NBLPFO6LQAZNBVA5CNFSM4H62EPP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2RUJ6A%23issuecomment-514016504&data=02%7C01%7C%7Cbb8803e756814d4e0dd308d70f0cfcd4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636994420756099352&sdata=IBQ7eUbHD9p%2FBgwCCzLDSokBjgNgqiPUQtTkHCoYCcA%3D&reserved=0, or mute the threadhttps://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAJGOLZ3Z2WYSWKBG6UFUMXTQAZNBVANCNFSM4H62EPPQ&data=02%7C01%7C%7Cbb8803e756814d4e0dd308d70f0cfcd4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636994420756109360&sdata=L9g2%2FtvwI56cbVKiAcCW%2BnCLTP38ed6tDQg6SfbAdp8%3D&reserved=0.

AMoo-Miki commented 5 years ago

@Dweller I have a feeling your device is using an alternate port for responding to the discoveries over an encrypted channel. Without having a device that behaves this way, I will look around to see what others have done to solve this.

@heathyboyj and @TharuMCD does adding "version": "3.3" solve a similar problem with this plugin too? If yes, was the problem with discovery or communication?

heathyboyj commented 5 years ago

It was a while ago, but I believe the problem was with communication. That said, I had problems still with it losing my configuration every other week (think it was during an automatic update or something on a Sunday night) so I switched to https://github.com/basdelfos/homebridge-tuya-web instead which worked first time.

TharuMCD commented 4 years ago

Dear Miki,

Using version 3.3 in the config file worked for me. However, it has made my whole HomeBridge setup a little unstable and it will frequently close itself down – I assume from a crash. Usually happens every 3-4 days, and I know it happens because the garage door suddenly can’t be controlled by Siri! Not sure if or when the newer Tuya plug-in will be made compatible, but neither have I checked yet. The original problem was with discovery.

Kind regards, Michael.

From: Miki notifications@github.com Reply to: AMoo-Miki/homebridge-tuya-lan reply@reply.github.com Date: Wednesday, 4 September 2019 at 08:47 To: AMoo-Miki/homebridge-tuya-lan homebridge-tuya-lan@noreply.github.com Cc: Michael David Tharu@msn.com, Mention mention@noreply.github.com Subject: Re: [AMoo-Miki/homebridge-tuya-lan] Teckin Smart Plug SP27 (#70)

@Dwellerhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FDweller&data=02%7C01%7C%7C9ccf06b854794bace66c08d7310c193b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637031800334284969&sdata=Fckpixjx8upDXYvQpddYLYClJe2d%2FpLUnUcV8Z2NdJk%3D&reserved=0 I have a feeling your device is using an alternate port for responding to the discoveries over an encrypted channel. Without having a device that behaves this way, I will look around to see what others have done to solve this.

@heathyboyjhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fheathyboyj&data=02%7C01%7C%7C9ccf06b854794bace66c08d7310c193b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637031800334284969&sdata=Y4VgeZKFkoMAC%2FoeHe9ifMysndA0oZLXIDkntBH6liw%3D&reserved=0 and @TharuMCDhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FTharuMCD&data=02%7C01%7C%7C9ccf06b854794bace66c08d7310c193b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637031800334294974&sdata=PncPfu63An99sYP7%2FsHP3tVA0XrN%2FthOodB94pA1eoQ%3D&reserved=0 does adding "version": "3.3" solve a similar problem with this plugin too? If yes, was the problem with discovery or communication?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAMoo-Miki%2Fhomebridge-tuya-lan%2Fissues%2F70%3Femail_source%3Dnotifications%26email_token%3DAJGOLZYMGRQ42WWUEQJUSO3QH5RYBA5CNFSM4H62EPP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD52VZLQ%23issuecomment-527785134&data=02%7C01%7C%7C9ccf06b854794bace66c08d7310c193b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637031800334294974&sdata=jyHvraecdMB3%2FBb66e%2BrRaRvtpc4SnQInPnAwqQ%2BGHU%3D&reserved=0, or mute the threadhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAJGOLZZ5O3GBOK7FVHS76X3QH5RYBANCNFSM4H62EPPQ&data=02%7C01%7C%7C9ccf06b854794bace66c08d7310c193b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637031800334304979&sdata=4gJguk0Kzh2JOX4zodl0Idz2b0rNbvFI8%2FaVnQSak%2FA%3D&reserved=0.

9SL9 commented 4 years ago

I have just reinstalled my home bridge from scratch and it has been very stable. When I saw there were some updates I decided to test them out, but immediately saw a performance hit and my home bridge shutting down. Not sure what is going on. I've had to uninstall tuya-lan so I can keep my home bridge up. Glad to see the project getting updates though :)

AMoo-Miki commented 4 years ago

Please give the latest rc release a shot by doing npm i -g homebridge-tuya-lan@rc. It includes logic to understand this newer API.

A known issue is that the current state is not reported by some devices; they however work fine as soon as you interact with them. I have reached out to Tuya for a solution.

The Setup Instructions have changed in case you need to obtain a fresh id and key.

@9SL9 was there anything in the logs to indicate abnormal activity?