46 Commits

Author SHA1 Message Date
Alex M
f865e259a1 Added friendly topics for the devices behind gateway
You can now use:
tuya/gw1/lv/dps/2/command
instead of tuya/zgw1/2342cd828dfsxckkk/dps/2/command
2024-02-19 19:42:02 +03:00
lehanspb
eb800133a0 Some comments 2023-02-15 10:37:22 +03:00
tsightler
aa80270ba2 Update 3.0.1 (#61)
* Script to merge device additions and changes into devices.conf (#49)
* Add republish on reconnect
* Filter additional invalid characters '+','#','/' from topic line (replace with '_')
* Minor bugfixes for parse values
* Include script for merging new devices into existing config
* Update dependency

Co-authored-by: tsightler <tsightler@gmail.com>
Co-authored-by: Doug Krahmer <doug.git@remhark.com>
2020-12-23 20:22:09 -05:00
tsightler
b29b98911a Revert "Dev (#60)"
This reverts commit 44a5c6adbf.
2020-12-23 20:18:39 -05:00
tsightler
44a5c6adbf Dev (#60)
3.0.1 Update
* Script to merge device additions and changes into devices.conf (#49)
* Fix typos in README.md
* Add republish on reconnect
* Filter additional invalid characters '+','#','/' from topic line (replace with '_')
* Minor bugfixes for parse values
* Include script for merging new devices into existing config
* Update dependency

Co-authored-by: tsightler <tsightler@gmail.com>
Co-authored-by: Doug Krahmer <doug.git@remhark.com>
2020-12-23 20:10:29 -05:00
tsightler
d61c1f7cee Release 3.0.0
3.0.0 Release

Major changes from 2.1.0:
* Completely new configuration engine
* Completely new topic structure
* New template engine for creating friendly topic structure from raw DPS values
* Pre-defined templates for some common devices
* Directly control devices via Tuya JSON topic or via DPS key topics
2020-10-18 20:53:58 -04:00
tsightler
748a5cae39 Minor enhancements
* Properly disconnect from devices on exit
* Monitor for Home Assistant status and resend discovery
2020-10-15 11:05:41 -04:00
tsightler
60b50c760e 3.0.0-beta4
* Default to generic device
* Improved debugging granularity/increased categories
* Add heartbeat monitoring for availability
* Catch more failure cases with retry (still some missing I'd guess)
* Switch to MathJS evaluate for simple math transforms
* RGBTW: Switch base scale for all friendly topics to 100 (automatic conversion on backend)
* RGBTW: Add color temperature support
* RGBTW: Improve autodetection
* RGBTW: Improved white/color mode handling (still work to do here)
2020-10-12 16:14:22 -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
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
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
01fd5abcff Merge branch 'dev' into master 2020-09-17 20:41:12 -04: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
279590eb71 Support for manual protocol 3.3
Add support to explisitly set protocol version.
2019-06-22 23:31:38 -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
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
1485ae0689 added debug informations 2019-04-09 18:20:16 +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
dd2385f6e2 updated TuyAPI to v 4.x 2019-02-20 22:25:28 +01:00
KarstenSiedentopp
9f6b350a17 removed custom set function 2019-02-09 17:24:24 +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
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
KarstenSiedentopp
e89f691fb8 new dps topics type error fixed
fixes #3
2018-12-19 19:01:14 +01:00
KarstenSiedentopp
f66d41bfc3 added all dps values to mqtt topic 2018-12-19 18:15:34 +01:00
KarstenSiedentopp
e943c1e070 move mqtt config to seperate file 2018-12-19 17:52:54 +01:00
KarstenSiedentopp
eb531c0388 package updated & added more error messages 2018-12-09 16:22:23 +01:00
KarstenSiedentopp
e1be123c0a update package and code cleanup 2018-11-26 16:12:39 +01: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
KarstenSiedentopp
28c4f4e245 update tuya api extended 2018-07-28 13:54:00 +02:00
KarstenSiedentopp
41e619a3b0 removed old files 2018-07-26 18:57:25 +02:00
KarstenSiedentopp
b6ee6b4706 tuya extended class integrated and updated mqtt client 2018-07-26 18:54:27 +02:00
KarstenSiedentopp
2e2d5801d3 tuya mqtt client added and code seperation 2018-06-23 13:25:40 +02:00
K. Siedentopp
1612b97115 initial script 2018-06-11 09:37:52 +02:00