Broadlink RM-PRO and TC2 switch

I used the script that ReneTode made the other night actually but without success, I just did it again and got the following… baring in mind I only have 1 switch called switch1 in econtrol:

switches:
  switch1_1-Gang:
    friendly_name: switch1 1-Gang
    command_on: '6RRGAN8JCRYWCRYJCRYWCRYJCRYJFgkWCRYJFhYJFgkWCRYJFgkJFgkWFgkWCQkWCRYJ

FhYJCRYWCQkWFgkWCRYJCRYWCQkAAUg=’
switch1_1-Gang:
friendly_name: switch1 1-Gang
command_on: ‘6RRGAN8JCRYJFhYJFgkWCQkWFgkWCRYJFgkJFgkWFgkJFgkWFgkJFhYJCRYJFhYJCRYJFhYJFgkJ
FgkWCRYJFgkWCRYJFgkAAUg=’

group:
switch1:
name: switch1
view: yes
entities:
- switch.switch1_1-Gang
- switch.switch1_1-Gang

Edit:

So this is what my config file looks like now:

switch:
platform: broadlink
host: 192.168.0.6
mac: ‘XX:XX:XX:XX:XX’
timeout: 10
switches:
switch1:
friendly_name: “Test Switch”
command_on: ‘6RRGAN8JCRYWCRYJCRYWCRYJCRYJFgkWCRYJFhYJFgkWCRYJFgkJFgkWFgkWCQkWCRYJFhYJCRYW
CQkWFgkWCRYJCRYWCQkAAUg=’
command_off: ‘6RRGAN8JCRYJFhYJFgkWCQkWFgkWCRYJFgkJFgkWFgkJFgkWFgkJFhYJCRYJFhYJCRYJFhYJFgkJ
FgkWCRYJFgkWCRYJFgkAAUg=’

That looks right to me based on the rest of this thread, you may have to add

‘AAA==’

to the end of each command.

Why just AAA==? Are you determining ‘AAA==’ because of my output or just saying that because its a generic addition to the end. Sorry I’m just trying to understand, not intending to be rude.

One other question though and relating to what I previously asked… even if the code it’s sending is wrong, surely when I push the “on lighting bolt” in HA I should at least see the RM PRO flash orange as in it’s trying to send the signal, wrong or not?

Just checked my logs and this happens every time I push the switch… I think:

The ‘AAA==’ just makes sure the code has a definite finish and pads it out.

If it (the RMPRO) thinks the code is wrong it probably won’t send it.

That error looks like HA can’t find the code to send.

You need to format any yaml code with the </> when you paste it in here, so select it after pasting and press </> so that it is formatted so we can see the correct spacing (very important in yaml)

Here’s a snippet of my config file, it’s a fresh install basically as this pi will only be used to control these TC2 switches.

See here …
--------------------------------- V

So does the new code generate the same error? Are there any other errors in the log relating to the RMPro?

1 Like

Sorry I don’t understand what you’re suggesting I do?

The top bit tells you how to paste code to the forum :stuck_out_tongue:

The line under is asking if there are any setup errors in the HA log or does the new code work as expected?

The part I’m unsure of is:

You need to format any yaml code with the when you paste it in here, so select it after pasting and press so that it is formatted so we can see the correct spacing (very important in yaml)

See here …
--------------------------------- V

What do you mean by the “--------------------------------- V” ?

where the V is, is the button you press to format the code after selecting it < / > symbol

I’m very sorry I dont follow, I’m not a coder. Could you perhaps use it in my example?

Just looking again at the log from above and even currently again now when I push the button, right at the bottom this appears.

“AttributeError: ‘rm’ object has no attribute ‘senddata’”

It’s about how you use the forum to paste yaml code, see at the top of every forum message there is a blue box with a link in it explaining how to use the formatting tools i.e. < / > button at the top of the box you can see when you are typing a message.

without using the < / >

  • platform: broadlink
    host: ip addr
    mac: ‘mac addr’
    timeout: 15
    switches:
    vehosoundbar:
    friendly_name: “VehoSB”
    command_on: ‘JgB0AAABJpISFBETERQRFA8VEhISExITEzYSNxU0ETkUNhE3EzcSNxQ2EjYTExISEhQRFA0WEjcRFRETETYUNw48EjgROBETFQADBwcAAgUAASVJEgAMPgABJUoSAAw+/AciShEADD8AASlGFgAMOgABJUoSAA0FAAAAAA==’
    command_off: ‘JgB0AAABJpISFBETERQRFA8VEhISExITEzYSNxU0ETkUNhE3EzcSNxQ2EjYTExISEhQRFA0WEjcRFRETETYUNw48EjgROBETFQADBwcAAgUAASVJEgAMPgABJUoSAAw+/AciShEADD8AASlGFgAMOgABJUoSAA0FAAAAAA==’

