Git Product home page Git Product logo

tuya-homebridge's Introduction

Tuya Homebridge Plugin


npm npm verified-by-homebridge

GitHub watchers GitHub stars GitHub forks

If you like Tuya Homebridge Plugin - give it a star, or fork it and contribute!

Homebridge custom plugin for controlling Powered by Tuya (PBT) devices in HomeKit, it's based on Tuya Open API. The plugin is officially maintained by the Tuya Developer Team.

✌️✌️✌️ Supported Tuya Device Types ✌️✌️✌️

🎉 🎉 🎉 Vote for Tuya Homebridge Plugin New Device Driver Support! 🎉🎉🎉

Welcome to join the Tuya Beta Test Program to get your development gifts and make the contribution to the plugin.Your feedback is valuable to the whole community.

Important Note

If you cannot login successfully, please update to v1.5.0 as the previous version has security issues on the login feature of the plugin.

Youtube Tutorial:

Youtube

Preparation

  1. Tuya IoT Platform Configuration
  2. Use the Tuya Homebridge Plugin
  3. Develop a New Driver
  4. How to Get Logs

Set up the development environment

—-VSCode
—-engines
    "node": “>=0.12.0”
    "homebridge": ">=0.2.0"
—-dependencies
    "axios": “^0.21.1",
    "crypto-js": “^4.0.0”, 
    "mqtt": “^4.2.6",
    "uuid": "^8.3.2"

Tuya OpenApi Login Error Code

Error code Error message Troubleshooting
1004 sign invalid
  • Incorrect accessId or accessKey. To fix the error, see Edit config.json file.
  • Due to the new signature verification mode, the server will have the cache of the old mode. Please create a Github Issue to inform us.
1106 permission deny
  • Your app account is not linked with your cloud project: Link devices by using the Tuya Smart or Smart Life app with your cloud project on the Tuya IoT Platform. For more information, see Link devices by app account.
  • The TuyaSmart or SmartLife app account which registered using Google or Apple ID email need to link your phone number and use the linked phone number as username to login.
  • Incorrect username or password: Enter the correct account and password of the Tuya Smart or Smart Life app in the Account and Password fields. Note that the app account must be the one you used to link devices with your cloud project on the Tuya IoT Platform.
  • Incorrect endpoint: See Endpoint and enter the correct endpoint.
  • Incorrect countryCode: Enter the code of the country you select on logging in to the Tuya Smart or Smart Life app.
  • Incorrect schema (case insensitive). Currently only tuyaSmart and smartlife are supported.
1100 param is empty username or appSchema is empty: See Edit config.json file and enter the correct parameter.
2017 schema does not exist Incorrect appSchema in config.json: See Edit config.json file and enter the correct parameter.
2406 skill id invalid
  • Make sure you use the Tuya Smart or SmartLife app account to log in. Also, choose the right data center endpoint related to your country region. For more details, please check Countries/Regions and Data Center.
  • Your cloud project on the Tuya IoT Development Platform should be created after May 25, 2021. Otherwise, you need to create a new project.
28841105 No permissions. This project is not authorized to call this API You have not authorized your cloud project to use the required APIs. Subscribe to the following required API products and authorize your project to use them.
  • Authorization
  • Smart Home Devices Management
  • Smart Home Family Management
  • Smart Home Scene Linkage
  • Smart Home Data Service
  • Device Status Notification

Users

If you are a smart home geek and have a bundle of devices from different platforms, this step-by-step tutorial will help you make devices HomeKit-enabled and then develop Tuya Homebridge plugins.

Feedback

You can use the GitHub Issue or tickets to provide feedback on any problems you encounter.

Beta version

Tuya plugin for Hombridge, maintained by @0x5e, former employee of Tuya.

LICENSE

For more information, see the LICENSE file.

tuya-homebridge's People

Contributors

0x5e avatar coral-hu avatar gitoleo avatar hanh94 avatar hugo-tuya avatar o485 avatar rcoletti116 avatar slavvka avatar tuya-qiufeng avatar vigokrumins avatar zlinoliver avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tuya-homebridge's Issues

Power Strip won't appear in Home app

Hi,
as briefly said in #2 the power strip doesn't appear in the Home app.

The logs says the following for both of them:

Adding: Presa bagno (pc / 6715286024a160171693)

and for the same productKey, in the "TuyaOpenMQ" section, it says "Could not find accessory in dictionary" multiple times.
Maybe they were added as a wrong type?

Thanks.

Error

Hi , I am getting below error on the HomeBridge panel after I ınstalled.

Do you have any idea regarding this error ?

Thank you in advance.

(node:4376) UnhandledPromiseRejectionWarning: Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: 76caae69-66bf-4778-b609-da43e9c0a1ab at Bridge.Accessory.addBridgedAccessory (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:564:15) at Bridge.Accessory.addBridgedAccessories (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:593:12) at BridgeService.handleRegisterPlatformAccessories (/usr/local/lib/node_modules/homebridge/src/bridgeService.ts:382:17) at HomebridgeAPI.emit (events.js:315:20) at HomebridgeAPI.registerPlatformAccessories (/usr/local/lib/node_modules/homebridge/src/api.ts:340:10) at TuyaPlatform.registerPlatformAccessory (/usr/local/lib/node_modules/homebridge-tuya-platform/index.js:199:14) at new BaseAccessory (/usr/local/lib/node_modules/homebridge-tuya-platform/lib/base_accessory.js:50:21) at new SwitchAccessory (/usr/local/lib/node_modules/homebridge-tuya-platform/lib/switch_accessory.js:11:5) at TuyaPlatform.addAccessory (/usr/local/lib/node_modules/homebridge-tuya-platform/index.js:139:27) at TuyaPlatform.initTuyaSDK (/usr/local/lib/node_modules/homebridge-tuya-platform/index.js:96:12) (Use node --trace-warnings ...to show where the warning was created) (node:4376) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag--unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:4376) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Error: connect ECONNREFUSED

Any tips on getting past this error?

config:

...,
{
    "platform": "TuyaPlatform",
    "name": "TuyaPlatform",
    "options": {
        "username": "myemailaddress",
        "password": "mypassword",
        "accessId": "myaccessid",
        "accessKey": "myaccesskey",
        "lang": "en",
        "endpoint": "https://openapi.tuyaus.com"
    }
},
...

These credentials (username, password, accessId, and accessKey) were created for the Tuya IoT Platform and all work with tuya-cli provided by @tuyapi/cli. Password has special characters, but is wrapped with quotes.

error message:

