RM mini - Learn commands

Posted on
Sat Dec 14, 2019 11:59 pm
bsp9493 offline
Posts: 153
Joined: Nov 30, 2017
Location: Kelowna, BC

RM mini - Learn commands

Ok, so I’ve got the rm mini working with the app for the device. I can control all commands with its iPhone app.

Now the issue... Plugin device seems to work fine.

When i try to learn commands from my remote, it appears to learn... I save the recently learned command, then select it in the drop down and hit test. The em mini appears to send the command, but nothing happens on the device I am trying to control.

I am learning from a Cisco isb7150.

Any suggestions?

It learnt the volume commands for my Sonos device and tv on off no problem, but something seems to be up with the cisco remote learn

Thanx in advance
Last edited by bsp9493 on Fri Apr 24, 2020 10:50 am, edited 1 time in total.

Posted on
Fri Apr 24, 2020 10:49 am
bsp9493 offline
Posts: 153
Joined: Nov 30, 2017
Location: Kelowna, BC

Re: RM mini3 - Learn commands

Hey guys...

anyone else have issues with RM mini working, but NOT being able to control one specific device?

interestingly I have also used the Broadlink app to learn the commands and finally ended up loading a different profile that someone else had created (the OP's profile works fine), so I'm guessing it has something to do with translation between the learn and send.

I don't think it's the plugin. Just looking for thoughts to a solution.

Thanx in advance

dave

Posted on
Mon Apr 27, 2020 4:48 pm
bsp9493 offline
Posts: 153
Joined: Nov 30, 2017
Location: Kelowna, BC

Re: RM mini - Learn commands

so... after doing some research with other IR devices, it appears my particular pvr box requires a double send of the IR code. I hope I phrased that correctly. not just a double push of the button, but the code needs to be transmitted twice.

I know the RM is capable of controlling my device as I have found a remote profile via the broad link app that works, unfortunately, I can not find the raw codes associated with that profile.

anyone have any ideas on how I can possibly modify the plugin to "double" the code it transmits via indigo?

as always your help is appreciated.

Thanx in advance

d

Posted on
Thu Apr 30, 2020 12:23 pm
bsp9493 offline
Posts: 153
Joined: Nov 30, 2017
Location: Kelowna, BC

Re: RM mini - Learn commands

I think i got my device sorted out, will post here in case anyone else has a stubborn device and they want to give it a shot.

Overall, gotta love the RM mini (cheap little device that does the job)

So, for some reason, I had one device where the commands learnt by the rm mini would not actually work when transmitted. Narrowed it down to a stubborn device that needs to see the ir code in a specific way.

anyhow, found a few posts on the internet related to this and I hope it's ok to post here with reference.

1st off, you will need to get a hold of scrutinizer, used for analyzing IR signals, which can be found here:
http://www.harctoolbox.org/downloads/#Current+software

You will then need to find the specific device protocol information (similar to what's noted in the post below)
http://www.remotecentral.com/cgi-bin/mboard/rc-custom/thread.cgi?30540

This is for my application (Telus Optik PVR - which uses a generic Cisco format), however, this also appears to work for any device as long as you have the required details to convert to pronto hex (using scrutinizer - http://www.harctoolbox.org)

Here are function numbers for a CIS 430.  These match the two Pronto Hex signals given here for the CIS330.  The protocol is Nokia32 device 36.128.  Use IrMaster to convert these into Pronto Hex or some other formats.  For example, to generate the signal for Power, enter 36 into D, 128 into S, 12 into F, and set T to either 0 or 1. Type X=38 into additional parameters.

Power  Nokia32 36.128 function 12
0000 0073 0000 0012 000F 000A 0006 000A 0006 0016 0006 0010 0006 000A 0006 0016 0006 000A 0006 000A 0006 000A 0006 000A 0006 0016 0006 0010 0006 0016 0006 000A 0006 000A 0006 001C 0006 000A 0006 0CA5

Function
Number
0 = 0
1= 1
2 = 2
3 = 3
4=4
5=5
6=6
7=7
8=8
9=9
vol up=16
vol down=17
channel up=32
channel down=33
power=12
last (prev ch)=41
menu=84
program guide=204
up arrow=88
down arrow=89
left arrow=90
right arrow=91
select=92
play=44
pause=48
rewind=41
fast fwd=40
stop=49
record=55
exit=85
info=15
clear=158
replay=77
advance=156
interact=218
jump=10
livetv=242
multiscreen=59
phone=249
recording=241
search=64
tvvideo=232
a=56
b=57
c=134


once you have that, you can generate the Pronto Hex for each remote function you need in the next step.

I then managed to find a py script online that converts the Pronto Hex generated above. Within indigo I created an action group with an embedded py script to execute the code and do the conversion for me - modified to output the result to the indigo server log.

Code: Select all
#with help from https://repl.it/repls/StupidBiodegradableNanotechnology

import binascii
import struct


ProntoCodes = [
  # menu - add your code from iscrutinize here
#  "0000 0047 0000 001A 00D5 00D5 001B 0035 001B 006B 001B 0035 001B 0035 001B 0035 #001B 0035 001B 0035 001B 0035 001B 006B 001B 0035 001B 0035 001B 0035 001B #006B 001B #0035 001B 006B 001B 006B 001B 006B 001B 006B 001B 006B 001B 006B 001B 0035 001B 006B #001B 006B 001B 006B 001B 01AB",

  #Power Off - add your code from iscrutinize here
#  "0000 006b 0022 0002 015b 00b1 0016 0016 0015 0019 0013 0018 0014 0017 0017 0016 #0015 0017 0014 0043 0014 0017 0017 0040 0016 0040 0014 0044 0014 0044 0012 #0044 0015 #0043 0014 0018 0014 0043 0014 0043 0013 0043 0014 0043 0016 0041 0014 0043 0014 0043 #0012 0044 0014 001a 0012 0018 0014 0019 0016 0016 0014 0018 #0014 0018 0014 001a 0012 #0018 0014 0043 0016 0619 015b 0059 0014 0e93",

#codes to convert - replace with your list pronto hex codes from iscrutinizer ("code","code",etc)
"0000 0073 0000 0012 000F 000A 0006 000A 0006 0016 0006 0010 0006 000A 0006 0016 0006 000A 0006 000A 0006 000A 0006 0016 0006 0016 0006 0010 0006 0016 0006 000A 0006 0016 0006 0016 0006 001C 0006 0C7F",0000 0073 0000 0012 000F 000A 0006 000A 0006 0016 0006 0010 0006 000A 0006 0016 0006 000A 0006 000A 0006 000A 0006 0016 0006 0016 0006 0010 0006 0016 0006 000A 0006 0016 0006 0016 0006 001C 0006 0C7F",0000 0073 0000 0012 000F 000A 0006 000A 0006 0016 0006 0010 0006 000A 0006 0016 0006 000A 0006 000A 0006 000A 0006 0016 0006 0016 0006 0010 0006 0016 0006 000A 0006 0016 0006 0016 0006 001C 0006 0C7F",0000 0073 0000 0012 000F 000A 0006 000A 0006 0016 0006 0010 0006 000A 0006 0016 0006 000A 0006 000A 0006 000A 0006 0016 0006 0016 0006 0010 0006 0016 0006 000A 0006 0016 0006 0016 0006 001C 0006 0C7F",
  ]



def pronto2lirc(pronto):
    codes = [long(binascii.hexlify(pronto[i:i+2]), 16) for i in xrange(0, len(pronto), 2)]

    if codes[0]:
        raise ValueError('Pronto code should start with 0000')
    if len(codes) != 4 + 2 * (codes[2] + codes[3]):
        raise ValueError('Number of pulse widths does not match the preamble')

    frequency = 1 / (codes[1] * 0.241246)
    return [int(round(code / frequency)) for code in codes[4:]]

def lirc2broadlink(pulses):
    array = bytearray()

    for pulse in pulses:
        pulse = pulse * 269 / 8192  # 32.84ms units

        if pulse < 256:
            array += bytearray(struct.pack('>B', pulse))  # big endian (1-byte)
        else:
            array += bytearray([0x00])  # indicate next number is 2-bytes
            array += bytearray(struct.pack('>H', pulse))  # big endian (2-bytes)

    packet = bytearray([0x26, 0x00])  # 0x26 = IR, 0x00 = no repeats
    packet += bytearray(struct.pack('<H', len(array)))  # little endian byte count
    packet += array
    packet += bytearray([0x0d, 0x05])  # IR terminator

    # Add 0s to make ultimate packet size a multiple of 16 for 128-bit AES encryption.
    remainder = (len(packet) + 4) % 16  # rm.send_data() adds 4-byte header (02 00 00 00)
    if remainder:
        packet += bytearray(16 - remainder)

    return packet
   
   
for ProntoCode in ProntoCodes:   
  pcode = ProntoCode.replace(' ',"")
  pronto = bytearray.fromhex(pcode)
  pulses = pronto2lirc(pronto)
  packet = lirc2broadlink(pulses)
 
# comment out print as not needed by indigo (use for py shell)
#  print
#  print binascii.hexlify(packet)

# added for indigo log display
  broadlinkCode=binascii.hexlify(packet)
  indigo.server.log(broadlinkCode)


Once you have the output, open your broadlink device, enter a "new command name", copy the specific output line to the "raw command", "add command" and you should be good to go:)

This may seem like a lot of work, but it drives me nutz when I know there is the possibility to make something work. There may be better ways to do this, but this is what worked for me.

Why did I go through all this you ask? Basically wanted control of my TV/PVR via HomeKit and didn't want to spend a lot of money gaining control of my existing equipment (TV/PVR).

I can now say... "Hey Siri... turn on the Seahawks game." This will turn off all unneeded lights in my house, turn specific lights on in the room and change to Seahawks Colors, and turn the TV/PVR on and to the specific channel that the game is on.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest