All Projects → Apollon77 → ioBroker.tuya

Apollon77 / ioBroker.tuya

Licence: MIT license
ioBroker adapter to connect to several small and cheap Wifi devices that care connected to the Tuya Cloud and mostly use the Smartlife App/Alexa-Skill

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to ioBroker.tuya

ioBroker.backitup
Backitup enables the cyclical creation of backups of an IoBroker / Homematic installation
Stars: ✭ 43 (-32.81%)
Mutual labels:  iobroker, iobroker-adapter
ioBroker.meross
ioBroker Adapter to integrate Meross Cloud based devices
Stars: ✭ 22 (-65.62%)
Mutual labels:  iobroker, iobroker-adapter
ioBroker.vw-connect
ioBroker Adapter for VW We connect and Skoda connect
Stars: ✭ 57 (-10.94%)
Mutual labels:  iobroker, iobroker-adapter
ioBroker.octoprint
ioBroker adapter to manage your 3D printer over ioBroker
Stars: ✭ 31 (-51.56%)
Mutual labels:  iobroker, iobroker-adapter
ioBroker.ring
Ring Video Doorbell Adapter
Stars: ✭ 25 (-60.94%)
Mutual labels:  iobroker, iobroker-adapter
ioBroker.discovergy
Receive all data of Discovery API into ioBroker to have your energy consumption and delivery monitored
Stars: ✭ 15 (-76.56%)
Mutual labels:  iobroker, iobroker-adapter
ioBroker.telegram
Use Telegram service to communicate with ioBroker
Stars: ✭ 51 (-20.31%)
Mutual labels:  iobroker, iobroker-adapter
ioBroker.google-sharedlocations
An ioBroker-adapter for retrieving shared locations from Google
Stars: ✭ 58 (-9.37%)
Mutual labels:  iobroker, iobroker-adapter
ioBroker.lametric
Send notifications and other important information to your LaMetric time
Stars: ✭ 15 (-76.56%)
Mutual labels:  iobroker, iobroker-adapter
ioBroker.linkeddevices
Create linked objects (datapoints) of your devices with a self-defined structure. This makes it possible to create a structure in ioBroker, where all objects are centralized, e.g. to be used in the vis or scripts.
Stars: ✭ 17 (-73.44%)
Mutual labels:  iobroker, iobroker-adapter
ioBroker.smartcontrol
Control devices smarter: by grouping, including triggers like motion, opening window, etc. and set target devices accordingly
Stars: ✭ 20 (-68.75%)
Mutual labels:  iobroker, iobroker-adapter
ioBroker.gardena
An ioBroker adapter for Gardena Smart System.
Stars: ✭ 12 (-81.25%)
Mutual labels:  iobroker, iobroker-adapter
RaspberryPi-Packet-Sniffer
An HTTP and HTTPS sniffing tool created using a Raspberry Pi
Stars: ✭ 79 (+23.44%)
Mutual labels:  wifi
WifiIndoorPositioning
🚀 Evaluation of Location of the device using RSSI values of Access Points and Reference point which are made from Wi-Fi readings
Stars: ✭ 83 (+29.69%)
Mutual labels:  wifi
tuya-iotos-embeded-sdk-wifi-ble-bk7231t
TuyaOS Embedded SDK is designed to promote the development of smart products with BK7231T that enables communication over Wi-Fi and Bluetooth Low Energy (LE).
Stars: ✭ 32 (-50%)
Mutual labels:  wifi
anon-hotspot
On demand Debian Linux (Tor) Hotspot setup tool
Stars: ✭ 34 (-46.87%)
Mutual labels:  wifi
LibTeleinfo
Librairie Universelle Teleinformation (TIC)
Stars: ✭ 77 (+20.31%)
Mutual labels:  wifi
tuya-iotos-embeded-sdk-wifi-ble-bk7231n
Tuya IoTOS Embeded SDK WiFi & BLE for BK7231N
Stars: ✭ 21 (-67.19%)
Mutual labels:  wifi
WifiBarcodeSample
Sample code for my article in DotNetCurry magazine on scanning barcodes. In this sample you can generate and scan QR codes that contain a Wi-Fi connection string
Stars: ✭ 13 (-79.69%)
Mutual labels:  wifi
ioBroker.knx
connect KNX via eibd
Stars: ✭ 46 (-28.12%)
Mutual labels:  iobroker

Logo

ioBroker.tuya

Number of Installations Number of Installations NPM version

Test and Release Translation status Downloads

This adapter uses Sentry libraries to automatically report exceptions and code errors to the developers. For more details and for information how to disable the error reporting see Sentry-Plugin Documentation! Sentry reporting is used starting with js-controller 3.0.

ioBroker adapter to connect to several small and cheap Wifi devices that care connected to the Tuya Cloud and mostly use the Smartlife App/Alexa-Skill. The adapter supports reading real time status updates and controlling of those devices once synced with the respective mobile phone app.

Tuya devices are ESP8266MOD WiFi smart devices from Shenzhen Xenon.

Beside devices usable with the Smart Live App the use of the Jinvoo Smart App, Xenon Smart app, eFamilyCloud, io.e (Luminea or such) app should also be possible. Please report back if successfull. The Adapter only works with Tuya and compatible apps as long as their version is <3.14 (!!)

The adapter is proofed to work very well with all devices that are "always in wifi". Devices that only come online when there is an event, send their data and go offline again are not supported. This means that battery powered devices usually DO NOT work!

One adapter instance can handle all devices in one network that routes UDP packages.

Compatible Mobile Apps and versions

The currently versions of the Tuya Smart and also Smartlife App are no longer compatible with the way the adapter works because Tuya encrypted all traffic that the adapter could sniff. For now still some older versions of the Apps work ...

  • Smartlife App <3.14, best 3.12.6!!
  • Tuya Smart App <3.14, best 3.12.x
  • STL Smart Home App 1.1.1 (last dated Sept 2019)
  • Ucomen Home App (??)

Important note

If the devices are not correctly detected via their UDP packages you can set the IP manually by editing the device object. see #221 (comment)

How the adapter works

Basic functionality

The adapter monitors the local network for UDP packets of Tuya (old firmware, so unencrypted only) devices. It is needed that the ioBroker host where the adapter runs on is placed in the same network segment as the devices and UDP multicasting needs to be supported by the router!

All detected devices are added to the adapter and as basis functionality the adapter requests data in the defined polling interval. Without a sync with the respective mobile app (see below) NO further functionality like real time updates or controlling is possible.

Newer encrypted devices will NOT show up before you do a device sync (see next ...)

Advanced functionality after device sync

To get the full functionality of the adapter and also support devices with the new encrypted Firmware an encryption key needs to be known by the adapter.

The easiest way to receive this encryption key is to get them from the used mobile app. To do this the adapter provides a proxy to catch the communication of the app with the tuya servers and grab the needed information.

Important Note for iOS Users: The Proxy approach described here is not working anymore. As soon as you have Smart Life App version 3.10 or higher the communication from App is no longer visible to the proxy. But it still works with all Android App versions, so the best approach is an Androis Emulator as roughly described at https://forum.iobroker.net/topic/23431/aufruf-tuya-adapter-tests-verschl%C3%BCsselte-ger%C3%A4te/19

To do this first of all you need to add a custom Root-Certificate on your mobile device. When you click "Start Proxy" in the adapter instance configuration the certificate is created for your system and shows a QR-Code to the download location. Ideally scan the QR Code with your mobile device and follow the process to add and trust this Root-Certificate. If the QR code location is not reachable (may happen when use Docker or such) then open the "Proxy Web Info Port" in your browser and click on "Root-CA" in the navigation and you can download the CA File too.

Now make sure to close/kill the respective Tuya smart app. After that add the Proxy-Port and the ioBroker host as "Manual" Proxy for your WLAN connection on your mobile phone.

Now open the respective Tuya Smart App and/or reload.

The Admin configuration will show a success message if the relevant data packet was received and will then turn the proxy off 10 seconds later. You can now remove the proxy from your phone and also untrust the certificate.

Directly after this the objects should be updated with more meaningful names and receive live updates from then on automatically and should be able to communicate.

The sync is only needed initially or after you added new devices to your App.

Some images for some mobile OS can be found at the Proxy-Page.

Not for Battery powered devices

Battery powered devices are normally NOT supported by this adapter! The reason is that they are not online all the time to save power. Whenever they get a signal, they go online, send the update to the the Tuya cloud servers and go offline again. They do not emit any UDP packages or are online long enough so that the adapter could connect to them. A soon as someone finds a way to directly fetch data from the Tuya cloud this may change.