...
(node:1055) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:80
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1055) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:1055) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Add support for Ir smart remotes

So ive searched almost everywhere on the internet and could not find a plugin to use my tuya ir remote with homebridge. Of course there are Bestcon or broadlink devices but I would like to know if there is any possibility of adding tuya smart universal remote to homebridge via this plugin.
Thanks

Smart plug exposed as Switch_1 to Homekit

Is there a way to use a more meaningful name for the devices?

My smart Wi-Fi plug has two channels, I get only power switch/relay exposed to homekit. "countdown_1" is not exposed perhaps due to unsupported type in homekit.

The problem is switch is named as "switch_1". Is there a way to name it more user friendly way?

Also if I install another plug, is it going have the same name?

Third problem, Siri doesn't know what "switch one" is he says "sorry I wasn't able to do that"

Nothing shows in the logs as expected.

I should be able to do this in the project
It is not possible to edit the assigned name. May be, in the device details form, another attribute "user assinged name" which defaults to system specified name and can be changed to any other name needed.

P.S. Same plug gets exposed to Alexa as "Man Cave" and I can control it without any issues.

Please see the screen shot attached

Tuya1

Device not showing in the Homebridge and Home app

I've been using HomeBridge mainly to expose the OpenHAB devices to Home app for a while now.

I now have a Tuya device which cannot be flashed with Tasmota (my preferred method) I have started using this plug-in.

I now have a project in the IoT platform, with "Device status notification" API. Linked my device and it is showing as on-line, as in the attached picture. However, I cannot see anything in the HomeBridge. I can only control this device with Tuya Smart app on my iPhone. Obviously device doesn't show on Home app either.

I am very new at you IoT developer portal and may be I am missing something.

  1. I'd like to delete the projects I have and start over and I was unable to do
  2. how can view the logs? to debug what is going on
  3. Do I need to setup an MQTT access for this to work? If so, I need help with setting up the parameters

Thank you

Tuya1

Tuya Smart LED Strip Controller "error from the characteristic"

Hi,

Turning this LED strip controller on/off works fine but there is no brightness slider and trying to change colours in the Home app produce errors in the Homebridge log:

[homebridge-tuya-platform] This plugin threw an error from the characteristic 'Hue': Unhandled error thrown inside write handler for characteristic: Cannot read property 'max' of undefined. See https://git.io/JtMGR for more info.

and this at startup:

[homebridge-tuya-platform] This plugin threw an error from the characteristic 'Hue': Unhandled error thrown inside write handler for characteristic: Cannot read property 'max' of undefined. See https://git.io/JtMGR for more info.

Plugin not displaying Outlet names in Homekit

I have the issue where most of my devices are just displaying as switch_1 in the Apple Home app.

IMG_1763

They are however named in the Tuya App and appear correctly on the IoT. I can see that the Tuya Plugin is aware of the name of the device, but displays it as switch_1

It appears that the bulbs I use appear to populate their names correctly but none of the outlets or switches do.

LOG EXAMPLE FOR AN ACCESSORY DISPLAYING AS SWITCH_1

"model":"MK11","name":"Immersion Heater","online":true,"owner_id":"489372","product_id":"qCY4YFq02AP0i1Uu","product_name":"海贝通用定时器MK11","status":[{"code":"switch_1","value":false},{"code":"countdown_1","value":0}],"sub":false,"time_zone":"+01:00","uid":"eu1510862576411uv6Ld","update_time":1624098269,"uuid":"02200434dc4f221a50ed"},

Adding: Immersion Heater (cz / 02200434dc4f221a50ed) Existing Accessory found Immersion Heater 02200434dc4f221a50ed 5c27c49f-377a-4309-9413-bf521d06453c

Heaters not working

I have 3 Kogan heaters that I have connected to my Tuya account which are grabbed successfully by this plugin, however all their temperatures show as 0 degrees and can't be controlled at all.

Screen Shot 2021-06-03 at 7 16 33 pm

Screen Shot 2021-06-03 at 7 17 01 pm

Cannot read property 'sigBytes' of undefined

Homebridge shows the following error at startup:

[4/30/2021, 4:20:47 PM] Homebridge v1.3.4 (TuyaPlatform) is running on port 46922.
(node:5719) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'sigBytes' of undefined
at new init (/usr/local/lib/node_modules/homebridge-tuya-platform/node_modules/crypto-js/hmac.js:53:22)
at Object.HmacSHA256 (/usr/local/lib/node_modules/homebridge-tuya-platform/node_modules/crypto-js/core.js:781:25)
at TuyaOpenAPI._getSign (/usr/local/lib/node_modules/homebridge-tuya-platform/lib/tuyaopenapi.js:196:23)
at TuyaOpenAPI.request (/usr/local/lib/node_modules/homebridge-tuya-platform/lib/tuyaopenapi.js:162:20)
(Use node --trace-warnings ... to show where the warning was created)
(node:5719) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:5719) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

What can be the cause?

This is in the configuration file of Homebridge:

    {
        "platform": "TuyaPlatform",
        "name": "TuyaPlatform",
        "options": {
            "username": "[email protected]",
            "password": "mypasswordatiot",
            "accessid": "myaccessid",
            "accesskey": "myaccesskey",
            "lang": "en",
            "endPoint": "https://openapi.tuyaeu.com"
        },
        "_bridge": {
            "username": "0E:13:79:69:3C:4B",
            "port": 46922
        }
    }

Thanks

Authentication in 1.2.1

When I upgraded to v1.2.1 my accessories/devices disappeared. I checked my config over and over and all appeared good. I rebuild by Raspberry PI and re-installed HomeBridge and the Tuya plugin, manually configured, only to have the same error:

[28/06/2021, 22:30:38] Loaded 0 cached accessories from cachedAccessories.0E6940212586.
Preparing Advertiser for 'TuyaPlatform C4A3' using bonjour-hap backend!
Initializing TuyaPlatform...
TuyaOpenAPI request: method = post, endpoint = https://openapi.tuyaeu.com, path = /v1.0/iot-01/associated-users/actions/authorized-login, params = null, body = {"country_code":61,"username":"[email protected]","password":"XXXXX","schema":"tuyaSmart"}, headers = {"t":"XXXXX","client_id":"XXXXX","nonce":"XXXXX","Signature-Headers":"client_id","sign":"XXXXX","sign_method":"HMAC-SHA256","access_token":"","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.2.1"}
Starting to advertise 'TuyaPlatform C4A3' using bonjour-hap backend!
[28/06/2021, 22:30:38] Homebridge v1.3.4 (TuyaPlatform) is running on port 56345.
TuyaOpenAPI response: {"code":1004,"msg":"sign invalid","success":false,"t":1624883439708} path = /v1.0/iot-01/associated-users/actions/authorized-login
Please confirm that the Access ID and Access Secret of the Smart Home PaaS project you are using were created after May 25, 2021.
Please linked devices by using Tuya Smart or Smart Life app in your cloud project.
Failed to get device information. Please check if the config.json is correct.

