tinytuya icon indicating copy to clipboard operation
tinytuya copied to clipboard

How to control WiFi smart heater?

Open thewh1teagle opened this issue 2 years ago • 1 comments

I tried to control wifi smart heater with this library the function get status working but the function dev.turn_off(switch=True) hangs the result of get status is:

{'devId': '', 'dps': {'1': True, '2': 0, '4': 11474, '5': 26943, '6': 2367}}

thewh1teagle avatar Mar 27 '22 08:03 thewh1teagle

Hi @thewh1teagle the switch parameter should be numeric (e.g. switch=1) and is used for outlets that have multiple switching plugs. You should just use something like this:

import tinytuya

# tinytuya.set_debug(True)

d = tinytuya.OutletDevice(DEVICEID, DEVICEIP, DEVICEKEY)
d.set_version(3.3)

d.turn_off()

jasonacox avatar Mar 27 '22 14:03 jasonacox