Need a little help with custom remote xml

  • Hi there,
    I recently have setup all my hardware and it is working great :)
    Setup:
    RPi3 with LibreELEC running Hyperion installed via HyperCon


    Now that everything is setup, I recognized the daemon always points to one single configuration file and the Hyperion App for Android doesn't provide an easy way to toggle between several configuration files.


    So I wrote a little script (quick 'n dirty), which will read out my AVR's xml to see which hdmi-source is active (all in bash :sickxx: has been a pain in the ass...) and will allow me to toggle between internal and external grabber (if called with arguments). I named it 'htoggle'.
    Since libreELEC is designed in a very restrictive way, I'm not sure if I somehow will be able to run this as a daemon, so I decided to toggle by hand via CEC remote for now.


    This is my script, running nice from within ssh sessions:


    Now I barely understand, how to modify libreELECS remote keymapping. I cannot get access to these infos, because kodi.wiki is offline since a few days and all of my web search results point to this wiki.


    I want to alter the mapping for my CEC Remote (the color keys which I don't need) to execute "htoggle" and "htoggle off".


    I thought it would be enough, to modify .kodi/userdata/advancedsettings.xml and include a tag like this:


    In this example I set everything to ActivateWindow(Videos) for testing purposes.
    As long as I understand, now the original global part from original (untouched) remote.xml should be replaced by my modification.


    But it does not work. kodi seems to ignore my advancedsettings.xml, even if I can see it loads:


    What am I missing? Isn't this the proper way to modify key actions on a CEC remote?

  • I modified my script to run as "daemon", checking each 5 seconds for two flags in /tmp (1st flag to see if hdmi source changed, which will result in picking the right Hyperion configuration file, 2nd flag to see if user wants LEDs/Hyperion to be on or off, so I no longer need the CEC Remote thing.


    If someone wonders why I did all this:
    I'm not sure if this is how it was intended to be, but the official Hyperion app from Google Playstore has no working "turn LEDs off"-button for me. It just resets the colorwheel and effects and so on but does NOT turn the LEDs off, which I find is not the way it should run. Second, as I yet mentioned this app doesn't provide a way to toggle between several configuration files for Hyperion, which I find necassary, because a) I want to switch between internal and external grabber and b) the USB-Video-Grabber does not provide the exact same colors than the HDMI-Source for each source, so I want to have the ability to auto-switch between several pre-stored configurations.


    Of course, this is specifically designed to work with my Denon AVR's xml, but if someone somehow is interested in the whole thing, may be because he owns an AVR with readable xml files as well, here it is:


    Turn Hyperion on / off:
    Name: h-toggle
    (I run this script by Android app "RasPi Check" as stored command, much more comfortable than using Juice SSH)

    Code
    #!/usr/bin/env bash
    # This script needs script 'which-h-grabber' as daemon to turn Hyperion on and off!
    if [ -f "/tmp/h-off" ]; then
        rm /tmp/h-off
    echo "Hyperion ON"
    else
        touch /tmp/h-off
        echo "Hyperion OFF"
    fi
    exit 0


    Check which source is selected in AVR and if LEDs should be on or off:
    Name: which-h-grabber


    The "daemon" (because of LibreELECS r/o filesystem plus missing (?) cron):
    Name: h-grabber-daemon

    Code
    #!/usr/bin/env bash
    # This script runs script 'which-h-grabber' in an interval
    path="/storage/MyHyperionDaemon/which-h-grabber"
    while [ 1 = 1 ]
        do
        bash $path
        sleep 5
    done
    exit 0


    Of course, since I execute the "daemon" in an SSH session, I start it like this

    Code
    nohup bash h-grabber-daemon > /dev/null &


    to disown the process.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!