So I decided to downgrade to v1.2.0 which was the last know config that worked without issue.

Using the same config parameters no issue - suggestive there is a bug in v1.2.1 around authentication.

Support for Light accessory _v2

Please provide support for the following status codes:

[
  {
    "code": "bright_value_v2",
    "value": 1000
  },
  {
    "code": "temp_value_v2",
    "value": 1000
  },
  {
    "code": "colour_data_v2",
    "value": "{\"h\":24,\"s\":1000,\"v\":1000}"
  }
]

The new update works (aside from the issue in #12) but the light accessory I'm using returns the above unsupported codes so the homekit status only shows on/off switch.

Thanks!

Anyway to Disable the Output in Logs?

Would be nice if it was possible to set an option in the config such as disableLogs: “true” so that the log output would not be shown every 2 seconds

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'find' of undefined

I get this warning and no devices are showing up. Please help:

(node:17584) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'find' of undefined
at TuyaSHOpenAPI.getDevices (/usr/local/lib/node_modules/homebridge-tuya-platform/lib/tuyashopenapi.js:69:78)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at TuyaPlatform.initTuyaSDK (/usr/local/lib/node_modules/homebridge-tuya-platform/index.js:80:17)
(Use node --trace-warnings ... to show where the warning was created)
(node:17584) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:17584) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Config file:

"options": {
"username": "[email protected]",
"password": "XXXX",
"accessId": "cgctdtgxxxxxx",
"accessKey": "hjgjffffffff",
"lang": "en",
"projectType": "2",
"appSchema": "smartlife",
"endPoint": "https://openapi.tuyaeu.com",
"countryCode": 372,
"debug": false
},
"name": "TuyaPlatform",
"platform": "TuyaPlatform"

Access config error

With debug logging enabled the following error appears consistently.

TuyaOpenAPI response: {"code":28841101,"msg":"No permissions. This API is not subscribed.","success":false,"t":1624754292738} path = /v1.0/iot-03/open-hub/access-config

Do I need to add an additional API Product?

add support for dimmer switch

Smart Dimmer Switch, TESSAN WiFi Light Switch

name: New Device Support
about: New device that wants to be supported
title: ''Smart Dimmer Switch, TESSAN WiFi Light Switch"
labels: enhancement, help wanted
assignees: ''


{"active_time":1614289067,"biz_type":0,"category":"tgkg","create_time":1614288716,"icon":"smart/icon/ay1536047723331OpdLN/de9484c22e590e3a0d55a150aea76082.png","id":"eb7093013e4c564ce5az9w","ip":"99.62.188.197","lat":"26.13265833402834","local_key":"7a2612dd0e28ac8b","lon":"-80.40450293441359","name":"Kitchen light","online":true,"owner_id":"33646384","product_id":"zcn1sye3spbycifv","product_name":"智能双控调光器 (Wi-Fi) plus","status":[{"code":"switch_led_1","value":false},{"code":"bright_value_1","value":710},{"code":"brightness_min_1","value":10},{"code":"led_type_1","value":"led"},{"code":"work_mode","value":"light_white"},{"code":"light_mode","value":"pos"}],"sub":false,"time_zone":"-05:00","uid":"az1611536221746t4iLR","update_time":1626788331,"uuid":"5161ae6ec6c0c99c"}],

UnhandledPromiseRejectionWarning - ClientID

Trying to connect and I keep getting this error.

(node:5604) UnhandledPromiseRejectionWarning: TypeError [ERR_HTTP_INVALID_HEADER_VALUE]: Invalid value "undefined" for header "client_id"

I have "accessID" configured like the the readme says to in the JSON. Any thoughts?

Any plan to include more product types?

Firstly, thank you very much for the official homebridge plugin from tuya developer, the community really appreciates the hard work.

However, since the current state is only supporting Outlets and Lights, are there any plan to include the covers, pet-feeder, valve, door lock, and all other broad range of products from Tuya? It looks really promising and hopefully it will gain support on more devices the soonest.

If it's getting support on wider range of products, I might really have to consider switching to Tuya Platform on many of my incoming smart home devices.

Thank you.

Add support for dc lights

I have some Feit Electric string lights that are not supported.

Adding: String Lights 2 (dc / deviceid)
Adding: String Lights 4 (dc / deviceid)
Adding: String Lights 3 (dc / deviceid)

Any plans to add support for this category of lights?

Handling offline devices

Requesting you look at how devices are handled when they are offline and unreachable. Roadmap item.

Right now the plugin renders offline devices as if they are online. Controlling the offline devices in HomeKit appears as if it is working, but it’s not. The status is not accurate.

I understand you are working on making the plugin more robust, so I’m just making you aware for tracking in your roadmap - not asking for an immediate fix.

Subscription plans?

I noticed that I need to subscribe a plan in order to create a project and set-up this plug-in. Since even the free option is just a trial, is it correct to assume that this plug-in is not free?

Add Support for Anytek P22 BLE Smart Padlock

Hi,

It’s great to see more device types added to this official plugin. I just bought a Tuya/Smart Life-enabled fingerprint padlock that runs on Bluetooth but none of the plugins can expose it to HomeKit.

Is this due to the device running on Bluetooth? It would be great if I could contribute to add support for this; as this is the most affordable smart padlock on the market.

Brand: Anytek
Model name: P22+
Pairs with: Smart Life app
Runs on: Bluetooth Low Energy

C27FB080-24E7-4972-976E-1C96B7826A66

Plugin Intention

Hello! The Homebridge community is a curious one and as a result there's been some talk of your plugin already. I am wondering if you can clarify what the intended goal of your plugin is. Do you aim to have an official supported plugin that regular homebridge users can download and use directly? Or are you designing this for your OEM partners?

Return code 2401, "username or password wrong".

This is probably something simple, but I've checked the username and password a few times already.

Return code 2401, "username or password wrong". Username and password are correct for Tuya IoT Platform account associated with accessId/accessKey.

