jasonacox / tinytuya

Python API for Tuya WiFi smart devices using a direct local area network (LAN) connection or the cloud (TuyaCloud API).
MIT License
937 stars 167 forks source link

Hints on missing DPS 42-44 for Version 3.3 - Plug, Switch, Power Strip Type #231

Open anno73 opened 1 year ago

anno73 commented 1 year ago

Hi!

I have a tuya "Aubess Smart Socket 20A/EM" branded smart socket with energy measurement identical to https://www.youtube.com/watch?v=mG4bAAHluMU.

While playing around in the Smart Life app with tuya-mqtt logging turned on, I figured out the usage of

Maybe this helps in any way and you want to extend https://github.com/jasonacox/tinytuya#version-33---plug-switch-power-strip-type with this information.

If you need more examples to decode the payload just let me know.

Br, Alex.

uzlonewolf commented 1 year ago

42: base64 decode "AQEAPgOIATIBrA==" is 01 01 00 3e 03 88 01 32 01 ac

"01 01 00 3e 03 88 01 32 01 ac" most likely breaks down as: 01 = Enabled 01 = Sunday 0x003e = 62 / 60 = 1.0333 = 01:02 (1:02 am) 0x0388 = 904 / 60 = 15.0667 = 15:04 (3:04 pm) 0x0132 = 306 / 60 = 5.1 = 5h 6m 0x01ac = 428 = 7.1333 = 7h 8m

43: base64 decode "AQIDDgC4" is 01 02 03 0e 00 b8 01 = Enabled 02 = Monday 0x030e = 782 = 13.0333 = 13:02 (1:02 pm) 0x00b8 = 184 = 3.0667 = 03:04 (3:04 am)