local-tuya-ceiling-fan
Control a Tuya Ceiling fan over LAN.
Features
- asynchronous methods and transport
- persistent communication to the device
- automatic remote device state updates (remotes can still be used)
- configurable buffering for subsequent updates
- constraints between device commands
- Domoticz plugin using a dedicated thread
Usage
See local tuya requirements first to find device information.
Example usage:
from local_tuya import DeviceConfig, ProtocolConfig
from local_tuya_ceiling_fan import FanDevice, FanSpeed
async with FanDevice(DeviceConfig(ProtocolConfig("{id}", "{address}", b"{key}"))) as device:
await device.switch(True)
await device.set_speed(FanSpeed.L2)
await device.switch(False)
💡 There is a safety mechanism that turns off the fan and waits 30s before changing the direction.
Domoticz plugin
The plugin requires having fetched device information using instructions above. Make sure to read plugin instructions first.
💡 The Domoticz version should be
2022.1or higher.
python -m pip install --upgrade local-tuya-ceiling-fan[domoticz]
python -m local_tuya_ceiling_fan.domoticz.install
Domoticz path defaults to ~/domoticz but you can pass a -p option to the second command to change that:
python -m local_tuya_ceiling_fan.domoticz.install -p /some/other/path
Restart Domoticz and create a new Hardware using Tuya Ceiling Fan. Fill in device information and add.
The hardware will create up to 5 devices to control the fan (all prefixed with hardware name):
power: turn the fan on or offspeed: set the speeddirection: set directionlight: turn the light on or offmode: set the operating mode
You can customize the devices you want added in the hardware page.
All device names and levels can be changed once added as only IDs are used internally.
Metadata
Release files for local_tuya_ceiling_fan 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| local_tuya_ceiling_fan-2.0.0.tar.gz | 4.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| local_tuya_ceiling_fan-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.5 kB
Release files / local_tuya_ceiling_fan-2.0.0.tar.gz
| Download URL | local_tuya_ceiling_fan-2.0.0.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f14c88797187ccada0376cb11b3453c555084feaa33ac29307926538c7aa02ea
|
|
BLAKE2b-256 checksum How to use checksums |
c2a4bcc0c8a6d853c785d9bed79d9f8ecd4574f2c8ae486628ffe883f31b1e8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.3 Linux/6.5.0-1018-azure
|
Release files / local_tuya_ceiling_fan-2.0.0-py3-none-any.whl
| Download URL | local_tuya_ceiling_fan-2.0.0-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8c22a79a814244ce80ee17c4a4f9e5d875bbce97f04852d90a6d40084aa9d78d
|
|
BLAKE2b-256 checksum How to use checksums |
d8c956c75a97b974279ee295aba1fc8c43bc0bde04bd3ae068e47ed2565ed7c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.3 Linux/6.5.0-1018-azure
|