-
Notifications
You must be signed in to change notification settings - Fork 591
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
power plug turn off and back on for no reason #152
Comments
ok the issue I described above was actually user error. One of my automations was unnecessarily turning the plug off when it was already off causing the state of the sensor to flicker. I fixed that by putting a condition before the action in the automation. What is annoying though is that the transitioning between states has always the intermediate state "unavailable". This causes issue with automations when the defined conditions include "on" to "off" transitions and viceversa for example. |
You should not see any |
@rdeangel That looks really strange, but at least there are a few errors. Can you post the error log? |
see logs here: localtuya_logs.txt |
Are you using the tuya integration as well? You have to disable that. Looks like one of the devices always fail to decide the incoming payload. Did you configure via YAML or config flow? If YAML, how does the config look like? |
Initially I deleted the tuya integration and tried to get everything to work with localtuya but I was not succesfull. I use the tuya integration along with localtuya because I couldn't get localtuya to change the state of the plug (on and off), I can only successfully read the energy readings with localtuya (except for the issue mentioned). Also because Tuya is unable to read the plug status in realtime when switched via the plug button I use the localtuya state changes (on and off) to update the tuya integration switch object. I assumed localtuya was unable to change the state of my plug (I thought it was odd, but I'm guessing based on what you said that it should work fine) I configured it manually with yaml and tried both styles of config, switch and sensor based, both had issues. |
Ok, so I'm not really sure where we are right now. Based on the log earlier, I got the feeling that you had multiple power plugs, was that the case? It would be great if you could test according to this:
|
I'm afraid it just won't work, I'm using "switch" instead of "binary_sensor" and while I can monitor the plug, I can't interact with it without tuya. See file attached (I tried to soft switch from off to on (twice) from the switch.localtuya object but the soft button just goes back to off after a couple of seconds and I get the error "Failed to set DP 1 to 1" at the same time) |
I get the feeling that something isn't quite working with the encryption. Would it be possible for me to get access to the plug somehow so I can try some things out? It would be a lot easier than trying to pass commits bank and forth. |
"Would it be possible for me to get access to the plug somehow" how do you suggest? these are the plugs btw: |
Preferably if we could set up a tunnel of some sort or if you could hook it up to a virtual machine I can access. I would need some way to run python code and connect to it. |
Sure I can create an ubuntu vm and a wifi on an isolated vlan and give you access to do your tests via zerotier. Does that work? |
Sounds perfect 👌 |
All working now. This was not a bug rather just the plain and old user error, for not having set the correct key. Watch out by the way, when you reassociate the plug or device with the smart app your local_key changes, so you need to go and check what it is again. Thanks @postlund for your help, I hate to waste someone's time, but that's just what I did in this occasion. |
I noticed that when monitoring a power plug with flactuating energy reading which constantly change the power plug occasionally turns off and immediately powers back on.
This stops when I remove it from localtuya.
I also have to use both localtuya and the regular tuya integration in order to power on and off the plug. I don't seem to be able to change the on and off status with localtuya alone.
The text was updated successfully, but these errors were encountered: