I’ve been following the GitHub thread - well done on persevering, and they were very helpful!
What seems to have happened is that check_data() often produces the device storage is full error, and the python-broadlink project knows this.
As a result, they have added a try...except line for the check_data command in the broadlink_cli script, which basically ignores the device storage is full error if it appears, and carries on with the rest of the learning.
So it appears I need to update my tutorial to not use the low level commands from the python console, but just use the broadlink_cli script instead.
Possibly, I only have an IR remote! It looks like find_rf_packet() is the low level function, instead of enter_learning(), but I think the way you were instructed on the GitHub thread (using broadlink_cli) is what I’ll implement in the tutorial.
My steps are relevant for installation on Raspberry Pi OS.
I followed @hafniumzinc 's guide verbatim until the point of learning the RF codes.
When I tried learning the codes using the two methods @hafniumzinc mentioned (python-broadlink/broadlink-mqtt), both methods failed and returned the “device storage is full” message.
In that thread @felipediel suggested I use the following command in terminal from the /home/pi/python-broadlink/cli folder: python3 broadlink_cli --device "0x61a2 192.168.1.6 24dfa7b9c689" --rfscanlearn
This command allowed me to learn the RF codes and returned the codes in the terminal (make sure to fill-in your personal RMx device type, IP and MAC address).
After I got all my RF codes, I downloaded the latest broadlink binding jar file here, and copied it into OpenHAB’s addons folder /usr/share/openhab2/addons
Next, I followed this guide to install the Map Transformation in OpenHAB. To build my broadlink.map file, and copy it into the /etc/openhab2/transform folder. And lastly, to add the corresponding control buttons to my sitemap.
Thanks a lot for this guide @hafniumzinc!
It helped me indeed a lot. Just got an RM4C and integrated it with ease into my current mqtt boker.
I am able now to, at least via mqtt commands, control my TV and Xiaomi Mibox. Only got issues with my Samsung AC as somehow the hex codes are always different on each command (i.e. single on/off button push, hex codes is every time different).
Also need to continue integrating this into OH (for now only did the Mibox Power On/Off as example), hence need to think on how to translate i.e. volume up/down etc. into it.
Just want to thank @hafniumzinc for the tutorial; while I use the Broadlink binding rather than MQTT, his instructions, which augmented the python-broadlink docs and made them easier for a Python novice to understand, made it possible for me to use the library to learn the RF codes I needed to provide to the binding to control my ceiling fan via a new, updated RM4 Pro.
@hafniumzinc Really appreciated it if you can explain in detail step in the Configure OpenHAB until the Sitemap . i dont get what to do after create these 2 text files
bridge.things
I have a separate file which just contains the bridge Thing to my Mosquitto MQTT broker:
broadlink.things
bedroomfan.js
Saved into the transform folder:
I need to turn on/off my AC through Openhab 2(or 3) with hour schedule !
You don’t need a Sitemap to do this - you want to start looking at Rules. That’s all beyond the scope of this tutorial, but you might be able to do what you want just with the new UI in OH3.
I have to do it with a RM4 mini so this post is helpful so far but I’m stuck at Configure OH. I got the IR signal record via python-broadlink that i can replay it on python by your step :
This huge string is the code which needs to be saved. To double check that it works, you can send this code through python-broadlink back to your RM4C Mini device, and see whether it has the desired effect (switch things on/off etc):
>>> devices[0].send_data(packet)
>>>
We now need to save this huge string so that broadlink-mqtt can use it.
How do i put it together in Openhab and replay that signal through Mqtt topic to Rm4 to just turn the AC on and off ? I’ve setup the Mqtt Broker, Generic Mqtt Thing.