with using < / >

- platform: broadlink
  host: ip addr
  mac: 'mac addr'
  timeout: 15
  switches:
    vehosoundbar:
      friendly_name: "VehoSB"
      command_on:  'JgB0AAABJpISFBETERQRFA8VEhISExITEzYSNxU0ETkUNhE3EzcSNxQ2EjYTExISEhQRFA0WEjcRFRETETYUNw48EjgROBETFQADBwcAAgUAASVJEgAMPgABJUoSAAw+/AciShEADD8AASlGFgAMOgABJUoSAA0FAAAAAA=='
      command_off: 'JgB0AAABJpISFBETERQRFA8VEhISExITEzYSNxU0ETkUNhE3EzcSNxQ2EjYTExISEhQRFA0WEjcRFRETETYUNw48EjgROBETFQADBwcAAgUAASVJEgAMPgABJUoSAAw+/AciShEADD8AASlGFgAMOgABJUoSAA0FAAAAAA=='

Are there any errors at the start of the log indicating that the RMPro is not being setup correctly?

mqtt:

switch:
  platform: broadlink
  host: 192.168.0.3
  mac: '34:EA:34:B5:0F:F7'
  timeout: 10
  switches:
    switch1:
      friendly_name: "Test Switch"
      command_on: '6RRGAN8JCRYWCRYJCRYWCRYJCRYJFgkWCRYJFhYJFgkWCRYJFgkJFgkWFgkWCQkWCRYJFhYJCRYWCQkWFgkWCRYJCRYWCQkAAUgAAA=='
      command_off: '6RRGAN8JCRYJFhYJFgkWCQkWFgkWCRYJFgkJFgkWFgkJFgkWFgkJFhYJCRYJFhYJCRYJFhYJFgkJFgkWCRYJFgkWCRYJFgkAAUgAAA=='


group: !include groups.yaml

Logs don’t show anything.

Hmm, it looks correct to me. Did you try concatenating two of the codes as specified earlier in this thread?

I just verified the yaml code and removed " !include groups.yaml" for now and it was all valid.

As in taking the code and just doubling up, sometimes up to 6 times?

I’m trying to do a test install on my PC but struggling here:

putting: pip install --use-wheel --no-index --find-links=https://github.com/sfbahr/PyCrypto-Wheels/raw/master/pycrypto-2.6.1-cp35-none-win_amd64.whl pycrypto

into CMD keeps yielding the error " Could not find a version that satisfies the requirement pycrypto (from versions: )
No matching distribution found for pycrypto"

Maybe the bit about the two codes concatenated, or you could try multiplying it up by 6. Not sure either would work but you never know. You could also try re-learning the codes. Perhaps someone with more experience of the TC2 could chime in :stuck_out_tongue:

Oh my word… I finally did it… I reinstalled Hassbian and started from fresh, it seems like my broadlink “package” was buggered, thanks for all your help Keith!!

Well I’m one step closer now, I managed to use the learn command to get the following 2 codes for my TC1 Gang switch:

JgCMAJSSFDYUNhQ2FBEUERQRFBEUERQ2FDYUNhQRFBEUERQRFBEUERQRFDYUERQRFBEUERQRFDYUNhQRFDYUNhQ2FDYUNhQABfWUkhQ2FDYUNhQRFBEUERQRFBEUNhQ2FDYUERQRFBEUERQRFBEUERQ2FBEUERQRFBEUERQ2FDYUERQ2FDYUNhQ2FDYUAA0FAAAAAAAAAAAAAAAA

JgBGAJSTFDUUNhM2ExITEhMSExITEhM2EzYTNhQRFBEUERQRFBEUNRQ2ExITNhMSExITNhMSExITEhM2ExITNhQ1FBEUNhMADQUAAA==

Edit: I got it working 100% finally!!

1 Like

So last night I managed to get my TC1 1 Gang switch to work.

Now on both of my TC2 switches every time I do the learn command I get:

Broadlink switch
Recieved packet is: AAAAAAAAAAAAAAAA

At least I’m getting signal every time haha.

Edit:

Ok I’ve found a work around to get the hex codes and for anyone else wondering I used the “RM Plugin” for Android, works well!

:smiley: well at least you have it working now, tho’ I think you shouldn’t need to use the RM plugin.