Closed FreddyFox closed 5 years ago
This is awesome. Thankyou @FreddyFox !
Hey again. Thanks for merging my fix so quickly! And great work with the binding. I find it really useful :)
Just a heads-up: Several users have reported some weird temperature measurements after sending a command to the RM2 device. I firmly believe this is also caused by not capturing the acknowledgment packet after sending a command. That is, after this:
there should also be a receiveDatagram("acknowledgment packet");
NOTE: It might be that the RM1 device does not send an acknowledgment packet! If so, the sendCode
-function should probably be explicitly implemented in BroadlinkRemoteModel2Handler.java as well.
Unfortunately I don't have a RM2 device that I can use to test.
Report of the bug: https://community.openhab.org/t/broadlink-binding-for-rmx-a1-spx-and-mp-any-interest/22768/272
Broadlink SP2-3 devices consistently report state OnOffType.OFF. This is due to the state being derived from the variable used to store the status command payload instead of the decrypted payload which is received. Additionally, the SP2-3 devices sends an acknowledgment packet when commanded to change its state. Since this packet is not captured immediately after the command is sent to the device, this packet is buffered and read the next time the status of the device is read. This means the acknowledgement packet is read as a status packet, causing openhab to misinterpret the device's state until this packet is cleared from the buffer and an actual device state packet is read.
This PR fixes both of these problems. Tested and verified on Ubuntu 16.04 and OpenHAB 2.2 (running in docker)
JAR: https://www.dropbox.com/s/iuocwozkz6v8by2/org.openhab.binding.broadlink-2.4.0-SNAPSHOT.jar?dl=0