Commit Graph

58 Commits

Author SHA1 Message Date
GadgetAngel
4ea15db772 This update allows for an essential TuyAPI command to be implemented via the tuya-mqtt.exe MQTT server. {"schema": true} is the ONLY COMMAND that the TuyAPI GET method implements. Also fixes a problem with the setColor method of TuyaColorLight. When passing colorValue the curly braces are part of the colorValue string, but when you hit the .split to break up the string into Hue, Saturation and Brightness the curly braces are still considered part of the string so the Hue value was always returning a NaN value due to { was part of the Hue. Therefore I created a private function that strips off the beginning and ending curly braces so the right numeric values can be found.
{"schema": true} allows the user to establish that proper communications with the tuya device can occur WITHOUT actually changing the present STATE of the device.  This is the only command that will query the tuya device.

The current documentation says that you can query the tuya device over the "dps" TOPIC but from what I see the present state of the software does not force the tuya device to respond when using the "dps" TOPIC.

Since {"schema": true} is a command that forces a response from the tuya device, this command has been implemented under the "command" TOPIC. So "command" is the action and '{"schema": true}' becomes the command.  The response is returned just like all other commands.  I, use this command to guarantee communications has been established with the tuya device.  If this "schema" command fails, tuya-mqtt will indicate the result in the openhab.log file and then I, can find out what is physically wrong with the communications.  If this command fails the first time due to "socket" error and then goes through on the second attempt then I know that the error was due to TCP communications problem on initial startup.  This command helps as a work-a-round for the "ERROR: socket problem"
2019-04-20 17:50:38 -04:00
GadgetAngel
61433e74a9 This update allows for an essential TuyAPI command to be implemented via the tuya-mqtt.exe MQTT server. {"schema": true} is the ONLY COMMAND that the TuyAPI GET method implements.
{"schema": true} allows the user to establish that proper communications with the tuya device can occur WITHOUT actually changing the present STATE of the device.  This is the only command that will query the tuya device.

The current documentation says that you can query the tuya device over the "dps" TOPIC but from what I see the present state of the software does not force the tuya device to respond when using the "dps" TOPIC.

Since {"schema": true} is a command that forces a response from the tuya device, this command has been implemented under the "command" TOPIC. So "command" is the action and '{"schema": true}' becomes the command.  The response is returned just like all other commands.  I, use this command to guarantee communications has been established with the tuya device.  If this "schema" command fails, tuya-mqtt will indicate the result in the openhab.log file and then I, can find out what is physically wrong with the communications.  If this command fails the first time due to "socket" error and then goes through on the second attempt then I know that the error was due to TCP communications problem on initial startup.  This command helps as a work-a-round for the "ERROR: socket problem"
2019-04-20 09:29:01 -04:00
KarstenSiedentopp
cfefbabe90 ADD: support to toggle device state 2019-04-09 19:23:15 +02:00
KarstenSiedentopp
59acf6d2a4 UPD: CHANGELOG 2019-04-09 18:44:41 +02:00
KarstenSiedentopp
1485ae0689 added debug informations 2019-04-09 18:20:16 +02:00
KarstenSiedentopp
7a9dde716c UPD: README and CHANGELOG 2019-04-09 18:20:03 +02:00
KarstenSiedentopp
e9e46a7b77 added project changelog 2019-04-08 18:24:42 +02:00
KarstenSiedentopp
998028fa1c update project informations 2019-04-08 18:24:27 +02:00
KarstenSiedentopp
18ebcbdd74 MOD: remove device type from topic if not set 2019-04-08 18:14:45 +02:00
KarstenSiedentopp
86e602d6cf ADD: capability to set multiple dps values 2019-04-08 17:09:59 +02:00
KarstenSiedentopp
7637a372f7 updated tuyAPI to version 4.0.4 2019-04-08 17:07:30 +02:00
KarstenSiedentopp
dd2385f6e2 updated TuyAPI to v 4.x 2019-02-20 22:25:28 +01:00
Karsten Siedentopp
b0c84bb7b7 added contributor crashdummymch v2.0.0 2019-02-16 16:40:59 +01:00
crashdummymch
285b36014e package.json version update (#13)
I kept running into problems with the version of tuyapi set to the original value and kept exiting with exit code 99.  When I updated the version to the latest version in github for tuyapi all issues were resolved.
2019-02-16 16:32:50 +01:00
KarstenSiedentopp
9f6b350a17 removed custom set function 2019-02-09 17:24:24 +01:00
KarstenSiedentopp
8afa1782de tuyapi updated 2019-02-09 12:28:05 +01:00
KarstenSiedentopp
5381137684 added Contributors to readme 2019-01-24 18:22:05 +01:00
KarstenSiedentopp
bc4d84b3e4 added default QoS of 2, if not set through config.json 2019-01-24 18:15:58 +01:00
KarstenSiedentopp
c38b7e9087 should fix #11 2019-01-24 17:59:04 +01:00
tsightler
2c7ed22e14 Update to work with OpenHAB 2.4 MQTT Bindings (#8)
* Update tuya-mqtt.js

* Update tuya-mqtt.js

* Revert "Update tuya-mqtt.js"

This reverts commit 2ecd4260b163093a5886ced280ec57dc6d9f5145.

* Revert "Update tuya-mqtt.js"

This reverts commit 9f093db868c0af6cedbd98762f5885cdd844cd53.

* Updates for OpenHAB 2.4 MQTT binding

Update for OpenHAB 2.4 MQTT binding to act on message in addition to topic

* Update README.md

* Update README.md
2019-01-10 09:22:28 +01:00
TheAgentK
3b63fda413 Merge pull request #6 from Tycale/fix_package_json
Fix package.json and package-lock.json
2019-01-02 19:26:15 +01:00
Gérondal Thibault
1d4a690941 Fix NPM WARN: No repository field
Let's ```npm install``` stop complaining.

Signed-off-by: Gérondal Thibault <contact@tycale.be>
2019-01-01 23:32:49 +01:00
Gérondal Thibault
9c4149c2b5 Update NPM package-*json
With a fresh clone of this repository, doing a 'npm install' on linux and mac
os x result in modified package.json and package-lock.json. I guess we should
then publish them modified.

Signed-off-by: Gérondal Thibault <contact@tycale.be>
2019-01-01 23:31:43 +01:00
TheAgentK
4940d6eb44 Merge pull request #5 from Tycale/configuration
Move configuration file + ability to connect to a protected MQTT server
2018-12-31 16:39:16 +01:00
Gérondal Thibault
56478b1559 Add ability to connect to protected MQTT server
Signed-off-by: Gérondal Thibault <contact@tycale.be>
2018-12-29 20:17:33 +01:00
Gérondal Thibault
97cf57d0a3 Check that the configuration file exists
Signed-off-by: Gérondal Thibault <contact@tycale.be>
2018-12-29 20:00:13 +01:00
Gérondal Thibault
2310302907 Move configuration file
Configuration file should not be versioned, let's give an example one to copy.

Signed-off-by: Gérondal Thibault <contact@tycale.be>
2018-12-29 19:34:06 +01:00
TheAgentK
6cfaf8f5ab Update issue templates 2018-12-19 19:07:33 +01:00
TheAgentK
c6f9ec55ad Merge pull request #4 from TheAgentK/add-license
Create LICENSE
2018-12-19 19:05:35 +01:00
TheAgentK
9af8d49158 Create LICENSE 2018-12-19 19:05:12 +01:00
KarstenSiedentopp
b86038a5eb Merge branch 'master' of github.com:TheAgentK/tuyaapi_openhab 2018-12-19 19:02:11 +01:00
KarstenSiedentopp
e89f691fb8 new dps topics type error fixed
fixes #3
2018-12-19 19:01:14 +01:00
KarstenSiedentopp
f1ce54ccaf new dps topics type error fixed 2018-12-19 18:43:42 +01:00
KarstenSiedentopp
c499a20d74 update documenation of dps values 2018-12-19 18:20:34 +01:00
KarstenSiedentopp
f66d41bfc3 added all dps values to mqtt topic 2018-12-19 18:15:34 +01:00
KarstenSiedentopp
c78063a15b package cleanup 2018-12-19 18:00:11 +01:00
KarstenSiedentopp
e943c1e070 move mqtt config to seperate file 2018-12-19 17:52:54 +01:00
KarstenSiedentopp
efac9fa6da added comments and updated color calculation 2018-12-10 19:01:10 +01:00
TheAgentK
b466a3a9f9 Update README.md 2018-12-10 14:21:16 +01:00
TheAgentK
b4227d44f5 removed unnecessary comments 2018-12-10 13:40:10 +01:00
TheAgentK
756e94d5cf Update README.md 2018-12-10 13:24:10 +01:00
TheAgentK
8048474cf7 Added examples for change color 2018-12-10 13:22:50 +01:00
TheAgentK
bfee13126d Update README.md 2018-12-10 13:15:42 +01:00
TheAgentK
86a693741c Update README.md 2018-12-10 13:14:55 +01:00
KarstenSiedentopp
eb531c0388 package updated & added more error messages 2018-12-09 16:22:23 +01:00
KarstenSiedentopp
d6f4df3e97 update documentation 2018-11-26 16:31:09 +01:00
KarstenSiedentopp
e1be123c0a update package and code cleanup 2018-11-26 16:12:39 +01:00
KarstenSiedentopp
debe4968d2 updated mqtt script to event based TuyAPI 2018-10-27 18:31:49 +02:00
KarstenSiedentopp
16c3ad67cd stabelized some functions and added hsl color support 2018-07-29 14:17:54 +02:00
KarstenSiedentopp
2f7e7f4b88 update tuyaapi-extended and added debugger 2018-07-28 15:13:36 +02:00