Skip to content

Trying to control a smart fan using tinytuya #477

Answered by uzlonewolf
generalzu1 asked this question in Q&A
Discussion options

You must be logged in to vote

It's going to require some trial and error, but you should be able to do it without running the wizard.

Create a monitor script using https://github.com/jasonacox/tinytuya/blob/master/examples/monitor.py and, with it running, change the speed and mode in the phone app. You should see updates in the monitor script when you do that. Once you have the values for the different speeds/modes you can put together a script to control it. Something along the lines of:

import tinytuya
import time

FAN_DP = 3       # CHANGE TO WHAT THE MONITOR SCRIPT SHOWS

FAN_SPEED_LOW = 1    # CHANGE TO WHAT THE MONITOR SCRIPT SHOWS
FAN_SPEED_MEDIUM = 2 # CHANGE TO WHAT THE MONITOR SCRIPT SHOWS
FAN_SPEED_HIGH = 3   

Replies: 1 comment 10 replies

Comment options

You must be logged in to vote
10 replies
@generalzu1
Comment options

@jasonacox
Comment options

@generalzu1
Comment options

@uzlonewolf
Comment options

Answer selected by generalzu1
@generalzu1
Comment options

@generalzu1
Comment options

@generalzu1
Comment options

@generalzu1
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants