homebridge-tuya-platform-talrhvfork 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/ISSUE_TEMPLATE/bug_report.md +106 -0
- package/.github/ISSUE_TEMPLATE/login_error_code.md +28 -0
- package/.github/ISSUE_TEMPLATE/new-device-support.md +94 -0
- package/.github/workflows/greetings.yml +16 -0
- package/.github/workflows/stale.yml +21 -0
- package/LICENSE +20 -0
- package/README.md +89 -0
- package/config/config.json +30 -0
- package/config.schema.json +106 -0
- package/index.js +276 -0
- package/lib/air_purifier_accessory.js +194 -0
- package/lib/base_accessory.js +121 -0
- package/lib/contactsensor_accessory.js +92 -0
- package/lib/fanv2_accessory.js +295 -0
- package/lib/garagedoor_accessory.js +122 -0
- package/lib/heater_accessory.js +249 -0
- package/lib/leak_sensor_accessory.js +115 -0
- package/lib/light_accessory.js +313 -0
- package/lib/motionsensor_accessory.js +98 -0
- package/lib/outlet_accessory.js +108 -0
- package/lib/push_accessory.js +107 -0
- package/lib/smokesensor_accessory.js +95 -0
- package/lib/switch_accessory.js +104 -0
- package/lib/tuyamqttapi.js +145 -0
- package/lib/tuyaopenapi.js +234 -0
- package/lib/tuyashopenapi.js +233 -0
- package/lib/valve_accessory.js +279 -0
- package/lib/window_covering_accessory.js +215 -0
- package/package.json +32 -0
- package/test/datautil.test.js +10 -0
- package/test/env.js +7 -0
- package/test/mq.js +21 -0
- package/test/tuyamqttapi.test.js +80 -0
- package/test/tuyashopenapi.test.js +23 -0
- package/util/countryutil.js +252 -0
- package/util/datautil.js +19 -0
- package/util/logutil.js +19 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: ''
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Describe the bug**
|
|
11
|
+
A clear and concise description of what the bug is.
|
|
12
|
+
|
|
13
|
+
**Expected behavior**
|
|
14
|
+
A clear and concise description of what you expected to happen.
|
|
15
|
+
|
|
16
|
+
**Screenshots**
|
|
17
|
+
If applicable, add screenshots to help explain your problem.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
**Device info (please complete the following information, which can be found in [log](https://github.com/tuya/tuya-homebridge/wiki/How-To-Get-Logs)):**
|
|
21
|
+
**request path = /v1.0/iot-01/associated-users/devices**
|
|
22
|
+
|
|
23
|
+
like this:
|
|
24
|
+
{
|
|
25
|
+
"active_time": 1623229189,
|
|
26
|
+
"biz_type": 18,
|
|
27
|
+
"category": "cz",
|
|
28
|
+
"create_time": 1560491945,
|
|
29
|
+
"icon": "smart/product_icon/cz.png",
|
|
30
|
+
"id": "aaaaaaaaaaa",
|
|
31
|
+
"ip": "xxxxxxxxxxxxxxxx",
|
|
32
|
+
"lat": "30.30286857361191",
|
|
33
|
+
"local_key": "xxxxxxxxxxxxx",
|
|
34
|
+
"lon": "120.0639743842656",
|
|
35
|
+
"model": "",
|
|
36
|
+
"name": "Living Room Socket",
|
|
37
|
+
"online": false,
|
|
38
|
+
"owner_id": "34794909",
|
|
39
|
+
"product_id": "yfemiswbgjhddhcf",
|
|
40
|
+
"product_name": "Switch Product",
|
|
41
|
+
"status": [
|
|
42
|
+
{
|
|
43
|
+
"code": "switch",
|
|
44
|
+
"value": false
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"code": "countdown_1",
|
|
48
|
+
"value": 0
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"code": "cur_current",
|
|
52
|
+
"value": 0
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"code": "cur_power",
|
|
56
|
+
"value": 0
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"code": "cur_voltage",
|
|
60
|
+
"value": 2343
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"sub": false,
|
|
64
|
+
"time_zone": "+08:00",
|
|
65
|
+
"uid": "xxxxxxxxxxxxxxxxxxx",
|
|
66
|
+
"update_time": 1625101929,
|
|
67
|
+
"uuid": "xxxxxxxxxxxxxxxxxx"
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
**Device functions (please complete the following information, which can be found in [log](https://github.com/tuya/tuya-homebridge/wiki/How-To-Get-Logs)):**
|
|
71
|
+
**request path = /v1.0/devices/functions**
|
|
72
|
+
Same **device Id**, like this:
|
|
73
|
+
{
|
|
74
|
+
"category":"cl",
|
|
75
|
+
"devices":[
|
|
76
|
+
"aaaaaaaaaaa"
|
|
77
|
+
],
|
|
78
|
+
"functions":[
|
|
79
|
+
{
|
|
80
|
+
"code":"control",
|
|
81
|
+
"desc":"control",
|
|
82
|
+
"name":"control",
|
|
83
|
+
"type":"Enum",
|
|
84
|
+
"values":"{\"range\":[\"open\",\"stop\",\"close\"]}"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"code":"percent_control",
|
|
88
|
+
"desc":"percent control",
|
|
89
|
+
"name":"percent control",
|
|
90
|
+
"type":"Integer",
|
|
91
|
+
"values":"{\"unit\":\"%\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"code":"control_back",
|
|
95
|
+
"desc":"control back",
|
|
96
|
+
"name":"control back",
|
|
97
|
+
"type":"Boolean",
|
|
98
|
+
"values":"{}"
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"product_id":"xaabybja"
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
**Additional context**
|
|
106
|
+
Add any other context or logs about the problem here.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Error Code
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: ''
|
|
5
|
+
labels: code XXX
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Describe the bug**
|
|
11
|
+
A clear and concise description of what the bug is.
|
|
12
|
+
|
|
13
|
+
**Screenshots**
|
|
14
|
+
If applicable, add screenshots to help explain your problem.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
**Login request (please complete the following information, which can be found in [log](https://github.com/tuya/tuya-homebridge/wiki/How-To-Get-Logs)):**
|
|
18
|
+
**request path = /v1.0/iot-01/associated-users/actions/authorized-login**
|
|
19
|
+
|
|
20
|
+
like this:
|
|
21
|
+
|
|
22
|
+
TuyaOpenAPI request: method = post, endpoint = https://openapi.tuyacn.com, path = /v1.0/iot-01/associated-users/actions/authorized-login, params = null, body = {"country_code":86,"username":"XXXXXXXXXXXXX","password":"c44755c3379313db173e53c3e8fb6701","schema":"tuyaSmart"}, headers = {"t":"1626082406842","client_id":"XXXXXXXXXXXXX","nonce":"33341140-e2f4-11eb-abd9-491eaffd7d33","Signature-Headers":"client_id","sign":"2E250AB9256B14F6EAD94DEA9EE0EA8413E7939E7DEAB0B60D8D786B296A7AF8","sign_method":"HMAC-SHA256","access_token":"","lang":"en","dev_lang":"javascript","dev_channel":"homebridge","devVersion":"1.2.1"}
|
|
23
|
+
|
|
24
|
+
**Login response (please complete the following information, which can be found in [log](https://github.com/tuya/tuya-homebridge/wiki/How-To-Get-Logs)):**
|
|
25
|
+
**request path = /v1.0/devices/functions**
|
|
26
|
+
TuyaOpenAPI response: {"code":1106,"msg":"permission deny","success":false,"t":1626082407259} path = /v1.0/iot-01/associated-users/actions/authorized-login
|
|
27
|
+
|
|
28
|
+
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: New Device Support
|
|
3
|
+
about: New device that wants to be supported
|
|
4
|
+
title: ''
|
|
5
|
+
labels: enhancement, help wanted
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
**Device info (please complete the following information, which can be found in [log](https://github.com/tuya/tuya-homebridge/wiki/How-To-Get-Logs)):**
|
|
12
|
+
**request path = /v1.0/iot-01/associated-users/devices**
|
|
13
|
+
|
|
14
|
+
like this:
|
|
15
|
+
{
|
|
16
|
+
"active_time": 1623229189,
|
|
17
|
+
"biz_type": 18,
|
|
18
|
+
"category": "cz",
|
|
19
|
+
"create_time": 1560491945,
|
|
20
|
+
"icon": "smart/product_icon/cz.png",
|
|
21
|
+
"id": "aaaaaaaaaaa",
|
|
22
|
+
"ip": "xxxxxxxxxxxxxxxx",
|
|
23
|
+
"lat": "30.30286857361191",
|
|
24
|
+
"local_key": "xxxxxxxxxxxxx",
|
|
25
|
+
"lon": "120.0639743842656",
|
|
26
|
+
"model": "",
|
|
27
|
+
"name": "Living Room Socket",
|
|
28
|
+
"online": false,
|
|
29
|
+
"owner_id": "34794909",
|
|
30
|
+
"product_id": "yfemiswbgjhddhcf",
|
|
31
|
+
"product_name": "Switch Product",
|
|
32
|
+
"status": [
|
|
33
|
+
{
|
|
34
|
+
"code": "switch",
|
|
35
|
+
"value": false
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"code": "countdown_1",
|
|
39
|
+
"value": 0
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"code": "cur_current",
|
|
43
|
+
"value": 0
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"code": "cur_power",
|
|
47
|
+
"value": 0
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"code": "cur_voltage",
|
|
51
|
+
"value": 2343
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"sub": false,
|
|
55
|
+
"time_zone": "+08:00",
|
|
56
|
+
"uid": "xxxxxxxxxxxxxxxxxxx",
|
|
57
|
+
"update_time": 1625101929,
|
|
58
|
+
"uuid": "xxxxxxxxxxxxxxxxxx"
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
**Device functions (please complete the following information, which can be found in [log](https://github.com/tuya/tuya-homebridge/wiki/How-To-Get-Logs)):**
|
|
62
|
+
**request path = /v1.0/devices/functions**
|
|
63
|
+
|
|
64
|
+
Same **device Id**, like this:
|
|
65
|
+
{
|
|
66
|
+
"category":"cl",
|
|
67
|
+
"devices":[
|
|
68
|
+
"aaaaaaaaaaa"
|
|
69
|
+
],
|
|
70
|
+
"functions":[
|
|
71
|
+
{
|
|
72
|
+
"code":"control",
|
|
73
|
+
"desc":"control",
|
|
74
|
+
"name":"control",
|
|
75
|
+
"type":"Enum",
|
|
76
|
+
"values":"{\"range\":[\"open\",\"stop\",\"close\"]}"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"code":"percent_control",
|
|
80
|
+
"desc":"percent control",
|
|
81
|
+
"name":"percent control",
|
|
82
|
+
"type":"Integer",
|
|
83
|
+
"values":"{\"unit\":\"%\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"code":"control_back",
|
|
87
|
+
"desc":"control back",
|
|
88
|
+
"name":"control back",
|
|
89
|
+
"type":"Boolean",
|
|
90
|
+
"values":"{}"
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"product_id":"xaabybja"
|
|
94
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
name: Greetings
|
|
2
|
+
|
|
3
|
+
on: [pull_request, issues]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
greeting:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
permissions:
|
|
9
|
+
issues: write
|
|
10
|
+
pull-requests: write
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/first-interaction@v1
|
|
13
|
+
with:
|
|
14
|
+
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
15
|
+
issue-message: 'Thank you for your feedback, we will solve this issue soon'
|
|
16
|
+
pr-message: 'Thank you for your PR, we will review it soon.'
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Mark stale issues and pull requests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
schedule:
|
|
5
|
+
- cron: '27 9 * * *'
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
stale:
|
|
9
|
+
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
issues: write
|
|
13
|
+
pull-requests: write
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/stale@v3
|
|
17
|
+
with:
|
|
18
|
+
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
19
|
+
stale-issue-message: 'Stale issue. we will close the issue soon. If this issue has not been resolved, please update the issue and contact us in time.'
|
|
20
|
+
stale-issue-label: 'no-issue-activity'
|
|
21
|
+
stale-pr-label: 'no-pr-activity'
|
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014-2021 Tuya Inc.
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in
|
|
12
|
+
all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
17
|
+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
19
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
20
|
+
DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
This Fork adds more device support for the fantastaic Homebridge-Tuya plugin!
|
|
2
|
+
|
|
3
|
+
* Valve accessory support for switches! - turn your regular switch (kg category) to a valve accessory! what it means? it means that you
|
|
4
|
+
set a countdown timer for the switch to turn off automatically directly from the home app! (great for boiler switches).
|
|
5
|
+
* Notion sensor support - thanks to MeesMaas.
|
|
6
|
+
* Zigbee curtain switch support with percentage control.
|
|
7
|
+
* Push accessory support - currently only Fingerbot is supported.
|
|
8
|
+
|
|
9
|
+
Tuya Homebridge Plugin
|
|
10
|
+
========================
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
<img src="https://images.tuyacn.com/app/hass/hb_tuya.png" width="70%"><br>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<span align="center">
|
|
17
|
+
|
|
18
|
+
[](https://www.npmjs.com/package/homebridge-tuya-platform)
|
|
19
|
+
[](https://www.npmjs.com/package/homebridge-tuya-platform)
|
|
20
|
+
[](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)
|
|
21
|
+
|
|
22
|
+
[](https://GitHub.com/tuya/tuya-homebridge/watchers/)
|
|
23
|
+
[](https://GitHub.com/tuya/tuya-homebridge/stargazers/)
|
|
24
|
+
[](https://GitHub.com/tuya/tuya-homebridge/network/)
|
|
25
|
+
|
|
26
|
+
If you like Tuya Homebridge Plugin - give it a star, or fork it and contribute!
|
|
27
|
+
|
|
28
|
+
</span>
|
|
29
|
+
|
|
30
|
+
Homebridge custom plugin for controlling Powered by Tuya (PBT) devices in HomeKit, it's based on [Tuya Open API](https://developer.tuya.com/en/docs/cloud/?_source=2e646f88eae60b7eb595e94fc3866975). The plugin is officially maintained by the Tuya Developer Team.
|
|
31
|
+
|
|
32
|
+
✌️✌️✌️ [Supported Tuya Device Types](https://github.com/tuya/tuya-homebridge/wiki/Supported-Tuya-Device-Types?_source=6a1b8046224626e798190c06532c8be2) ✌️✌️✌️
|
|
33
|
+
|
|
34
|
+
:tada: :tada: :tada: [Vote for Tuya Homebridge Plugin New Device Driver Support!](https://github.com/tuya/tuya-homebridge/discussions/58) :tada::tada::tada:
|
|
35
|
+
|
|
36
|
+
## [Tuya Beta Test Program](https://pages.tuya.com/develop/Homebridgebetainvitation?_source=ea61b9486f59eb89a3ee74b43140b9f3#form)
|
|
37
|
+
Welcome to join the [Tuya Beta Test Program](https://pages.tuya.com/develop/Homebridgebetainvitation?_source=ea61b9486f59eb89a3ee74b43140b9f3#form) to get your development gifts and make the contribution to the plugin.Your feedback is valuable to the whole community.
|
|
38
|
+
|
|
39
|
+
## Important Note
|
|
40
|
+
|
|
41
|
+
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.
|
|
42
|
+
|
|
43
|
+
### Youtube Tutorial:
|
|
44
|
+
|
|
45
|
+
[](https://www.youtube.com/watch?v=YH6d-2VJMaU)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
## Preparation
|
|
49
|
+
1. [Tuya IoT Platform Configuration](https://github.com/tuya/tuya-homebridge/wiki/Tuya-IoT-Platform-Configuration-Guide-Using-Smart-Home-PaaS?_source=d8fba44feeef4757f7f22a14c2295f3f)
|
|
50
|
+
2. [Use the Tuya Homebridge Plugin](https://github.com/tuya/tuya-homebridge/wiki/How-to-Use-Tuya-Homebridge-Plugin?_source=6a2b624bdb6dce83dd246e014ccd0bcf)
|
|
51
|
+
3. [Develop a New Driver](https://github.com/tuya/tuya-homebridge/wiki/How-to-Develop-a-New-Driver?_source=44108482f4dfcf47095e53dcf7dbba95)
|
|
52
|
+
4. [How to Get Logs](https://github.com/tuya/tuya-homebridge/wiki/How-To-Get-Logs)
|
|
53
|
+
|
|
54
|
+
## Set up the development environment
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
—-VSCode
|
|
58
|
+
—-engines
|
|
59
|
+
"node": “>=0.12.0”
|
|
60
|
+
"homebridge": ">=0.2.0"
|
|
61
|
+
—-dependencies
|
|
62
|
+
"axios": “^0.21.1",
|
|
63
|
+
"crypto-js": “^4.0.0”,
|
|
64
|
+
"mqtt": “^4.2.6",
|
|
65
|
+
"uuid": "^8.3.2"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Tuya OpenApi Login Error Code
|
|
69
|
+
|
|
70
|
+
| Error code | Error message | Troubleshooting |
|
|
71
|
+
|:----|:----|:----|
|
|
72
|
+
| 1004 | sign invalid | <ul><li> Incorrect `accessId` or `accessKey`. To fix the error, see [Edit config.json](https://developer.tuya.com/en/docs/iot/Tuya_Homebridge_Plugin?id=Kamcldj76lhzt#config) file.</li><li> 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. |
|
|
73
|
+
| 1106 | permission deny | <ul><li> 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](https://iot.tuya.com/cloud/). For more information, see [Link devices by app account](https://developer.tuya.com/en/docs/iot/Platform_Configuration_smarthome?id=Kamcgamwoevrx#title-3-Link%20devices%20by%20app%20account).</li><li>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. </li><li> 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](https://iot.tuya.com/cloud/).</li><li>Incorrect endpoint: See [Endpoint](https://developer.tuya.com/en/docs/iot/Tuya_Homebridge_Plugin?id=Kamcldj76lhzt#endpoint) and enter the correct endpoint.</li><li>Incorrect countryCode: Enter the [code of the country](https://countrycode.org/) you select on logging in to the Tuya Smart or Smart Life app.</li><li>Incorrect **schema** (case insensitive). Currently only **tuyaSmart** and **smartlife** are supported.</li></ul> |
|
|
74
|
+
| 1100 | param is empty | `username` or `appSchema` is empty: See [Edit config.json](https://developer.tuya.com/en/docs/iot/Tuya_Homebridge_Plugin?id=Kamcldj76lhzt#config) file and enter the correct parameter. |
|
|
75
|
+
| 2017 | schema does not exist | Incorrect `appSchema` in `config.json`: See [Edit config.json](https://developer.tuya.com/en/docs/iot/Tuya_Homebridge_Plugin?id=Kamcldj76lhzt#config) file and enter the correct parameter. |
|
|
76
|
+
| 2406 | skill id invalid | <ul><li>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](https://github.com/tuya/tuya-home-assistant/blob/master/docs/regions_dataCenters.md).</li><li>Your cloud project on the [Tuya IoT Development Platform](https://iot.tuya.com/?_source=a4c65f56395e05cf64cc8d4abb7396b6) should be created after May 25, 2021. Otherwise, you need to create a new project. </li></ul> |
|
|
77
|
+
| 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](https://developer.tuya.com/en/docs/iot/applying-for-api-group-permissions?id=Ka6vf012u6q76#title-2-Subscribe%20to%20cloud%20products) and [authorize your project to use them](https://developer.tuya.com/en/docs/iot/applying-for-api-group-permissions?id=Ka6vf012u6q76#title-3-Authorize%20projects%20to%20call%20the%20cloud%20product). <ul><li>Authorization</li><li>Smart Home Devices Management</li><li>Smart Home Family Management</li><li>Smart Home Scene Linkage</li><li>Smart Home Data Service</li><li>Device Status Notification</li></ul> |
|
|
78
|
+
|
|
79
|
+
## Users
|
|
80
|
+
|
|
81
|
+
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.
|
|
82
|
+
|
|
83
|
+
## Feedback
|
|
84
|
+
|
|
85
|
+
You can use the **GitHub Issue** or [**tickets**](https://service.console.tuya.com/8/2/list?_source=c5965e0f53c87ba9d0eb99af0f4b124f) to provide feedback on any problems you encounter.
|
|
86
|
+
|
|
87
|
+
## LICENSE
|
|
88
|
+
|
|
89
|
+
For more information, see the [LICENSE](LICENSE) file.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"bridge": {
|
|
3
|
+
"name": "homebridge-tuya-platform",
|
|
4
|
+
"username": "BE:B9:AC:79:6C:CB",
|
|
5
|
+
"port": 8081,
|
|
6
|
+
"pin": "034-85-685"
|
|
7
|
+
},
|
|
8
|
+
|
|
9
|
+
"description": "This is an Homebridge Plugin of Tuya.",
|
|
10
|
+
|
|
11
|
+
"platforms": [
|
|
12
|
+
{
|
|
13
|
+
"platform": "TuyaPlatform",
|
|
14
|
+
"name": "TuyaPlatform",
|
|
15
|
+
"options": {
|
|
16
|
+
"username": "",
|
|
17
|
+
"password": "",
|
|
18
|
+
"accessId": "",
|
|
19
|
+
"accessKey": "",
|
|
20
|
+
"lang": "en",
|
|
21
|
+
"projectType": "2",
|
|
22
|
+
"appSchema": "",
|
|
23
|
+
"countryCode":86 ,
|
|
24
|
+
"debug": true,
|
|
25
|
+
"valve": []
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
{
|
|
2
|
+
"pluginAlias": "TuyaPlatform",
|
|
3
|
+
"pluginType": "platform",
|
|
4
|
+
"singular": true,
|
|
5
|
+
"headerDisplay": "Official Tuya Homebridge plugin, supported by Tuya Developers.",
|
|
6
|
+
"footerDisplay": "",
|
|
7
|
+
"schema": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"name": {
|
|
11
|
+
"title": "Name",
|
|
12
|
+
"type": "string",
|
|
13
|
+
"required": true,
|
|
14
|
+
"default": "TuyaPlatform",
|
|
15
|
+
"description": "You shouldn't need to change this."
|
|
16
|
+
},
|
|
17
|
+
"options": {
|
|
18
|
+
"title": "",
|
|
19
|
+
"type": "object",
|
|
20
|
+
"required": true,
|
|
21
|
+
"properties": {
|
|
22
|
+
"username": {
|
|
23
|
+
"title": "Username",
|
|
24
|
+
"type": "string",
|
|
25
|
+
"required": true
|
|
26
|
+
},
|
|
27
|
+
"password": {
|
|
28
|
+
"title": "Password",
|
|
29
|
+
"type": "string",
|
|
30
|
+
"required": true
|
|
31
|
+
},
|
|
32
|
+
"accessId": {
|
|
33
|
+
"title": "Access ID",
|
|
34
|
+
"type": "string",
|
|
35
|
+
"required": true
|
|
36
|
+
},
|
|
37
|
+
"accessKey": {
|
|
38
|
+
"title": "Access Key",
|
|
39
|
+
"type": "string",
|
|
40
|
+
"required": true
|
|
41
|
+
},
|
|
42
|
+
"lang": {
|
|
43
|
+
"title": "Language Code",
|
|
44
|
+
"type": "string",
|
|
45
|
+
"default": "en",
|
|
46
|
+
"description": "Your two letter language code",
|
|
47
|
+
"required": true
|
|
48
|
+
},
|
|
49
|
+
"projectType": {
|
|
50
|
+
"title": "Project Type",
|
|
51
|
+
"type": "string",
|
|
52
|
+
"default": "form",
|
|
53
|
+
"oneOf": [{
|
|
54
|
+
"title": "PaaS",
|
|
55
|
+
"enum": ["2"]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"title": "Custom",
|
|
59
|
+
"enum": ["1"]
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"required": true
|
|
63
|
+
},
|
|
64
|
+
"appSchema": {
|
|
65
|
+
"title": "PaaS Platform",
|
|
66
|
+
"type": "string",
|
|
67
|
+
"default": "form",
|
|
68
|
+
"oneOf": [{
|
|
69
|
+
"title": "Tuya Smart",
|
|
70
|
+
"enum": ["tuyaSmart"]
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"title": "Smart Life",
|
|
74
|
+
"enum": ["smartlife"]
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"required": true
|
|
78
|
+
},
|
|
79
|
+
"countryCode": {
|
|
80
|
+
"title": "Country Code",
|
|
81
|
+
"type": "number",
|
|
82
|
+
"default": "",
|
|
83
|
+
"description": "Your two integer country code",
|
|
84
|
+
"required": true
|
|
85
|
+
},
|
|
86
|
+
"valve":{
|
|
87
|
+
"title": "switch with timer",
|
|
88
|
+
"type":"array",
|
|
89
|
+
"description":"This feature let you use the switch as a valve accessory. it means that you can set countdown directly through the home app which is great for boiler switch the only issue is that valve accessories do not support automation, it can be set only through Tuya / SmartLife App.",
|
|
90
|
+
"items":{
|
|
91
|
+
"title":"device id",
|
|
92
|
+
"type":"string"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
"debug": {
|
|
97
|
+
"title": "Enable Debug Logging",
|
|
98
|
+
"type": "boolean",
|
|
99
|
+
"default": false,
|
|
100
|
+
"required": true
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|