Giter Site home page Giter Site logo

Comments (9)

BillSobel avatar BillSobel commented on June 23, 2024

from python-tuya.

law1964 avatar law1964 commented on June 23, 2024

The device is in an ON state before the script is executed.
I don't know how to answer your question because I don't know what a timer DP is. Please elaborate.
As far as I know, no other device affecting processes are running and nobody else touches the device except me.

from python-tuya.

BillSobel avatar BillSobel commented on June 23, 2024

from python-tuya.

law1964 avatar law1964 commented on June 23, 2024

Thanks for the explanation.
I used Alexa to turn on the light by saying "Alexa, turn on Desk Lamp" in the first place. Alexa would not set a countdown DP value.

from python-tuya.

clach04 avatar clach04 commented on June 23, 2024

@law1964 as @BillSobel said this sounds more like a timer (or another device). Like you I'm using Alex (with a skill using the cloud API, I'm not using a HA skill) and I'm not seeing this, I just tried you test code and I'm not seeing this.

Thoughts;

  • how many iterations/secs does it take for this to happen for you?
  • can you dump data['dps'] in your script before the if? If a timer is set, element 2 will be non-zero - this number does NOT change until the timer expires - or at least that's what I see with my devices ;-) - this would at least help prove/disprove the timer theory

from python-tuya.

law1964 avatar law1964 commented on June 23, 2024

I see that you changed the Alexa to the masculine form. I hope the operation went smoothly. :)

The following is the relevant portions of the data dump:

*** Polling started Fri, 29 Jun 2018 07:55:03 2 True
{u'1': True}
{u'1': True}
{u'1': True}
{u'1': True}
.
.
{u'1': True}
{u'1': True}
{u'1': True}
{u'1': True}
{u'1': False}
Fri, 29 Jun 2018 07:59:18 State has changed to 2 False
counter = 456
{u'1': False}
{u'1': False}

It took 456 iterations this time, but it varies. The print data['dps'] right before the if statement in the script shows that there is only one element.

It just twigged that dps could stand for "double pole switch". I was wondering what the acronym stood for...

I'm also wondering whether something is making the device reset. That would explain why it changes to False (OFF) and never to True (ON) while the program is running. I have also noticed that there is a small delay (a few seconds) before I get the message that the state has changed. Is there any way that I can test this?

from python-tuya.

law1964 avatar law1964 commented on June 23, 2024

I ran the test program a second time. It took longer the time for the light to turn off, about 27 minutes and 2963 iterations. There is definitely a delay between when the light turns off and when the program detects the change (see sample points in bold). At most, the delay should only be a second.

*** Polling started Fri, 29 Jun 2018 08:27:50 2 True
Fri, 29 Jun 2018 08:27:50
{u'1': True}
Fri, 29 Jun 2018 08:27:51
{u'1': True}
.
.
Fri, 29 Jun 2018 08:54:43
{u'1': True}
Fri, 29 Jun 2018 08:54:43
{u'1': True}
Fri, 29 Jun 2018 08:54:44
{u'1': True}
Fri, 29 Jun 2018 08:54:52
{u'1': False}

Fri, 29 Jun 2018 08:54:52 State has changed to 2 False
counter = 2963

from python-tuya.

jchulce avatar jchulce commented on June 23, 2024

I have two plugs impacted by this issue. They blink on and off by themselves several times an hour. I use pytuya via tuya-homeassistant. The impacted plugs are https://www.amazon.com/EPICKA-WiFi-Smart-Plug-2-Pack/dp/B076HKHSSX/ "EPICKA WiFi Smart Plug Mini (2-Pack) - Wireless Smart Plug Socket Outlet, Compatible with Amazon Alexa and Google Assistant, No Hub Required, Remote Control Your Devices from Anywhere". These are marked with model WP1000 model: SM-PW702 FCCID:2AJ5F. I have many other tuya plugs with different brands that work just fine, it's just that one model having the issue for me. I started using https://github.com/tixi/python-tuya-experimental earlier this week and have had issues since. Seems that persistent connections makes the issue go away.

from python-tuya.

aneisch avatar aneisch commented on June 23, 2024

Issue still persists it appears but only for some devices. Perhaps this is a firmware bug in particular Tuya devices/versions?

from python-tuya.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.