mjg59 / python-broadlink

Python module for controlling Broadlink RM2/3 (Pro) remote controls, A1 sensor platforms and SP2/3 smartplugs
MIT License
1.38k stars 479 forks source link

Can we use learing code with arduino? (RM4 mini) #675

Closed spartakos87 closed 5 months ago

spartakos87 commented 2 years ago

Have anyone try to use learning codes from RM4 mini with arduino? My idea is to use rm4 mini to learning code of my AC and then use arduino or nodemcu to transmit these codes Any idea how to achieve this? Thanks

bengtmartensson commented 1 year ago

Use --durations:

 ./broadlink_cli --device @device --learn --durations
Learning...
+9688 -4827 +624 -591 +624 -591 +591 -624 +591 -624 +591 -624 +591 -591 +624 -591 +591 -1839 +591 -1806 +624 -1806 +591 -1839 +591 -1839 +591 -1806 +591 -1839 +591 -1839 +591 -1806 +591 -1839 +591 -1839 +591 -1806 +624 -1806 +591 -1839 +591 -624 +591 -591 +591 -624 +591 -624 +591 -624 +591 -624 +591 -591 +624 -591 +591 -1839 +591 -1806 +624 -1806 +591 -41805 +9655 -2430 +591 -103479 +9655 -2430 +624 -109456

These "durations" are in micro seconds and can be used in other tools, for example IrScrutinizer or (Arduino) IRremote.

Unfortunately, there is a problem with the current version; producing some errors. I will submit a PR fixing this, but in the meantime, just ignore the errors.