localtuya
localtuya copied to clipboard
Lights Turn Off
After latest update I noticed after HA restart and also Local Tuya intergration reload lights connected with Local Tuya turn off.
Anyone else ?
There is some new logic in the code to restore device state after HA restarts (where HA saves the current state every 15 mins or so). However the states wouldn't have been saved prior to the code coming in, so may have triggered a turn-off after the initial restart.
Does this happen every restart / reload?
Yeah on every restart of HA or local tuya reload.
That's puzzling - there's another piece of code in this release which initialises entities with a default/last value when Tuya doesn't provide a status value (Passive DPS Devices). But that should only be activated if the "Restore the last set value in HomeAssistant after a lost connection" setting is ticked under the entity settings.
By default that setting should be off. Could you double check the localtuya entity setup for the light to make sure that option is not ticked (it's at the bottom of the entity setting)
I‘ve got the same problem. The option in the integration setup isn’t ticked.
I do not have such setting anywhere or I am so dumb I cannot find it.
Same issue here after updating to the latest version, i also do not have any such item
I do not have such setting anywhere or I am so dumb I cannot find it.
The setting is in integrations-localtuya-configure-edit device. You need to select the device and go to the bottom of the last page.
It doesn't exist mate
The setting is in integrations-localtuya-configure-edit device. You need to select the device and go to the bottom of the last page.
If you mean these last also empty.
following this as my power sockets turn off - not good for a fridge =(
My sockets fortunately did not have this but because of the fear and I also have some in critical spots such as fridge I rolled back a version and everything is good.
It doesn't exist mate
I think the setting only exists for sockets
It doesn't exist mate
I think the setting only exists for sockets
Then surely it defaults to off, either way this is a bug and I'm sure the dev will look in to it soon :)
Yep - i've been thinking about it more, and I think it might be the new RESET command. Ironically this code has probably been tested the most (was sourced from 2 different PRs), but I believe it might be responsible for the behavior we're seeing here.
I'll write up a change to soft-disable it, so that it doesn't get used unless the RESET parameters are setup in the device setup and see if that makes a difference.
I've made a change in PR #1022 - if you could test that out, that would be appreciated.
following this as my power sockets turn off - not good for a fridge =(
I think (or hope) what is occuring in your space is the RESET command is essentially confusing your device, meaning it doesnt report a value for DPS 1 (assuming this is the switch DPS). Then the new passive DPS code is recognising that you should have a status for DPS 1 and setting it to a default value (false), thus turning it off.
Apart from the RESET fix (that i'm getting people to test), you can change the 'default fail-safe' to be true by editing the device through the localtuya "Edit Device" dialog flow. When you get to the switch config, where it says "Default value where un-initialised" enter True here. This means that if HA ever can't receive a status (and doesn't have one saved), it will send a 'true' for the value.
I have noticed an issue which I think is likely related to this also. My pet feeder has started to dispense food the same as if you selected '1' serving whenever HA or the localtuya integration is reloaded. I believe it is likely due to the value being loaded at runtime. (It uses DP 3 for this and DP 15 to report back). I have made the changes mentioned in PR #1022 but it doesn't seem to have made any difference. (After making the changes I restarted HA) I haven't had a chance to remove and re-add the feeder yet though so I will try tomorrow and see if that makes a difference. (Although my cat doesn't seem to mind)
I have noticed an issue which I think is likely related to this also. My pet feeder has started to dispense food the same as if you selected '1' serving whenever HA or the localtuya integration is reloaded. I believe it is likely due to the value being loaded at runtime. (It uses DP 3 for this and DP 15 to report back). I have made the changes mentioned in PR #1022 but it doesn't seem to have made any difference. (After making the changes I restarted HA) I haven't had a chance to remove and re-add the feeder yet though so I will try tomorrow and see if that makes a difference. (Although my cat doesn't seem to mind)
It might be related - When you re-test, if it's still occurring, can you raise this as a new issue?
My floor fan turned on everytime I restarted HA....
same here. my garage door opener started to open on tuya device reconnect ( my wifi not stable in garage). rolling back. horrible logic.
Same for me. Led lamp was switching on when wi-fi reconnect happened. This didn't happen with my second lamp, that's why I think this is a hardware issue. So I put in Aqara E1 switch to avoid accidental "light on" during the night. Now my lamp switching off after a 3 seconds delay when I switch it on. Started to see this behavior right after the update.
So I've updated the PR #1022 to make the passive DPS restore logic explicit - i.e. an entity needs to be specified as a 'passive entity' for this to fire. This should fix all the issues with these other devices. Anyone who's interested in testing can find the updated code in the PR.
So I've updated the PR #1022 to make the passive DPS restore logic explicit - i.e. an entity needs to be specified as a 'passive entity' for this to fire. This should fix all the issues with these other devices. Anyone who's interested in testing can find the updated code in the PR.
Looks good here, (my cat is less than impressed though). Cheers
I hope this PR fix gets pushed soon, majority of my switches are randomly turning off/toggling. I have to rollback to 4.0.1 just to avoid this issue.
edit: for some reason 4.01 and 4.02 still exhibiting the issue, 4.0 did get rid of the issue though.
the issue starts popping up if one of these cases met:
- restart HA
- reload localtuya
- and a simple of having a tuya device goes unavailable, once it got recovereed and reconnected to localtuya, it gets the same issue which is insane, I had my fans turning off in the middle of the night.
Hello I have such problems in my configuration. Can you please explains how to rollback the LocalTuya integration to 4.0.2 ?
Hello I have such problems in my configuration. Can you please explains how to rollback the LocalTuya integration to 4.0.2 ?
Same steps as you download it through HACS, by default the drop down selection is set to latest, just click that drop down selection abd that should list the oldsr versions, select a veraion you want to downgrade and click download.