TuyaOpenAPI response: {"code":2401,"msg":"username or password wrong","success":false,"t":1621708376633}
...,
{
    "platform": "TuyaPlatform",
    "name": "TuyaPlatform",
    "options": {
        "username": "myemailaddress",
        "password": "mypassword",
        "accessId": "myaccessid",
        "accessKey": "myaccesskey",
        "lang": "en",
        "endPoint": "https://openapi.tuyaus.com"
    }
},
...

Led Strip

I have installed the plugin successfully. I have two devices installed in smart life app, both devices show up in the cloud project.
When I run the plugin in Homebridge with debug I see the following:

Adding: TV Led (dd / bf7cfcb4d61b9a80fexknv)
Adding: Entrance Lamp (dj / bf8364dae520a89e98mhmz)
Existing Accessory found Entrance Lamp bf8364dae520a89e98mhmz bf87eccb-295c-4cc5-9f1a-ccdd93573c02

In homebridge accessory list and HomeKit only one device shows up. (Entrance Lamp) wifi lightbulb, the led strip (TV Led) doesn't show up at all.

Thanks

Access key/token improperly parsed

plugin 1.1.7
node 14.17

After proper setup following this tutorial: https://developer.tuya.com/en/docs/iot/Tuya_Homebridge_Plugin?id=Kamcldj76lhzt

accessKey in config.json seems to be parsed incorrectly:
image

when accessKey is changed to accessToken, a different error occurs:

{
    "bridge": {
        "name": "Homebridge 4547",
        "username": "***********************",
        "port": ***********************,
        "pin": "***********************"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "options": {
                "username": "***********************",
                "password": "***********************",
                "accessId": "***********************",
-                 "accessKey": "6"***********************"b",
+                "accessToken": "6"***********************"b",
                "lang": "en",
                "projectType": "2",
                "appSchema": "tuyaSmart",
                "endPoint": "https://openapi.tuyaus.com",
                "countryCode": 123456,
                "debug": true
            },
            "name": "TuyaPlatform",
            "platform": "TuyaPlatform"
        }
    ]
}

image

Support for Smoke Detectors

Please add Support for Smoke Detectors.

Because of the limitations regarding polling, they are not supported by the other tuya plugins for Homebridge.

Support for devices under a BLE Gateway

I have a pushbot that runs through a Bluetooth gateway that connects to WiFi. Asking if it is currently supported and if not if it would be supported in the future.

4B49B374-EEF9-4B5E-AC42-44B7B49FB353

Support for 'Socket' type accessories?

I'm curious if it's possible to use this plugin with 'Socket' type accessories, which are somewhat similar to outlets or switches. I'm currently running a QIACHIP Smart Switch, but tuya-homebridge gives me
Failed to get device information. Please check if the config.json is correct.
I assume that's because this device type is not yet supported?

devices not adding

I setup the api key and all that in the guide, I see my project is under cloud which is different than the screen shot, i am in us and set my county code to 1, i am not seeing errors, but none of my devices are appearing whilst they are in the cloud dashboard. I am not sure what i am doing incorrectly.

Could not find accessory in dictionary

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!

1106 Error

Hi,

I still have 1106 error no matter how many times I check and re-check the configs, all seems to be ok. My access ID was created in June 2021. My devices are already linked and online in Tyua IoT Platform as well.

Can it be because my login is also linked to Apple ID login?

TuyaOpenAPI response: {"code":1106,"msg":"權限拒絕","success":false,"t":1624701623779} path = /v1.0/iot-01/associated-users/actions/authorized-login
Please confirm that the Access ID and Access Secret of the Smart Home PaaS project you are using were created after May 25, 2021.
Please linked devices by using Tuya Smart or Smart Life app in your cloud project.
Failed to get device information. Please check if the config.json is correct.

Add Support for Duux Whisper Flex Fan

Hi,
I own a Duux Whisper Flex Fan and i can toggle the fan On/Off in HomeKit but I cannot control the fan speeds or modes (standard/nature/sleep) or oscillating modes (horizontal/vertical swing).

These fan modes and oscillating modes do show up and are controllable from the Tuya Smart App, but are not available in HomeKit.

How do I add my devices?

So I think I have managed to add this to my homebridge system, and then I had added all the details to the config, under home bridge. But it is not working nothing shows up in my home-kit.

Plugin does not find/add all devices

A total of 35 devices are registered on the smartlife app and visible on the project's device list. However, when the plugin runs, it is unable to discover and add all devices - I counted it can only add 20 devices. I tried to clear homebridge's device cache but no luck.

In the logs, I noticed that the below call is only returning 20 device_ids

