python-broadlink icon indicating copy to clipboard operation
python-broadlink copied to clipboard

Remotecentral.com

Open samsonrosen opened this issue 8 years ago • 23 comments

Hi!

There are a bunch of 'discrete IR codes' littering the internet specifically this page:

http://www.remotecentral.com/cgi-bin/mboard/rc-discrete/thread.cgi?5780

Is there a code converter I could use to translate it into a format the broad link device understands?

samsonrosen avatar Apr 29 '17 18:04 samsonrosen

None that I know... You could try using Sure Android App. It can send a IR code from its full database through a RMPRO device and you could use another one to learn it.. or simple use an android phone with IR blaster...

Oliv3rDog avatar Apr 29 '17 18:04 Oliv3rDog

If you are interested or experienced in programming, there is a issue talking about the analysis of Broadlink's IR/RF code https://github.com/mjg59/python-broadlink/issues/57 .

You can try to write a converter for it

a1aw avatar Apr 29 '17 18:04 a1aw

You can import these codes in IrScrutinizer. Using the export format "Broadlink-Python IR", you can generate python code for those commands. Just as an example, I impored the pages you linked to, and generated the export, found here. Let me know how/if it works.

bengtmartensson avatar Jun 03 '17 19:06 bengtmartensson

Thank you @bengtmartensson for being so helpful! I can't run this program myself. The mac app does not seem to load.

Are you able to help me again by doing this page? I think I pasted the wrong page before...

http://www.remotecentral.com/cgi-bin/mboard/rc-discrete/thread.cgi?6824

samsonrosen avatar Jun 11 '17 14:06 samsonrosen

@bengtmartensson - I've managed to install it on another Mac, imported the Broadlink-Python IR.

When I export the codes found on the page I linked and run it through BlackBeanControl I get the error "Input strings must be a multiple of 16 in length". I tried it with both your commands and mine. Do you think the original HEX could be wrong, or is it he conversion?

samsonrosen avatar Jun 11 '17 16:06 samsonrosen

The mac app does not seem to load.

Seems to work now. Instructions. Possibly JDK not installed?

When I export the codes found on the page I linked and run it through BlackBeanControl I get the error "Input strings must be a multiple of 16 in length".

Hmm, it works for me. How exactly do you invoke it? What is "BlackBeanControl"?

Do you think the original HEX could be wrong

No, IrScrutinizer barfs at invalid signals.

bengtmartensson avatar Jun 11 '17 16:06 bengtmartensson

Hi,

BlackBeanControl is a python script that lets you capture IR codes and then trigger them as a saved command.

I am pasting the exported results from IrScrutinizer into BlackBeanControl where I am receiving that error. An example of something BlackBeanControl will capture looks like this:

2600580000013094141314121512141215121413141314121436143614371436143614361536143614361536143614131412141314361413141214131412143714361436141314361400051900012f4915000c670001304914000d05 compared to what I am pasting from IrScrutinizer:

89891134113411341111111111111111111111341134113411111111111111111111111111111111113411341111111111341134113411341111111111341134111111000589.

I'm not sure if that helps you at all?

samsonrosen avatar Jun 11 '17 17:06 samsonrosen

No, that is not how it is supposed to be used. The exporter generates a python script that is to be executed by itself. It does not use BlackBeanControl. You only need to have broadlink in your PYTHONPATH. and use the command line parameters like broadlink_cli. For example, using my original gist,

python broadlink_python_ir_2017-06-03_21-37-37.py --host broadlink  --mac 294cf4***  'Device Code: 7.7 Function: 251'

where the last argument is the name of the command. (The silly name comes from the import.)

bengtmartensson avatar Jun 11 '17 17:06 bengtmartensson

Oh. I misunderstood.

Ultimately I am using the Broadlink RM with this homebridge plugin.

The intention is to paste the hex-code that the RM Mini Captures from an IR signal. However I am looking to take discrete IR Codes for the internet and paste those in.

Could IR scrutiniser be used for this purpose?

samsonrosen avatar Jun 11 '17 18:06 samsonrosen

Ultimately I am using the Broadlink RM

... but you asked here...

