156 Commits

Author SHA1 Message Date
tsightler
38d3092af3 Update rgbtw-light.js 2020-10-05 09:56:04 -04:00
tsightler
d75e2189da Update tuya-device.js 2020-10-05 08:35:56 -04:00
tsightler
4ff6fc221e More RGBTW tweaks 2020-10-05 02:05:34 -04:00
tsightler
3705efaaed More RGB fixes 2020-10-04 23:34:37 -04:00
tsightler
6c72afd8ab Color support for HSBHEX 2020-10-04 01:04:54 -04:00
tsightler
3605037b69 Granular state updates
* State topics now only update if data for the specific DPS changed
* Rework RGBTW support for more reliable white/color mode switching
2020-10-03 22:41:57 -04:00
tsightler
df01beb8fc RGBTW light fixes 2020-10-03 13:32:48 -04:00
tsightler
9176b8f85c Reorganize tuya-device 2020-10-03 11:45:41 -04:00
tsightler
68d8743882 Fix for no template 2020-10-03 10:38:43 -04:00
tsightler
99f5358794 Remove console output 2020-10-02 23:24:42 -04:00
tsightler
f598d246cf 3.0.0-beta2
* Implement basic template model
* Generic device can specify template in devices.conf
* Simple switch, dimmer, and RGBTW specific support files
2020-10-02 23:16:53 -04:00
tsightler
1b33c60226 Update README.md 2020-09-30 20:21:22 -04:00
tsightler
56b87aa27e Update tuya-mqtt.js 2020-09-25 00:34:43 -04:00
tsightler
311144a9ed Update tuya-mqtt.js 2020-09-25 00:27:10 -04:00
tsightler
77b697f5bb Update tuya-mqtt.js 2020-09-24 15:30:47 -04:00
tsightler
1181f66c32 Device/DPS commands
* Add ability to set individual DPS values via <topic>/dps/<#>/command
* Can still use Tuya JSON via <topic>/dps/command
* Simple on/off sent to <topic>/command
* Brightness sent to <topic>/brightness_command
* Simple device type detection (currently only for sockets/switches/dimmers and non-RGB lights, other devices are unknown get DPS 1 on/off in state and all other values accessible via DPS
2020-09-22 01:01:43 -04:00
tsightler
d8a24d4e6f Use device.conf 2020-09-21 17:53:46 -04:00
tsightler
670a87e9fb Use devices.json for discovery
* Usese devices.json from "tuya-cli wizard" for device discovery, no topic config required
* Uses device discovery by default, but can manually edit devices.json to add IP address, protocol version, or change
* Creates short topic name using just "friendly name" or "id".
2020-09-21 00:23:31 -04:00
tsightler
d3b8b9244f Update feature_request.md 2020-09-18 12:00:05 -04:00
tsightler
3b60f3d4d5 Update bug_report.md 2020-09-18 11:56:43 -04:00
tsightler
390d81c893 Merge pull request #40 from TheAgentK/dev
Merge 2.1.0 with Master
v2.1.0
2020-09-17 22:02:54 -04:00
tsightler
b0549bf392 Merge branch 'master' into dev 2020-09-17 22:02:06 -04:00
tsightler
989834821a Update README.md 2020-09-17 21:58:17 -04:00
tsightler
9944f326c5 Update README.md 2020-09-17 21:57:38 -04:00
tsightler
df08c6fc8a Update README.md 2020-09-17 21:52:15 -04:00
tsightler
d05ac857d8 Update README.md 2020-09-17 21:50:10 -04:00
tsightler
868b0977b0 Update README.md 2020-09-17 21:47:21 -04:00
tsightler
82faeff78e Update README.md 2020-09-17 21:40:28 -04:00
tsightler
89a7bfd04d Release 2.1.0
* Merge protocol 3.3 support
* Update TuyAPI to 5.3.1
* Fixes for color settings issues with some devices
* Support to force device status update with schema query
2020-09-17 21:38:52 -04:00
tsightler
1bc87b513c Merge pull request #39 from tsightler/master
Merge protocol 3.3 support
2020-09-17 20:41:35 -04:00
tsightler
01fd5abcff Merge branch 'dev' into master 2020-09-17 20:41:12 -04:00
tsightler
9091398810 Merge pull request #35 from vkoop/feature/fix-documentation
fix missing string escaping in documentation
2020-09-17 20:27:22 -04:00
tsightler
65a9922a7f Merge pull request #21 from GadgetAngel/dev
This update allows for an essential TuyAPI command to be implemented and fixes issues with the TuyaColorLight.prototype.setColor Method label:enhancement
2020-09-17 20:27:08 -04:00
Viktor Koop
14fc702041 fix missing string escaping in documentation 2019-12-23 17:54:37 +01:00
tsightler
4a605f4536 Bump dependency to tuyapi 5.1.2
tuyapi 5.1.2 includes fix for memory leak so also removed hack for disconnect/reconnecting devices.
2019-07-31 23:55:15 -04:00
tsightler
ec8d2c62a5 Fix silly bug in discover/3.3 support
Fix silly bug in discover/3.3 support
2019-07-29 11:53:46 -04:00
tsightler
a554cd3f58 Work around memory leak in tuyapi >5.1.x
Work around memory leak in tuyapi >5.1.x
2019-07-29 08:03:06 -04:00
tsightler
fb79927020 Merge branch 'master' of https://github.com/tsightler/tuya-mqtt 2019-06-22 23:31:45 -04:00
tsightler
279590eb71 Support for manual protocol 3.3
Add support to explisitly set protocol version.
2019-06-22 23:31:38 -04:00
tsightler
6f0e03d3f2 Update README.md 2019-06-18 23:04:18 -04:00
tsightler
c6e88ac08b Update README.md 2019-06-18 22:53:56 -04:00
tsightler
a747e122c6 Update README.md 2019-06-18 22:52:34 -04:00
tsightler
604256709a Update README.md 2019-06-18 22:48:59 -04:00
tsightler
3b72a000c8 tuyapi 5.1.x and protocol 3.3
Initial update to work with tuyapi 5.1.x and support for Tuya protocol ver 3.3 via device discovery.
2019-06-18 22:32:18 -04:00
GadgetAngel
fa228074b3 Merge remote-tracking branch 'origin/dev' into dev 2019-04-26 04:47:14 -04:00
GadgetAngel
54745c4f8b 1. 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.
2. This update does not set dps 3 and dps 4 when setting the bulb in colour mode because some tuya bulbs ignore the dps 5 setting if you set either dps 3 or dps 4
3. This update uses the correct format for dps 5: if the bulb is in colour mode than the dps 3 and dps 4 are ignored but if you set it now some tuya bulbs will ignore dps 5 because you set dps 3 or dps 4
   A. So, FOR colour mode the bulb looks at dps 1, dps 2, and dps 5.
	i.   DPS 5 is in the following format:
	ii.  HSL to HEX format are the leftmost hex digits (hex digits 14 - 9)
	iii. hex digits 8 - 5 are the HSB/HSL Hue value in HEX format
    iv.  hex digits 4 - 3 are the HSB/HSL Saturation percentage as a value (converted to 0-255 scale) in HEX format
    v.   hex digits 2 - 1 are the HSB Brightness percentage as a value (converted to 25-255 scale) in HEX format

   B. if the bulb is in white mode then the dps 5 value is ignored by the bulb, FOR white mode the bulb looks at dps 1, dps 2, dps 3 and dps 4
	i.	 DPS 3 is the HSB/HSL Brightness percentage converted to a value from 25 to 255 in decimal format
    ii.  DPS 4 is the HSB/HSL Saturation percentage converted to a value from 0 to 255 in decimal format

{"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-26 04:46:15 -04:00
GadgetAngel
b5f1f1fd31 correct file
sorry for the screw up.....must be getting tired
2019-04-20 22:57:29 -04:00
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
TheAgentK
825b9f97ce Merge pull request #19 from TheAgentK/dev
Merge DEV version v.2.0.1

Closes #15
2019-04-09 20:08:22 +02:00