jasonacox / tinytuya

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

DPS query code present in mapping from devices.json but not returned by tinytuya server /device/<DeviceID> #430

Open JRB202 opened 7 months ago

JRB202 commented 7 months ago

Hi Jason,

I have a problem with this hardware (Open DIN switch) and tinytuta server https://www.amazon.fr/gp/product/B09FPD3LMZ/

From devices.json : "category": "dlq", "product_name": "breaker", "product_id": "hz2o2tnezttmmx15", "biz_type": 18, "model": "ZC01W",

Device version as returned by tinytuya server command /device/ is 3.3

The problem : DPS 6 code "phase_a" is present in mapping but not returned by tinytuya server /status/ command This DPS contains Voltage, Current and Load encoded in a raw bitmap. The only way I found to access this DPS 6 code "phase_a" i is python code like :

d = tinytuya.OutletDevice(PLUGID, PLUGIP, PLUGKEY) d.set_version(PLUGVERS) data = d.turn_on() print('Received Payload: %r' % data)

==> How can I access this DPS 6 code "phase_a" from a tinytuya server ?

Thanks for help

Jean-Régis

jasonacox commented 7 months ago

Hi @JRB202 - you are right, the server I rather opinionated about which devices it supports. We need an abstraction API to make it easier to mange these less standard devices. I'll leave this issue open as an enhancement to add something, more low level, for these types.

JRB202 commented 6 months ago

Thanks for answer Keep me informed about next progress on this subject

jasonacox commented 6 months ago

I won't have time to work on this anytime soon, so you or anyone in the community are free to try to update the code and submit a PR. 😁