Vero V Remote and Receiver

Hi colleagues :slight_smile:

I just ordered my Vero V a couple of days ago and was wondering, if one can pimp the included remote, to control the volume of my Yamaha RX-V475.
At the moment I am using Yatse as my OSMC remote, which offers a Yamaha plugin, with which I can switch the volume buttons to control my Yamaha via network, instead of the OSMC/Kodi volume.
Is it somehow possible to manipulate that delievered OSMC remote so that the volume IR command will issue a different command, so that the volume of my receiver gets + or -?

The commands are sent via network, e.g. curl, and look like this for power on as an example:

/usr/bin/curl -X POST -H “Content-Type: text/xml; charset=UTF-8” -d “<YAMAHA_AV cmd="PUT"><Main_Zone><Power_Control>On</Power_Control></Main_Zone></YAMAHA_AV>” http://192.168.1.213/YamahaRemoteControl/ctrl

Or is there a way to replace the kodi volume keys by default with such commands or a small .sh script, so that the Vero remote will automatically also do volume + or -?

Or any other idea, except CEC, as the receiver is a bit older and currently only decodes audio via a HDMI splitter, so no CEC commands will pass to it.

It will be very slow and I don’t think holding down the button for big changes will work out too well, but you can keymap a button to run a python script. If you need to run a bash script you would have to make a python script that calls the bash script like…

import subprocess

cmd = '/bin/bash /home/osmc/script_down.sh'

results = subprocess.run(
    cmd, shell=True, universal_newlines=True, check=True)
print(results.stdout)

The keymap would be something like…

<?xml version="1.0" encoding="UTF-8"?>
<keymap>
	<Global>
		<keyboard>
			<volume_down>RunScript(/home/osmc/script_down.py)</volume_down>
		</keyboard>
	</Global>
</keymap>

Keymap reference [here]

It might be a bit more sane to just use multichannel PCM instead of passthrough and use Kodi’s volume control if CEC isn’t an option. The remote can’t send IR as it is RF only and basically just acts like a keyboard would.

Hm ok will give it a try, python is also good, doesnt need to be bash … :slight_smile:
Just waiting for the Vero V and then Ill set it up and test a bit, thanks so far to the input <3

Should ship by the end of the week.

Sam

Ok Vero V arrived yesterday, already implementing lots of stuff, also got lots of questions … hehe :slight_smile:
But starting here again: I created the scripts in .sh and the wrapper in .py, that works already.
Regarding the keymaps, my “.kodi/userdata/keymaps” folder is empty, where are the files used for the RF remote that was shipped along with the Vero? Or is it somehwere “builtint” and can only be altered with an extra file I create in that folder with a xml like graham posted?
Or is it changed/adjusted via GUI?

/EDIT: nevermind, got it to work :slight_smile:
Created a custom file in the keymaps folder and it simply works and is fast enough, very nice, love it <3

To answer the question anyway since I haven’t updated that guide I linked to in a while, the custom keymap is actually part of Kodi now as we upstreamed it so it would also work on other platforms. It can be found [here] and Kodi just loads it when it sees any of the OSMC RF remotes. Any valid keymaps you put in your userdata keymaps folder will override individual mappings.

I’m not sure what your referring to with what graham posted. I don’t see a post from him and I’m the only one around here that normally fields keymapping questions.

wops sorry, confused the names as I was reading in another post in parallel and mixed up the names, sorry :frowning:

Hey again, another question about this … ;>
I am trying to map some more butons, more specific: longpress
So I found this help page here: https://osmc.tv/wiki/general/osmc-remote—long-press-keymap-guide/

So, I extended my file under /home/osmc/.kodi/userdata/keymaps/osmc/vero_remote_vol.xml:

<?xml version="1.0" encoding="UTF-8"?>
<keymap>
        <Global>
                <keyboard>
                        <volume_down>RunScript(/home/osmc/avrVolDown.py)</volume_down>
                        <volume_up>RunScript(/home/osmc/avrVolUp.py)</volume_up>
                        <enter mod="longpress">RunScript(/home/osmc/leselicht.py)</enter>
                        <leftbracket mod="longpress">RunScript(/home/osmc/tvoff.py)</leftbracket>
                </keyboard>
        </Global>
</keymap>

Unfortunately, the buttons still have their original function and nothing changes :frowning: The two volume buttons still work as intended though. I also tested it with <key id="">, which also made no changes. I did restart mediacenter and also the complete Vero. What am I missing here?

The button in the middle of the direction keys maps to “return” not “enter” so you would need to change that. As for the other reason why it isn’t acting how your expecting the way I configured the custom keymap I noop’d (no operation/ignore) the long press in global to prevent undesirable behavior if someone holds it down on screens where you secondary function of that button didn’t have a logical action. Because of this there is specific mappings in windows where there is an action programmed to happen when it is held down. The way the keymapping system works is global is the fallback when a specific function isn’t programmed to the currently active window.

You can view the current keymap file [here] for reference for where those buttons are being mapped. You could map your commands to the specific window/s you want them to function in instead of global or alternatively you can leave those mapping in global and for each window they are currently mapped in you can remove that specific mapping by using an empty tag. For example if you wanted to remove the current mapping for the info button during playback in your keymap you could use the following…

	<FullscreenVideo>
		<keyboard>
			<leftbracket mod="longpress"/>
		</keyboard>
	</FullscreenVideo>

