-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
My plug can't quite be read by tuyapower. I think I have the info necessary for my purpose, but I thought I would share what I have anyway.
When running tuyapower.devicePrint(), I get this output:
ERROR: Incomplete response
TuyaPower (Tuya Power Stats) [0.0.25] tinytuya
Device bf3941f72d7e45f9a805hw at 192.168.1.113 key 8dd38d7f9323a97b protocol 3.3
:
Switch On: False
Power (W): -99.000000
Current (mA): -99.000000
Voltage (V): -99.000000
Projected usage (kWh): Day: -2.376000 Week: -16.632000 Month: -72.072000
Running tuyapower.deviceRaw() return no further insight: it returns None.
However, based on what I found in #15 I tried the following script:
a = tinytuya.OutletDevice(PLUGID, PLUGIP, PLUGKEY, 'device22')
a.set_version(3.3)
a.set_dpsUsed({'1': None, '18': None, '19': None, '20': None})
data = a.status()
print(data)
Now, the response contains all the required info, but formatted in a rather different way:
{
'dps': {
'1': True, // Switched on
'18': 494, // 494 mA
'19': 995, // 99.5 W
'20': 2428 // 242.8 V
},
't': 1618440938 // unix timestamp for the moment of the request
}
(newlines and comments added by me)
Metadata
Metadata
Assignees
Labels
No labels