Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gosund SP1 plug doesn't refresh power data without app running #34

Open
katonagl opened this issue Nov 17, 2023 · 2 comments
Open

Gosund SP1 plug doesn't refresh power data without app running #34

katonagl opened this issue Nov 17, 2023 · 2 comments

Comments

@katonagl
Copy link

My Gosund SP1 power meter plug does not refresh power data unless the smartlife app is running. I have tried all DPS update tricks found but no success. What can be the problem? The final goal would be to use it completely offline, i.e. without internet access.

@jasonacox
Copy link
Owner

That does happen to with some devices.

Did you try this?

import tinytuya
import time

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

data = d.status()
print(data)

print(" > Wait 5 sec < ")
time.sleep(5)

print(" > Request Update < ")
result = d.updatedps()
# some require params that you wish updated
#result = d.updatedps(['18','19','20'])
print(result)

print(" > Fetch Status Again < ")
data2 = d.status()
print(data2)

print("")
print("Before %r" % data)
print("After  %r" % data2)

You could also try: https://github.com/jasonacox/tinytuya/blob/master/examples/monitor.py

@czytelny
Copy link

czytelny commented Feb 26, 2024

d.updatedps() was the way to go for me.

I had the same problem that every time I read:
tuyapower.deviceJSON(PLUGID2,PLUGIP2,PLUGKEY2,PLUGVERS2) I received "frozen" values - for example for 1 hour voltage was exactly the same.
So I modified the script so that before calling for deviceJSON I'm doing:

device = tinytuya.OutletDevice(PLUGID, PLUGIP, PLUGKEY)
device.set_version(3.3)
device.updatedps()

Thanks to that I'm always getting newest data :) maybe this will be useful for somebody

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants