jasonacox / tuyapower

Python module to read status and energy monitoring data from Tuya based WiFi smart devices. This includes state (on/off), current (mA), voltage (V), and power (wattage).
MIT License
136 stars 20 forks source link

Smart Energy Meter #20

Open dpoitou-tlse opened 3 years ago

dpoitou-tlse commented 3 years ago

Hello, I have 2 smart energy meter, the first one has a firmware version 1.0.2 and the second is in 1.1.17. The first one is working fine and I can get the current and power with tuyapower.

The second one return with tuyapower Power data unavailable

import tuyapower
PLUGID = 'bfb9b29bca25f99a69aqla'
PLUGIP = '192.168.0.94'
PLUGKEY = 'XXXXXXXXX'
PLUGVERS = '3.3'
(on, w, mA, V, err) = tuyapower.deviceInfo(PLUGID,PLUGIP,PLUGKEY,PLUGVERS)
tuyapower.deviceInfo(PLUGID,PLUGIP,PLUGKEY,PLUGVERS)
=>> (136, -99, -99, -99, 'Power data unavailable')

Field '1' correspond to the total energy consumption but I can not see the real time power or the current consumption.

tuyapower.deviceRaw(PLUGID, PLUGIP, PLUGKEY, PLUGVERS)
=>> {'dps': {'1': 136, '10': 0, '16': True, '18': '111111111111'}}

It seems to be linked to a newer firmware. Do you plan a new upgrade to this firmware? Thanks for your help

jasonacox commented 3 years ago

Addressing this here: https://github.com/jasonacox/tinytuya/issues/55