TuyaOpenAPI request: method = get, endpoint = https://openapi.tuyaus.com, path = /v1.0/devices/functions,
TuyaOpenAPI response: {"result":{"devices":[{"active_time":1592788990,"biz_type":18,"category":"dj","create_time":1591563960,"icon":"smart/product_icon/dj.png","id":"04331260a4cf12ac430f","ip":"REMOVED","lat":"REMOVED","local_key":"REMOVED","lon":"-80.81315117760964","model":"","name":"Loft Rail Light 5","online":true,"owner_id":"18281334","product_id":"QP2puy93gbcNET5G","product_name":"RGBCW","status":[{"code":"switch_led","value":false},{"code":"work_mode","value":"colour"},{"code":"bright_value","value":255},{"code":"temp_value","value":127},{"code":"colour_data","value":"{\"h\":21.0,\"s\":255.0,\"v\":43.1}"},{"code":"scene_data","value":"{\"h\":16.2,\"s\":255.0,\"v\":207.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\":176.9,\"s\":255.0,\"v\":255.0},{\"h\":258.1,\"s\":255.0,\"v\":255.0},{\"h\":258.1,\"s\":255.0,\"v\":255.0},{\"h\":258.1,\"s\":255.0,\"v\":255.0},{\"h\":0.0,\"s\":255.0,\"v\":255.0},{\"h\":0.0,\"s\":255.0,\"v\":255.0}],\"temperature\":255}"}],"sub":false,"time_zone":"-05:00","uid":"az1591562844895JgQkL","update_time":1624284821,"uuid":"04331260a4cf12ac430f"},{"active_time":1607643364,"biz_type":18,"category":"tgq","create_time":1607643364,"icon":"smart/icon/ay1517349698958w8yNe/4a306619b2cf81cb894bde78821e0657.png","id":"8624750310521cd4434b","ip":"REMOVED","lat":"REMOVED","local_key":"47812b7438adb5d3","lon":"-80.81315117760964","name":"Bar Lights","online":true,"owner_id":"18281334","product_id":"tebc75erlgslgpn5","product_name":"Dimmer  Switch","status":[{"code":"switch_led_1","value":false},{"code":"bright_value_1","value":650},{"code":"brightness_min_1","value":10},{"code":"led_type_1","value":"LED"},{"code":"work_mode","value":"white"}],"sub":false,"time_zone":"-05:00","uid":"az1591562844895JgQkL","update_time":1624284820,"uuid":"8624750310521cd4434b"},{"active_time":1610154862,"biz_type":18,"category":"tgq","create_time":1610154862,"icon":"smart/icon/ay1517349698958w8yNe/4a306619b2cf81cb894bde78821e0657.png","id":"4736863710521cfb42b9","ip":"REMOVED","lat":"REMOVED","local_key":"REMOVED","lon":"-80.81315117760964","name":"Upstairs Bathroom Hallway Light","online":true,"owner_id":"18281334","product_id":"tebc75erlgslgpn5","product_name":"Dimmer  Switch","status":[{"code":"switch_led_1","value":false},{"code":"bright_value_1","value":1000},{"code":"brightness_min_1","value":10},{"code":"led_type_1","value":"LED"},{"code":"work_mode","value":"white"}],"sub":false,"time_zone":"-05:00","uid":"az1591562844895JgQkL","update_time":1624284820,"uuid":"4736863710521cfb42b9"},{"active_time":1610654649,"biz_type":18,"category":"kg","create_time":1610654649,"icon":"smart/icon/ay14906729310721fNjn/1568862445415ffab0175.jpg","id":"017743508caab5f290c0","ip":"REMOVED","lat":"REMOVED","local_key":"19424cd1740f1478","lon":"-80.81315117760964","name":"Guest Bedroom Closet Light","online":true,"owner_id":"18281334","product_id":"pigcdkf9bdubtskr","product_name":"SS01S Smart Light Switch","status":[{"code":"switch_1","value":false},{"code":"countdown_1","value":0}],"sub":false,"time_zone":"-05:00","uid":"az1591562844895JgQkL","update_time":1624284820,"uuid":"017743508caab5f290c0"},{"active_time":1610230276,"biz_type":18,"category":"tgq","create_time":1610230276,"icon":"smart/icon/ay1517349698958w8yNe/4a306619b2cf81cb894bde78821e0657.png","id":"473686375002912791ed","ip":"REMOVED","lat":"REMOVED","local_key":"acbc0871ebb24a2e","lon":"-80.81315117760964","name":"Basement Playroom Light","online":true,"owner_id":"18281334","product_id":"tebc75erlgslgpn5","product_name":"Dimmer  Switch","status":[{"code":"switch_led_1","value":false},{"code":"bright_value_1","value":1000},{"code":"brightness_min_1","value":10},{"code":"led_type_1","value":"LED"},{"code":"work_mode","value":"white"}],"sub":false,"time_zone":"-05:00","uid":"az1591562844895JgQkL","update_time":1624284820,"uuid":"473686375002912791ed"},{"active_time":1609342225,"biz_type":18,"category":"tgq","create_time":1609342225,"icon":"smart/icon/ay1517349698958w8yNe/4a306619b2cf81cb894bde78821e0657.png","id":"4736863710521cd65f5b","ip":"REMOVED","lat":"REMOVED","local_key":"633fdca06fedd23a","lon":"-80.81315117760964","name":"Butler's Pantry Light","online":true,"owner_id":"18281334","product_id":"tebc75erlgslgpn5","product_name":"Dimmer  Switch","status":[{"code":"switch_led_1","value":false},{"code":"bright_value_1","value":800},{"code":"brightness_min_1","value":10},{"code":"led_type_1","value":"LED"},{"code":"work_mode","value":"white"}],"sub":false,"time_zone":"-05:00","uid":"az1591562844895JgQkL","update_time":1624284820,"uuid":"4736863710521cd65f5b"},{"active_time":1610068266,"biz_type":18,"category":"tgq","create_time":1610068266,"icon":"smart/icon/ay1517349698958w8yNe/4a306619b2cf81cb894bde78821e0657.png","id":"40855140f4cfa2306654","ip":"REMOVED","lat":"REMOVED","local_key":"44ef6d2b08c1cd6d","lon":"-80.81315117760964","name":"Foyer Chandelier","online":true,"owner_id":"18281334","product_id":"tebc75erlgslgpn5","product_name":"Dimmer  Switch","status":[{"code":"switch_led_1","value":false},{"code":"bright_value_1","value":1000},{"code":"brightness_min_1","value":10},{"code":"led_type_1","value":"LED"},{"code":"work_mode","value":"white"}],"sub":false,"time_zone":"-05:00","uid":"az1591562844895JgQkL","update_time":1624284820,"uuid":"40855140f4cfa2306654"},{"active_time":1623623896,"biz_type":18,"category":"tgq","create_time":1623623896,"icon":"smart/icon/ay1517349698958w8yNe/4a306619b2cf81cb894bde78821e0657.png","id":"40374727c82b96ec9c31","ip":"REMOVED","lat":"REMOVED","local_key":"d95a400d2941a4c1","lon":"-80.81315117760964","name":"Nadia Room Ceiling Light","online":true,"owner_id":"18281334","product_id":"tebc75erlgslgpn5","product_name":"Dimmer  Switch","status":[{"code":"switch_led_1","value":false},{"code":"bright_value_1","value":1000},{"code":"brightness_min_1","value":10},{"code":"led_type_1","value":"LED"},{"code":"work_mode","value":"white"}],"sub":false,"time_zone":"-05:00","uid":"az1591562844895JgQkL","update_time":1624284820,"uuid":"40374727c82b96ec9c31"},{"active_time":1592788729,"biz_type":18,"category":"dj","create_time":1591563657,"icon":"smart/product_icon/dj.png","id":"04331260a4cf12ac9324","ip":"REMOVED","lat":"REMOVED","local_key":"23cec50b5dc7b6de","lon":"-80.81315117760964","model":"","name":"Loft Rail Light 4","online":true,"owner_id":"18281334","product_id":"QP2puy93gbcNET5G","product_name":"RGBCW","status":[{"code":"switch_led","value":false},{"code":"work_mode","value":"colour"},{"code":"bright_value","value":255},{"code":"temp_value","value":127},{"code":"colour_data","value":"{\"h\":21.0,\"s\":255.0,\"v\":43.1}"},{"code":"scene_data","value":"{\"h\":16.2,\"s\":255.0,\"v\":207.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\":176.9,\"s\":255.0,\"v\":255.0},{\"h\":258.1,\"s\":255.0,\"v\":255.0},{\"h\":258.1,\"s\":255.0,\"v\":255.0},{\"h\":258.1,\"s\":255.0,\"v\":255.0},{\"h\":0.0,\"s\":255.0,\"v\":255.0},{\"h\":0.0,\"s\":255.0,\"v\":255.0}],\"temperature\":255}"}],"sub":false,"time_zone":"-05:00","uid":"az1591562844895JgQkL","update_time":1624284820,"uuid":"04331260a4cf12ac9324"},{"active_time":1610155160,"biz_type":18,"category":"tgq","create_time":1610155160,"icon":"smart/icon/ay1517349698958w8yNe/4a306619b2cf81cb894bde78821e0657.png","id":"47368637500291277afb","ip":"REMOVED","lat":"REMOVED","local_key":"7a7bed9b9111dfe6","lon":"-80.81315117760964","name":"Stairs Lights","online":true,"owner_id":"18281334","product_id":"tebc75erlgslgpn5","product_name":"Dimmer  Switch","status":[{"code":"switch_led_1","value":false},{"code":"bright_value_1","value":200},{"code":"brightness_min_1","value":10},{"code":"led_type_1","value":"LED"},{"code":"work_mode","value":"white"}],"sub":false,"time_zone":"-05:00","uid":"az1591562844895JgQkL","update_time":1624284820,"uuid":"47368637500291277afb"},{"active_time":1592788533,"biz_type":18,"category":"dj","create_time":1591562958,"icon":"smart/product_icon/dj.png","id":"0433126084f3ebd19349","ip":"REMOVED","lat":"REMOVED","local_key":"311e6df62e40b2e3","lon":"-80.81315117760964","model":"","name":"Loft Rail Light 1","online":true,"owner_id":"18281334","product_id":"QP2puy93gbcNET5G","product_name":"RGBCW","status":[{"code":"switch_led","value":false},{"code":"work_mode","value":"colour"},{"code":"bright_value","value":255},{"code":"temp_value","value":127},{"code":"colour_data","value":"{\"h\":21.0,\"s\":255.0,\"v\":43.1}"},{"code":"scene_data","value":"{\"h\":16.2,\"s\":255.0,\"v\":207.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\":176.9,\"s\":255.0,\"v\":255.0},{\"h\":258.1,\"s\":255.0,\"v\":255.0},{\"h\":258.1,\"s\":255.0,\"v\":255.0},{\"h\":258.1,\"s\":255.0,\"v\":255.0},{\"h\":0.0,\"s\":255.0,\"v\":255.0},{\"h\":0.0,\"s\":255.0,\"v\":255.0}],\"temperature\":255}"}],"sub":false,"time_zone":"-05:00","uid":"az1591562844895JgQkL","update_time":1624284820,"uuid":"0433126084f3ebd19349"},{"active_time":1610155024,"biz_type":18,"category":"tgq","create_time":1610155024,"icon":"smart/icon/ay1517349698958w8yNe/4a306619b2cf81cb894bde78821e0657.png","id":"4736863710521cfb82a7","ip":"REMOVED","lat":"REMOVED","local_key":"a483f046176d15ca","lon":"-80.81315117760964","name":"Loft Hallway Lights","online":true,"owner_id":"18281334","product_id":"tebc75erlgslgpn5","product_name":"Dimmer  Switch","status":[{"code":"switch_led_1","value":true},{"code":"bright_value_1","value":500},{"code":"brightness_min_1","value":10},{"code":"led_type_1","value":"LED"},{"code":"work_mode","value":"white"}],"sub":false,"time_zone":"-05:00","uid":"az1591562844895JgQkL","update_time":1624284820,"uuid":"4736863710521cfb82a7"},{"active_time":1610989480,"biz_type":18,"category":"tgq","create_time":1610989480,"icon":"smart/icon/ay1517349698958w8yNe/4a306619b2cf81cb894bde78821e0657.png","id":"403747275002910a023b","ip":"REMOVED","lat":"REMOVED","local_key":"a9607987ac1b8e48","lon":"-80.81315117760964","name":"Breakfast Area Chandelier","online":true,"owner_id":"18281334","product_id":"tebc75erlgslgpn5","product_name":"Dimmer  Switch","status":[{"code":"switch_led_1","value":false},{"code":"bright_value_1","value":1000},{"code":"brightness_min_1","value":10},{"code":"led_type_1","value":"LED"},{"code":"work_mode","value":"white"}],"sub":false,"time_zone":"-05:00","uid":"az1591562844895JgQkL","update_time":1624284820,"uuid":"403747275002910a023b"},{"active_time":1610989726,"biz_type":18,"category":"tgq","create_time":1610989726,"icon":"smart/icon/ay1517349698958w8yNe/4a306619b2cf81cb894bde78821e0657.png","id":"85581320c82b9658ff47","ip":"REMOVED","lat":"REMOVED","local_key":"4935b785d2cab747","lon":"-80.81315117760964","name":"Master Bedroom Door Light","online":true,"owner_id":"18281334","product_id":"tebc75erlgslgpn5","product_name":"Dimmer  Switch","status":[{"code":"switch_led_1","value":false},{"code":"bright_value_1","value":650},{"code":"brightness_min_1","value":10},{"code":"led_type_1","value":"LED"},{"code":"work_mode","value":"white"}],"sub":false,"time_zone":"-05:00","uid":"az1591562844895JgQkL","update_time":1624284820,"uuid":"85581320c82b9658ff47"},{"active_time":1592789102,"biz_type":18,"category":"dj","create_time":1591563633,"icon":"smart/product_icon/dj.png","id":"04331260a4cf12ad25ba","ip":"REMOVED","lat":"REMOVED","local_key":"3c22c4e3a0ac5140","lon":"-80.81315117760964","model":"","name":"Loft Rail Light 2","online":true,"owner_id":"18281334","product_id":"QP2puy93gbcNET5G","product_name":"RGBCW","status":[{"code":"switch_led","value":false},{"code":"work_mode","value":"colour"},{"code":"bright_value","value":255},{"code":"temp_value","value":127},{"code":"colour_data","value":"{\"h\":21.0,\"s\":255.0,\"v\":43.1}"},{"code":"scene_data","value":"{\"h\":16.2,\"s\":255.0,\"v\":207.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\":176.9,\"s\":255.0,\"v\":255.0},{\"h\":258.1,\"s\":255.0,\"v\":255.0},{\"h\":258.1,\"s\":255.0,\"v\":255.0},{\"h\":258.1,\"s\":255.0,\"v\":255.0},{\"h\":0.0,\"s\":255.0,\"v\":255.0},{\"h\":0.0,\"s\":255.0,\"v\":255.0}],\"temperature\":255}"}],"sub":false,"time_zone":"-05:00","uid":"az1591562844895JgQkL","update_time":1624284820,"uuid":"04331260a4cf12ad25ba"},{"active_time":1623698691,"biz_type":18,"category":"tgq","create_time":1610989549,"icon":"smart/icon/ay1517349698958w8yNe/4a306619b2cf81cb894bde78821e0657.png","id":"2188570270039fcfd566","ip":"REMOVED","lat":"REMOVED","local_key":"e5ca0b62e253ba15","lon":"-80.81315117760964","name":"Foyer Hallway Lights","online":true,"owner_id":"18281334","product_id":"tebc75erlgslgpn5","product_name":"Dimmer  Switch","status":[{"code":"switch_led_1","value":false},{"code":"bright_value_1","value":350},{"code":"brightness_min_1","value":10},{"code":"led_type_1","value":"LED"},{"code":"work_mode","value":"white"}],"sub":false,"time_zone":"-05:00","uid":"az1591562844895JgQkL","update_time":1624284820,"uuid":"2188570270039fcfd566"},{"active_time":1608755679,"biz_type":18,"category":"tgq","create_time":1608755618,"icon":"smart/icon/ay1517349698958w8yNe/4a306619b2cf81cb894bde78821e0657.png","id":"82680347f4cfa23a09e0","ip":"REMOVED","lat":"REMOVED","local_key":"86569b758646c3d5","lon":"-80.81315117760964","name":"Master Bathroom Shower Lights","online":true,"owner_id":"18281334","product_id":"tebc75erlgslgpn5","product_name":"Dimmer  Switch","status":[{"code":"switch_led_1","value":false},{"code":"bright_value_1","value":1000},{"code":"brightness_min_1","value":10},{"code":"led_type_1","value":"LED"},{"code":"work_mode","value":"white"}],"sub":false,"time_zone":"-05:00","uid":"az1591562844895JgQkL","update_time":1624284820,"uuid":"82680347f4cfa23a09e0"},{"active_time":1608755472,"biz_type":18,"category":"tgq","create_time":1608755472,"icon":"smart/icon/ay1517349698958w8yNe/4a306619b2cf81cb894bde78821e0657.png","id":"4736863750029127f56b","ip":"REMOVED","lat":"REMOVED","local_key":"f13471665f5fcd53","lon":"-80.81315117760964","name":"Master Bedroom Lights","online":true,"owner_id":"18281334","product_id":"tebc75erlgslgpn5","product_name":"Dimmer  Switch","status":[{"code":"switch_led_1","value":false},{"code":"bright_value_1","value":650},{"code":"brightness_min_1","value":10},{"code":"led_type_1","value":"incandescent"},{"code":"work_mode","value":"white"}],"sub":false,"time_zone":"-05:00","uid":"az1591562844895JgQkL","update_time":1624284820,"uuid":"4736863750029127f56b"},{"active_time":1609265728,"biz_type":18,"category":"tgq","create_time":1609265728,"icon":"smart/icon/ay1517349698958w8yNe/4a306619b2cf81cb894bde78821e0657.png","id":"4736863750029127ba9c","ip":"REMOVED","lat":"REMOVED","local_key":"f2f7b3058d4bca98","lon":"-80.81315117760964","name":"Kitchen Island Lights","online":true,"owner_id":"18281334","product_id":"tebc75erlgslgpn5","product_name":"Dimmer  Switch","status":[{"code":"switch_led_1","value":false},{"code":"bright_value_1","value":200},{"code":"brightness_min_1","value":10},{"code":"led_type_1","value":"LED"},{"code":"work_mode","value":"white"}],"sub":false,"time_zone":"-05:00","uid":"az1591562844895JgQkL","update_time":1624284820,"uuid":"4736863750029127ba9c"},{"active_time":1592788887,"biz_type":18,"category":"dj","create_time":1591563637,"icon":"smart/product_icon/dj.png","id":"83608330cc50e3cb33e2","ip":"REMOVED","lat":"REMOVED","local_key":"3ac0202faa7329d5","lon":"-80.81315117760964","model":"","name":"Loft Rail Light 3","online":true,"owner_id":"18281334","product_id":"QP2puy93gbcNET5G","product_name":"RGBCW","status":[{"code":"switch_led","value":false},{"code":"work_mode","value":"colour"},{"code":"bright_value","value":255},{"code":"temp_value","value":127},{"code":"colour_data","value":"{\"h\":21.0,\"s\":255.0,\"v\":43.1}"},{"code":"scene_data","value":"{\"h\":16.2,\"s\":255.0,\"v\":207.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\":176.9,\"s\":255.0,\"v\":255.0},{\"h\":258.1,\"s\":255.0,\"v\":255.0},{\"h\":258.1,\"s\":255.0,\"v\":255.0},{\"h\":258.1,\"s\":255.0,\"v\":255.0},{\"h\":0.0,\"s\":255.0,\"v\":255.0},{\"h\":0.0,\"s\":255.0,\"v\":255.0}],\"temperature\":255}"}],"sub":false,"time_zone":"-05:00","uid":"az1591562844895JgQkL","update_time":1624284820,"uuid":"83608330cc50e3cb33e2"}],"has_more":true,"last_row_key":"4F492D1176ED54C96A4DBE8C55B77882","total":35},"success":true,"t":1624284887434} path = /v1.0/iot-01/associated-users/devices