Credits

The work of the adapter would not had been possible without the great work of @codetheweb, @kueblc and @NorthernMan54 (https://github.com/codetheweb/tuyapi) and https://github.com/clach04/python-tuya and many more.

Todo

  • enhance testing: state checks and setState's
  • enhance documentation

How to report issues and feature requests

Please use GitHub issues for this.

Best is to set the adapter to Debug log mode (Instances -> Expert mode -> Column Log level). Then please get the logfile from disk (subdirectory "log" in ioBroker installation directory and not from Admin because Admin cuts the lines). If you do not like providing it in GitHub issue you can also send it to me via email ([email protected]). Please add a reference to the relevant GitHub issue AND also describe what I see in the log at which time.

Changelog

3.6.15 (2022-01-24)

  • (Apollon77) More schema information added
  • (Apollon77) Recreate Proxy SSL certificates once older than 3 months to prevent ssl errors

3.6.14 (2021-11-07)

  • (Apollon77) More schema information added

3.6.13 (2021-10-28)

  • (Apollon77) More schema information added

3.6.11 (2021-09-05)

  • (Apollon77) More schema information added

3.6.9 (2021-07-18)

  • (Apollon77) Adjust reconnect handling on initialization

3.6.8 (2021-07-18)

  • (Apollon77) Another fix on reconnect handling

3.6.7 (2021-07-18)

  • (Apollon77) Another fix on reconnect handling

3.6.6 (2021-07-17)

  • (Apollon77) Fix reconnect handling
  • (Apollon77) More schema information added

3.6.5 (2021-06-23)

  • (Apollon77) Make sure for enums values are set with correct type
  • (Apollon77) More schema information added

3.6.3 (2021-06-04)

  • (Apollon77) More schema information added
  • (Apollon77) Update tuyapi

3.6.2 (2021-05-10)

  • (Apollon77) type "bitmap" is a number
  • (Apollon77) More schema information added

3.6.1 (2021-04-11)

  • (Apollon77) More schema information added

3.6.0 (2021-04-02)

  • (Apollon77) Fix broken data updates because of tuyaapi change
  • (Apollon77) Optimize "json unvalid" cases by refreshing data manually differently
  • (Apollon77) More schema information added

3.5.9 (2021-03-28)

  • (Apollon77) More schema information added

3.5.8 (2021-03-24)

  • (Apollon77) More schema information added

3.5.7 (2021-03-18)

  • (Apollon77) Fix crash case (Sentry IOBROKER-TUYA-P9)
  • (Apollon77) More schema information added

3.5.6 (2021-02-09)

  • (Apollon77) More schema information added

3.5.4 (2021-01-30)

  • (Apollon77) Prevent crash cases (Sentry IOBROKER-TUYA-MG)
  • (Apollon77) More schema information added

3.5.3 (2021-01-13)

  • (Apollon77) More schema information added

3.5.2 (2020-12-24)

  • (Apollon77) More schema information added

3.5.0 (2020-12-10)

  • (Apollon77) More schema information added
  • (Apollon77) Try to decode "raw" values via base64

3.4.3 (2020-11-29)

  • (Apollon77) More schema information added

3.4.2 (2020-11-19)

  • (Apollon77) More schema information added

3.4.1 (2020-11-05)

  • (Apollon77) More schema information added
  • (Apollon77) fix IP lookup via UDP

3.4.0 (2020-10-29)

  • (Apollon77) update tuya-api library

3.3.15 (2020-10-29)

  • (Apollon77) More schema information added

3.3.14 (2020-09-15)

  • (Apollon77) More schema information added

3.3.12 (2020-08-26)

  • (Apollon77) More schema information added
  • (Apollon77) Crash case prevented (Sentry IOBROKER-TUYA-89)

3.3.11 (2020-08-18)

  • (Apollon77) More schema information added

3.3.10 (2020-08-02)

  • (Apollon77) More schema information added

3.3.9 (2020-07-16)

  • (Apollon77) More schema information added

3.3.8 (2020-07-09)

  • (Apollon77) Work around invalid data that are returned by some devices
  • (Apollon77) More schema information added

3.3.7 (2020-07-01)

  • (Apollon77) More schema information added

3.3.6 (2020-06-29)

  • (Apollon77) More schema information added

3.3.5 (2020-06-11)

  • (Apollon77) More schema information added
  • (Apollon77) Optimizations and fixes

3.3.2 (2020-03-19)

  • (Apollon77) Many new schemas added

3.2.3 (2020-03-08)

  • (Apollon77) Many new schemas added

3.2.2 (2020-02-08)

  • (Apollon77) New schemas added
  • (Apollon77) Better handle strange case where qrcode library is not existing

3.2.0 (2020-02-05)

  • (Apollon77) Many new schemas added
  • (Apollon77) Add Infos about compatible App versions with link to enhanced docs
  • (Apollon77) try to detect unsupported apps when trying to sync and write warning in logfile
  • (Apollon77) Switch Sentry to iobroker own instance hosted in germany

3.1.16 (2019-12-26)

  • (Apollon77) New schemas added
  • (Apollon77) prevent crash when proxy request had no hosts array

3.1.15 (2019-12-24)

  • (Apollon77) New schemas added
  • (Apollon77) prevent usage of invalid Port numbers

3.1.14 (2019-12-20)

  • (Apollon77) New schemas added
  • (Apollon77) prevent usage of invalid Port numbers

3.1.13 (2019-12-11)

  • (Apollon77) New schemas added

3.1.12 (2019-12-07)

  • (Apollon77) New schemas added
  • (Apollon77) Dependency update

3.1.11 (2019-12-06)

  • (Apollon77) New schemas added
  • (Apollon77) Dependency update

3.1.10 (2019-12-05)

  • (Apollon77) New schemas added

3.1.9 (2019-11-30)

  • (Apollon77) New schemas added
  • (Apollon77) Improve error handling for proxy web port

3.1.8 (2019-11-28)

  • (Apollon77) New schemas added
  • (Apollon77) Add check for invalid proxy port

3.1.7 (2019-11-26)

  • (Apollon77) New schemas added

3.1.6 (2019-11-25)

  • (Apollon77) New schemas added
  • (Apollon77) Optimize Sentry integration and dedupe errors

3.1.4 (2019-11-24)

  • (Apollon77) New schemas added

3.1.3 (2019-11-24)

  • (Apollon77) try to get rid of SSL errors with new proxies
  • (Apollon77) Many new schemas added
  • (Apollon77) Sentry added for error/exception/schema reporting
  • (Apollon77) Compact Mode added

3.0.0 (2019-09-03)

  • (Apollon77) Switch from AnyProxy to mitm ... hopefully get SSL-Proxy working again. Important: The Proxy is called "NodeMITMProxyCA"!

2.0.4 (2019-08-01)

  • (Apollon77) New schemas added
  • (Apollon77) removed a check so that also devices that use other message formats can be read

2.0.3 (2019-07-11)

  • (Apollon77) New schemas added
  • (Apollon77) removed a check so that also devices that use other message formats can be read

2.0.2 (2019-06-27)

  • (Apollon77) New schemas added
  • (Apollon77) Update all Dependencies
  • (Apollon77) Nodejs 6.x no longer supported!
  • (Apollon77) Support encrypted devices

1.0.8 (2019-03-08) [Unreleased]

  • (Apollon77) New schemas added

1.0.7 (2018-11-23)

  • (Apollon77) New schemas added, fixed one error

1.0.5 (2018-11-18)

  • (Apollon77) preserve device name too, New schemas

1.0.4 (2018-11-16)

  • (Apollon77) New schemas added

1.0.3

  • (Apollon77) New schemas added

1.0.2

  • (Apollon77) New schemas added
  • (Apollon77) Data are requested from the device after controlling because sometimes not all data seems to be updated automatically

1.0.1

  • (Apollon77) Automatically convert some value types like booleans better

1.0.0

  • (Apollon77) Add several new schema definitions
  • (Apollon77) Optimizations and bug fixes

0.1.3

  • (Apollon77) Add several new schema definitions
  • (Apollon77) Try to preserve names of objects. Sync with App via proxy will overwrite in any case!
  • (Apollon77) Optimizations and bug fixes

0.1.2

  • (BuZZy1337) Optimized Admin, thank you very much!

0.1.0/1

  • (Apollon77) development and first tests

License

The MIT License (MIT)

Copyright (c) 2018-2022 Apollon77 [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].