If you look at the end of that guide you referenced you will see a keymap example for “Make home button dedicated to CEC power control” and that shows how this is done with the home button.

1 Like

Thanks for the explanation, in my last test I switched it from return to enter, my fault…
But if I got you right, then the reason for the volume_up/down buttons work is, there is only one definition in the keymap you linked. So I overwrote the behaviour for this in global and as there are no more definitions, it just works the same everywhere.
And as return is defined multiple times in different scopes I only overwrote one definition, so it would only work there and the definitions for the other scopes are still active and would need to be disabled.

Hm ok will give it a try when I am back home and test :slight_smile:

Correct. Volume buttons shouldn’t normally do any secondary functions so they are only mapped in global, which means you only needed your userdata keymap to override in global.

Close, but I think you get the main gist. The mapping to “global” is the what will happen unless something is specified otherwise in any given window id. Global isn’t a window id, but any other mapping will be to a window id. If you turn on debug logging and navigate around the UI the Kodi log will actually show the name of the window when you enter and exit the screen. You also have to remember that the mappings are from ALL the loaded keymaps (these are also shown in Kodi’s log as well). Confusing, I know, but once you get the hang of it there is a lot of customization the system offers to get it to work to one’s preferences and use cases.

I’d suggest to just download a copy of that OSMC keymap from github and delete all the mappings other than the ones for those two buttons you’re interested in. You can then change the windows specific actions to ones that remove the mappings (ie <key>action</key> changes to <key/>) and that should leave your global action as the only programmed action.

1 Like

Ok got it, thanks :slight_smile:

I did it like this, instead of adding “noop’s” I just duplicated the actions hehe …

<?xml version="1.0" encoding="UTF-8"?>
<keymap>
        <Global>
                <keyboard>
                        <volume_down>RunScript(/home/osmc/avrVolDown.py)</volume_down>
                        <volume_up>RunScript(/home/osmc/avrVolUp.py)</volume_up>
                        <volume_down mod="longpress">RunScript(/home/osmc/avrSelSpeakers5.py)</volume_down>
                        <volume_up mod="longpress">RunScript(/home/osmc/avrSelSpeakers7.py)</volume_up>
                        <stop mod="longpress">RunScript(/home/osmc/leselicht.py)</stop>

                </keyboard>
        </Global>
        <Home>
                <keyboard>
                        <home mod="longpress">RunScript(/home/osmc/tvon.py)</home>
                        <leftbracket mod="longpress">RunScript(/home/osmc/tvoff.py)</leftbracket>
                </keyboard>
        </Home>
        <FullscreenVideo>
                <keyboard>
                       <stop mod="longpress">RunScript(/home/osmc/leselicht.py)</stop>
                </keyboard>
        </FullscreenVideo>
        <VideoOSD>
                <keyboard>
                       <stop mod="longpress">RunScript(/home/osmc/leselicht.py)</stop>
                </keyboard>
        </VideoOSD>
        <FullscreenLiveTV>
                <keyboard>
                       <stop mod="longpress">RunScript(/home/osmc/leselicht.py)</stop>
                </keyboard>
        </FullscreenLiveTV>
        <PlayerProcessInfo>
                <keyboard>
                       <stop mod="longpress">RunScript(/home/osmc/leselicht.py)</stop>
                </keyboard>
        </PlayerProcessInfo>
</keymap>

I did something similar with LG webos television. For a while I used the RunScript() method but that was horribly (well, noticeably slow) so I looked for other solutions.

What works almost natively for me is using combination of Home Assistant with Kodi and Webos integrations.

So the keymap is sending JSON-RPC message
<volume_down>NotifyAll("osmc", "OnKeyPress", {"key":"volume_down"})</volume_down>

And a home assistant automation is something like this:

alias: Kodi remote automation
description: ""
trigger:
  - platform: event
    event_type: kodi_keypress
    event_data:
      entity_id: media_player.osmc
action:
  - choose:
      - conditions:
          - condition: template
            value_template: "{{trigger.event.data.data.key=='volume_up'}}"
        sequence:
          - service: media_player.volume_up
            target:
              entity_id: media_player.lg_webos_tv_oled55b6v
            data: {}

Hopefully this might help someone.

1 Like

Just a point of clarification, a noop and an empty tag are not actually the same function. A noop is telling Kodi to do nothing, literally. An empty tag mapping is telling Kodi to remove any mappings for that key that may exist in previously loaded keymaps. For example, in my keymap in global I noop the longpress of the info button. By default there is no long-press action so the button does repeat. As a result by default if someone held down the info button with a library item selected then Kodi rapidly loads and unloads the info window. Not optimal, so nooping the long-press I disable repeat (by specifying a long-press action) and tell it to do nothing if the button is held down. An empty tag here would actually have no effect to the original behavior.

The reason I suggest the empty tags instead of specifying the same action id repeatedly across the file is simply for easier reading and updates. It works doing it either way but as this file is being manually created/edited having an action that your using globally set only in the global section is just easier to manage with future updates.

2 Likes

Thanks for highlighting that :slight_smile:

1 Like