Code 1010

I get a Code 1010 if I try to use the Plugin.

My configuration:

"platform": "TuyaPlatform",
            "name": "TuyaPlatform",
            "options": {
                "username": "<my smart life email-adress>",
                "password": "<my smart life password>",
                "accessId": "<the accessId from project overview>",
                "accessKey": "<the accessKey from project overview>",
                "lang": "en",
                "endPoint": "https://openapi.tuyaeu.com",
                "projectType": "2",
                "appSchema": "smartlife",
                "countryCode": 49
            }

The Log regarding login:

TuyaOpenAPI request: method = post, endpoint = https://openapi.tuyaeu.com, path = /v1.0/iot-01/associated-users/actions/authorized-login, params = null, body = {"country_code":49,"username":"<the email I use for smart life>","password":"<redacted>","schema":"smartlife"}, headers = {"t":"1622144608219","client_id":"hmqkvnj7amd9oue5s40x","sign":"BD61F9FFAA08F7A7A9F99A32A607DB7710E258B292AAD9D97921C6D8957295B3","sign_method":"HMAC-SHA256","access_token":"","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.0.6"}

....

TuyaOpenAPI response: {"code":1010,"msg":"令牌過期","success":false,"t":1622144608498} path = /v1.0/iot-01/associated-users/actions/authorized-login
(node:13746) UnhandledPromiseRejectionWarning: TypeError: Cannot destructure property 'access_token' of 'res.result' as it is undefined.
    at TuyaSHOpenAPI._refreshAccessTokenIfNeed (/usr/lib/node_modules/homebridge-tuya-platform/lib/tuyashopenapi.js:45:10)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at TuyaSHOpenAPI.request (/usr/lib/node_modules/homebridge-tuya-platform/lib/tuyashopenapi.js:128:5)
    at TuyaSHOpenAPI.getDevices (/usr/lib/node_modules/homebridge-tuya-platform/lib/tuyashopenapi.js:58:15)
    at TuyaPlatform.initTuyaSDK (/usr/lib/node_modules/homebridge-tuya-platform/index.js:76:17)