Could IR scrutiniser be used for this purpose?

Most likely yes. You only need to write, or have someone to write, an export format for that thing, along these lines. It is an xml file, reasonable easy to write.

bengtmartensson avatar Jun 12 '17 07:06 bengtmartensson

... but you asked here...

Hmm... what is the problem?

Most likely yes. You only need to write, or have someone to write, an export format for that thing, along these lines. It is an xml file, reasonable easy to write.

The program turns out as useless? I am wondering why the final output cannot be exported as a hex but a script?

a1aw avatar Jun 12 '17 10:06 a1aw

good news samsonren, issue 57 solves your problem.

The codes you have that are listed on that URL look like they are in "Pronto" format.

The program (Python Gist) provided by appden converts from Pronto format; into the byte-string format you are looking for. It also includes the zero-padding that makes it a multiple of 16.

I was even capable of running that python gist in an online python interpreter.

With some slight modifications you should see what I was doing here: https://repl.it/Josj/0

(Just follow the array format at the top, you can ignore the comments (the # lines) and copy and past the commands you want in.

Click the "Run" button at the top; and it should output the broadlink codes (with padding) on the right hand side.

pavram avatar Jul 30 '17 12:07 pavram

Wow @pavram – that's amazing and so simple to use.

Thank you so much!

samsonrosen avatar Jul 30 '17 17:07 samsonrosen

@samsonrosen Just connecting the dots that others created! Glad I could help.

pavram avatar Jul 31 '17 00:07 pavram

@pavram Can you please enlighten me, how do I use the script you linked to at https://repl.it/Josj/0 ?

You wrote: Just follow the array format at the top ignoring the comments... but what array are you referring to? I don't see that?

I feel very noob. Would appreciate your help.

rschuiling avatar Mar 16 '18 19:03 rschuiling

@rschuiling I think repl.it must have changed something. and must have removed comments or something. (And don't worry; it really was confusing. Took me a while to figure out what was needed for that code)

In short; the Main function at the bottom explains what is needed. I've made a new version that simplifies it.

https://repl.it/@Pavram/HastyJealousZebrafish

hopefully this one sticks around. I'm still not sure why the previous one went away.

at the top of the code you will see an array "CodesToConvert"

in it, it has 1 big string "0000 0011 ... 0000" (it continues over many lines) You can replace that string with the code you wish to convert.

Then click play at the top.

pavram avatar Mar 18 '18 01:03 pavram

@pavram Thanks Peter, now I understand what the script was meant to do. Now just to get the Broadlink codes working in Home Assistant's YAML... that's still a challenge it seems :)

rschuiling avatar Mar 19 '18 14:03 rschuiling

Hi. Not to threadjack, but could someone please point me to a tutorial or software to download remote codes to my new Broadlink RM3 mini? I can't manually teach it discrete codes for Power ON, Power OFF, HDMI2, etc, just the toggle switches on the original remote. Is this even possible? Thanks

jgcbaiz avatar Jul 18 '18 16:07 jgcbaiz

@jgcbaiz My first recommendation would be the SURE Universal Remote app. Should also be available for iOS. Not to teach it things, but the app contains a lot of discrete codes for a lot of devices.

rschuiling avatar Jul 18 '18 18:07 rschuiling

@rschuiling Thank you for your fast reply! However my final purpose is to create a "macro" for certain actions and have it run by asking Alexa, so I am pretty much stuck with Broadlink's IHC. Can this software be programmed to input discrete codes? Or is there a way of controlling SURE through an Amazon Echo? Thanks again

jgcbaiz avatar Jul 18 '18 19:07 jgcbaiz

I use Home Assistant for that. But I think that is overkill for your purpose. Sorry, don't know of a better solution.

rschuiling avatar Jul 18 '18 20:07 rschuiling

@rschuiling you pointed me in the right direction. I used my old Galaxy S6 (with a built in IR blaster) and donwloaded SURE. Then I used it to manually program Broadlink's RM3 using their IHC App. Thanks again!

jgcbaiz avatar Jul 19 '18 23:07 jgcbaiz

@jgcbaiz Great!

rschuiling avatar Jul 20 '18 06:07 rschuiling