How to run a script for "Audio Profiles" addon

Hello,

i use my Vero 4K+ with Flirc receiver to have more commands and try to run a script for the “Audio Profiles” addon.

I have chosen the command “green” to swith between the profiles of the addon. Without any changes in the configuration i get the message “OSMC Remote Controller - Low battery” when i sen d the “green” command (i use a Harmony One instead of the OSMC Remote Controller).

Regarding the “Audio Profiles” documentation i have created the following /home/osmc/.kodi/userdata/keymaps/keyboard.xml :

osmc@osmc:~/.kodi/userdata/keymaps$ cat keyboard.xml
<keymap>
  <global>
    <keyboard>
      <green>RunScript(script.audio.profiles,0)</green>
    </keyboard>
  </global>
</keymap>

Unfortunatelly this seems to take no effect at all, because when i send the “green” command after a restart i still get the “OSMC Remote Controller” message…

Also when i add a /home/osmc/.kodi/userdata/keymaps/remote.xml :

osmc@osmc:~/.kodi/userdata/keymaps$ cat remote.xml
<keymap>
  <global>
    <remote>
      <green>RunScript(script.audio.profiles,0)</green>
    </remote>
  </global>
</keymap>

instead of the keyboard.xml it takes no effect and i get the remote controller message.

How can i run the script? Thanks in advance!

Try changing this to…

<keymap>
  <global>
    <keyboard>
      <f2>RunScript(script.audio.profiles,0)</f2>
    </keyboard>
  </global>
</keymap>

And to aid in your future edits it is probably easiest to turn on debug logging and via SSH do a

tail -f .kodi/temp/kodi.log | grep -B 1 'HandleKey'

and then observe the output when you press a key. This will show both what type of input and the correct name (except CEC as it outputs incorrect data). In your case the remote is being picked up as a keyboard and that button on your remote is being mapped to the F2 key (there is no “green” key on a standard keyboard).

Thank you darwindesign, now it works! :hugs:
Is there a overview of the assignments, like green → f2 ?

I’ve never used a Flirc so I don’t really know. Their software is probably where you would need to look. What I outlined above is quite fast and easy to discover what Kodi is seeing and probably the prefered way to know the map is correct. There can be issues otherwise as you can run into things like “back” being seen in Kodi as “browserback” and only viewing the logs makes this clear. I just happened to know what this mapping was because of the battery toast you were getting.

No problem i found a overview already. Thanks again for your help!