(node:13746) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:13746) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Unsupported devices

I have issues with the next devices:

  • fskg - Ceiling Fan switch - absent at all
  • tgq - Dimmer Switch - doesn't have dimmer, allows only to turn on/off
  • fs - Ceiling Fan and Lights - shown only as Fan, no lights controls
    Please fix it.

2406 error

I get the 2406 error but the access id and key are correct, the project and tuya account have been created on 24 June and I've updated the plugin today to the latest version 1.2.1.

image

Ceiling Lamp issues

I'm having some problems controlling my ceiling lamp. The ceiling light device category "xdd" is not recognized as a light. After overriding the category in the config the color temperature works, however warm and cold are inverted. The brightness is being read out correctly but cannot be adjusted. Homekit simply says "no response" when I try to adjust it and reverts to the old setting.

Code 2406 skill id invalid

How to solve:

TuyaOpenAPI response: {"code":2406,"msg":"skill id invalid","success":false,"t":1622204992541} path = /v1.0/iot-01/associated-users/actions/authorized-login
(node:28565) UnhandledPromiseRejectionWarning: TypeError: Cannot destructure property 'access_token' of 'res.result' as it is undefined.
at TuyaSHOpenAPI._refreshAccessTokenIfNeed (/usr/local/lib/node_modules/homebridge-tuya-platform/lib/tuyashopenapi.js:45:10)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at TuyaSHOpenAPI.request (/usr/local/lib/node_modules/homebridge-tuya-platform/lib/tuyashopenapi.js:128:5)
at TuyaSHOpenAPI.getDevices (/usr/local/lib/node_modules/homebridge-tuya-platform/lib/tuyashopenapi.js:58:15)
at TuyaPlatform.initTuyaSDK (/usr/local/lib/node_modules/homebridge-tuya-platform/index.js:76:17)
(Use node --trace-warnings ... to show where the warning was created)
(node:28565) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:28565) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

