From 604256709ada8747568b6aec06206a396c543c44 Mon Sep 17 00:00:00 2001 From: tsightler Date: Tue, 18 Jun 2019 22:48:59 -0400 Subject: [PATCH 1/4] Update README.md --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 69a7427..573ca67 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,16 @@ This project provides an MQTT client for communication with the home automation :exclamation: There is a greate Step-By-Step guide from user HolgiHab at openhab community ([Step-By-Step Guide]( https://community.openhab.org/t/step-by-step-guide-for-adding-tuya-bulbs-smart-life-to-oh2-using-tuya-mqtt-js-by-agentk/59371)). This guide is not only for light bulbs, but also applies to sockets. :exclamation: +:exclamation: This branch of tuya-mqtt provides initial support for Tuya devices using firmware that implements the 3.3 tuya protocol (fully encrypted communications). Because tuyapi requires specifying the protocol version when using the device IP, this required modifications to the script to either support specifying a version, or use the tuyapi auto discovery function which finds devices via UDP and allows it to auto-detect the protocol. + +To support this you can now replace the IP address in the topic with the word "discover" and the script will find the IP of the devices and automatically detect to correct protocol version. This has the added advantage that, if the IP of the device changes, no changes are required to the topic. To use automatic IP discovery the format of the topics are as follows: + +``` + tuya///discover/state + tuya///discover/command +``` +:exclamation: + ## Instructions: Download this project to your openhab2-script-folder "/etc/openhab2/scripts" and install tuyapi from the same folder that the tuya-mqtt.js is in @@ -54,6 +64,9 @@ URL to [DEBUG](https://www.npmjs.com/package/debug) ### MQTT Topic's (send data) + +*NOTE* that you can replace with "discover" to have the API attempt to automatically discover the IP address. This capability allows support for 3.3 protocol devices without additional configuraiton but does require the system running this script to be on the same IP subnet as the Tuya device because discover relies on UDP broadcast from the devices. + ``` Change device state (by topic): tuya////command/ From a747e122c6238e5de3f1fed7ece5eadc946888d9 Mon Sep 17 00:00:00 2001 From: tsightler Date: Tue, 18 Jun 2019 22:52:34 -0400 Subject: [PATCH 2/4] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 573ca67..548fce7 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,8 @@ URL to [DEBUG](https://www.npmjs.com/package/debug) ### MQTT Topic's (send data) -*NOTE* that you can replace with "discover" to have the API attempt to automatically discover the IP address. This capability allows support for 3.3 protocol devices without additional configuraiton but does require the system running this script to be on the same IP subnet as the Tuya device because discover relies on UDP broadcast from the devices. +**IMPORTANT NOTE** +**It's possible to replace the device IP address \ with the word "discover" to have the API attempt to automatically discover the device IP address. This capability allows support for 3.3 protocol devices without additional configuraiton but does require the system running this script to be on the same IP subnet as the Tuya device because discover relies on UDP broadcast from the devices.** ``` Change device state (by topic): From c6e88ac08b7bb067eb0b136760ea4c3818f0bbbb Mon Sep 17 00:00:00 2001 From: tsightler Date: Tue, 18 Jun 2019 22:53:56 -0400 Subject: [PATCH 3/4] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 548fce7..822e604 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,8 @@ URL to [DEBUG](https://www.npmjs.com/package/debug) ### MQTT Topic's (send data) -**IMPORTANT NOTE** +**-----IMPORTANT NOTE-----** + **It's possible to replace the device IP address \ with the word "discover" to have the API attempt to automatically discover the device IP address. This capability allows support for 3.3 protocol devices without additional configuraiton but does require the system running this script to be on the same IP subnet as the Tuya device because discover relies on UDP broadcast from the devices.** ``` From 6f0e03d3f2700a47d25c17baa7cd1e47edeede8b Mon Sep 17 00:00:00 2001 From: tsightler Date: Tue, 18 Jun 2019 23:04:18 -0400 Subject: [PATCH 4/4] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 822e604..a2671d0 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ This project provides an MQTT client for communication with the home automation :exclamation: There is a greate Step-By-Step guide from user HolgiHab at openhab community ([Step-By-Step Guide]( https://community.openhab.org/t/step-by-step-guide-for-adding-tuya-bulbs-smart-life-to-oh2-using-tuya-mqtt-js-by-agentk/59371)). This guide is not only for light bulbs, but also applies to sockets. :exclamation: -:exclamation: This branch of tuya-mqtt provides initial support for Tuya devices using firmware that implements the 3.3 tuya protocol (fully encrypted communications). Because tuyapi requires specifying the protocol version when using the device IP, this required modifications to the script to either support specifying a version, or use the tuyapi auto discovery function which finds devices via UDP and allows it to auto-detect the protocol. +:exclamation: This branch of tuya-mqtt provides initial support for Tuya devices using firmware that implements the 3.3 tuya protocol (fully encrypted communications). Because tuyapi requires specifying the protocol version when the device IP is specified directly, this required modifications to the script to either support setting the protocol version, or use the tuyapi auto discovery function. This code attempts to implement the minimum changes required to provide support for this protcol via a simple implementation of automatic device discovery. -To support this you can now replace the IP address in the topic with the word "discover" and the script will find the IP of the devices and automatically detect to correct protocol version. This has the added advantage that, if the IP of the device changes, no changes are required to the topic. To use automatic IP discovery the format of the topics are as follows: +To support this it is now possible replace the IP address in the topic (tuyAPI-key) with the word "discover" which will trigger the script to use the automatic device discovery capability. This has the added advantage that, if the IP of the device changes, no changes are required to the topic. To use automatic IP discovery the format of the topics are as follows: ``` tuya///discover/state