Big thanks to @ccutrer over on GitHub who suggested re-discovering the devices, and to @Nadahar for creating the reverted JAR and helping track down the root cause!
Here’s what I found:
Standard 5.1.0 after re-discovery:
Ceiling fans: Working great now!
String lights: Still cycling ONLINE/ Waiting for device wake up
Just upgraded to 5.1.0 and also saw the same behavior with two of my tuya devices. They were working fine on 5.0.1 and now are not reliable - sometimes commands go through, but mostly not. Also in logs I can see same cycling between ONLINE and ONLINE: Waiting for device wake up.
Yes. As my thing definitions are in files I have tried to comment them out, update, then uncomment and update again. Unfortunately, even after that things are still looping every second spoiling logs. Even though they are still looping through states automation rules were able to update their state at midnight and today evening. Unfortunately, I don’t have time today to try reverted JAR, but will do it as soon as I get some spare time
Now when I used it for some time I see some more issues - items are often jumping from ONLINE to OFFLINE and back:
22:54:23.686 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:tuyaDevice:315327763c6105909943' changed from ONLINE to OFFLINE
22:54:24.605 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:tuyaDevice:bedroom_1_curtain' changed from OFFLINE to ONLINE
22:54:25.021 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:tuyaDevice:3153277670039f187c3d' changed from OFFLINE to ONLINE
22:54:25.033 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:tuyaDevice:3153277670039f187c3d' changed from ONLINE to OFFLINE
22:54:28.694 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:tuyaDevice:315327763c6105909943' changed from OFFLINE to ONLINE
22:54:28.700 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:tuyaDevice:315327763c6105909943' changed from ONLINE to OFFLINE
22:54:30.041 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:tuyaDevice:3153277670039f187c3d' changed from OFFLINE to ONLINE
These devices with number ids are added after discovery from UI. The ones with “normal” named ids are added through file configuration.
All of these devices are mains-powered, so that’s not normal behavior for sure. Due to these cycling some devices do not respond to commands (apparently when they cycle to OFFLINE).
And just to confirm that it’s not about devices anyhow I tried to operate them with tuya application and that works without any issue and stable as a rock
Be aware that when replace a bundle, it might revert to the original if you restart OH or install/uninstall an add-on - depending on how you install the bundle. I think putting the bundle in the addons folder is “most resistant to reversal”.
If you do a bundle:list you might be able to tell which is in use from some of the details, bundle:list -l might also be worth a shot, since it shows the “source address” of the bundle, which is different from the original (mvn: address) and one you have installed yourself.
Yes, I know that. I prepared three versions - original, reverted and newest from 5.1.x branch. None of them work correctly now
Original - cycling between ONLINE - ONLINE: Waiting for device wake up
Reverted - cycling between ONLINE - OFFLINE
5.1.x - cycling between ONLINE - ONLINE: Waiting for device wake up
I’m now thinking on building tuya addon from 5.0.x for 5.1.0 as it’s a bit annoying…
Not really. I have OH 5.1.0 and at first after installation of reverted addon I thought it was working ok by just quick checking logs (right after installation I didn’t notice cycling, so decided that everything is fine now). But after some time I noticed that some devices have not executed commands they should by daily rules and checked logs again (no restarts were done between these two events, so I’m sure that it was correct addon) and in the logs I noticed these ONLINE ←→ OFFLINE cycling now. Then I tried to remove things, which were cycling from file declaration and added them through discovery, but still cycling was present.
After that I checked the original issue on Github and noticed it being mentioned in another discussion, so found that there’s another fix, which is in 5.1.x branch already, so I checked it out and built latest addon, but after installation of that one things again got to cycle between ONLINE and ONLINE: Waiting for device wake up
And yesterday just to confirm I haven’t done anything wrong I prepared three jars and was switching between them and checking behavior
I just tried to reopen the ticket in Github, but I don’t have sufficient permissions. Therefore, I’ve asked the person who closed it to reopen it. @san4esmc Perhaps you could also comment there accordingly.
This looks exactly like issue discussed in openHAB 5.1 Release discussion and has nothing to do with Tuya addon. You can check this comment openHAB 5.1 Release discussion - #282 by Udo_Hartmann and search whole topic for postCommand.
This is an important hint IMO. If there’s a default value for this field, and it shouldn’t usually be true, the default should certainly be false. Somebody should verify that it is.