using:

tuyaSmart
europe

Local API

Please support local API. The biggest reason folks flash devices is to reduce the inevitable latency issues with going to cloud endpoint and back.

Can we make this truly local, LAN protocol?

Identical devices, different behaviors

I have 2 bulbs that are identical to each other (same manufacturer, model, came in a pack together).

These two bulbs load, along with all of my devices in the API response. However the Creating New Accessory has different results for these two identical bulbs.

These two identical bulbs show up with different functions in HomeKit.
One bulb loads as it should with control for Power, Brightness, and Color Temperature.

[03/06/2021, 10:09:31] [TuyaPlatform] Adding: GN-BW231-999 2 (dj / ebfc757038252d0e55kbth)
[03/06/2021, 10:09:31] [TuyaPlatform] Creating New Accessory ebfc757038252d0e55kbth
LightAccessory statusArr. [
  { code: 'switch_led', value: true },
  { code: 'bright_value', value: 202 },
  { code: 'temp_value', value: 102 }
]
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: 'temp_value',
    desc: 'temp value',
    name: 'temp value',
    type: 'Integer',
    values: '{"min":0,"scale":0,"unit":"","max":255,"step":1}\t'
  }
]

The 2nd only loads with Power (On/Off capability). As you can see in the logs below, this one throws a warning LightAccessory functionArr. undefined and results in an unhandled exception.

[03/06/2021, 10:09:31] [TuyaPlatform] Adding: GN-BW231-999 3 (dj / eb40e5c0e95fc073cadhpm)
[03/06/2021, 10:09:31] [TuyaPlatform] Creating New Accessory eb40e5c0e95fc073cadhpm
LightAccessory statusArr. [
  { code: 'switch_led', value: true },
  { code: 'bright_value', value: 43 },
  { code: 'temp_value', value: 56 }
]
LightAccessory functionArr. undefined
(node:5018) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'find' of undefined
    at LightAccessory.getFunction (/usr/local/lib/node_modules/homebridge-tuya-platform/lib/light_accessory.js:212:36)
    at LightAccessory.refreshAccessoryServiceIfNeed (/usr/local/lib/node_modules/homebridge-tuya-platform/lib/light_accessory.js:53:29)
    at new LightAccessory (/usr/local/lib/node_modules/homebridge-tuya-platform/lib/light_accessory.js:30:10)
    at TuyaPlatform.addAccessory (/usr/local/lib/node_modules/homebridge-tuya-platform/index.js:125:27)
    at TuyaPlatform.initTuyaSDK (/usr/local/lib/node_modules/homebridge-tuya-platform/index.js:84:12)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:5018) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 10)
(node:5018) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Air Purifier discovered but not working

Hello,
I've added all my accessories in the Home App (see #22 ) but the Air Purifier is not working (it's added but becomes unresponsive).

Here are some details that might be helpful:

AIR PURIFIER:
Brand: Bimar
Model: VK-6070A
Type: PA98

LOGS:
(node:1091288) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'values' of undefined
at AirPurifierAccessory.getSpeedFunction (/usr/local/lib/node_modules/homebridge-tuya-platform/lib/air_purifier_accessory.js:162:40)
at new AirPurifierAccessory (/usr/local/lib/node_modules/homebridge-tuya-platform/lib/air_purifier_accessory.js:25:37)
at TuyaPlatform.addAccessory (/usr/local/lib/node_modules/homebridge-tuya-platform/index.js:107:27)
at TuyaPlatform.initTuyaSDK (/usr/local/lib/node_modules/homebridge-tuya-platform/index.js:86:12)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
(Use node --trace-warnings ... to show where the warning was created)
(node:1091288) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:1091288) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

IMAGES:
bimar

Thanks for your hard work!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.