Control Tuya devices with MQTT over LAN.
5.6K
Control Tuya devices with MQTT over LAN.
Important
For now, only v3.3 is supported as I only own devices using this version.
Run the docker image:
docker run -v $CONFIG_DIR:/app/config:ro gpajot/local-tuya
The minimal config is:
mqtt:
discovery_prefix: {YOUR_PREFIX_HERE}
hostname: 127.0.0.1
devices:
- name: My AC
model: Airton AC
config:
tuya:
id_: {DEVICE_ID_HERE}
address: {DEVICE_IP_HERE}
key: {DEVICE_KEY_HERE}
To control a device you will need these 3 things:
Important
This library does not provide support for getting these. See how to do that using any of those projects: - [tuyapi](https://github.com/codetheweb/tuyapi) - [tinytuya](https://github.com/jasonacox/tinytuya)Generous thanks to the maintainers of those tools for details on interfacing with Tuya devices.
Warning
Keep in mind that: - After pairing the devices, it's recommended to assign static IPs in your router. - If you reset or re-pair devices the local key will change. - You can delete your tuya IOT account but not the SmartLife one and devices should be kept there. - It looks like you can block the device access to internet from your router and still have it working.
This library is composed of three main components:
The Tuya protocol is responsible for handling communication details with the Tuya device. Its interface consists of an asynchronous method to update the device and exposes state changes via events.
See protocol module.
The device handles higher level functional logic such as buffering, constraints and specific device commands.
See device module.
Communication with home hubs through MQTT, supporting auto discovery.
See mqtt module.
Content type
Image
Digest
sha256:55b00e545…
Size
33.5 MB
Last updated
3 days ago
docker pull gpajot/local-tuya