1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Hyperion Remote Control

Discussion in 'Hyperion Extensions' started by shawnleo001, 18 June 2016.

Tags:
  1. shawnleo001

    shawnleo001 New Member

    Messages:
    13
    Hardware:
    RPi2, RPi3, +Arduino
    I have received a great deal of valuable info here and I hope this post could be a small useful tip to anyone here.

    This is to show you my way of controlling the hyperion with remote controller. I am sure there are lots of smarter ways to do this.

    My set up is RPI3 and OSMC KODI. My remote controller can be found in the following link:

    https://www.amazon.com/ATian-Remote...1466235394&sr=8-8&keywords=windows+mce+remote

    This remote is inexpensive and it works fine with KODI. However, some of the keys in this remote have no use in KODI. So I used them to control the hyperion.

    BTW, if you are using a USB keyboard to control KODI, I belive this method will work as well. All you need to know is the your control device's KEY ID.

    OK here we go...

    1. SSH into your OSMC and build python files to execute the hyperion control command. I named the files hyp-off.py and hyp-on.py and I put them in the following folder.

    /home/osmc/hypctl/

    2. hyp-off.py contains the following code:

    Code:
    #! /usr/bin/python
    
    import os
    
    os.system("/usr/bin/hyperion-remote --color black")
    os.system("sleep 2")
    os.system("sudo systemctl stop hyperion")

    3. hyp-on.py contains the following code:

    Code:
    #! /usr/bin/python
    
    import os
    
    os.system("sudo systemctl start hyperion")

    4. Make the above two newly created files executable with the following commands:

    chmod u+x /home/osmc/hypctl/hyp-off.py
    chmod u+x /home/osmc/hypctl/hyp-on.py


    5. Create keyboard.xml in the following location:

    /home/osmc/.kodi/userdata/keymaps


    6. Here you will need to know your remote's key id. For my case, I am using the "desktop" (key ID 2158660) in the bottom right corner to turn off Hyperion and the key "My PC" (key ID 2158661) to turn on Hyperion.

    The code of keyboard.xml is as the following:


    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <keymap>
      <global>
        <keyboard>
              <key id='2158660'>RunScript(/home/osmc/hypctl/hyp-off.py)</key>
              <key id='2158661'>RunScript(/home/osmc/hypctl/hyp-on.py)</key>    
        </keyboard>
      </global>
    </keymap>
    
    remote.jpg

    8. Restart your kodi with the following command and we are done :)

    sudo systemctl restart mediacenter


    Actually, with this method, you can customize your remote and let it activate/deactivate all hyperion command such as turn on/off the built-in hyperion effects, or light up the leds with the color you want etc. All you have to do is put the hyperion-remote command in the python file and map your key to execute the python file.

    Hope this helps and I know there is better way to do this. Hope you could let me know if you have any better idea. Or if there is any problem with the method I introduced here, please let me know too! Thank you!!!
     
    Last edited: 18 June 2016
    • Thank you Thank you x 2
    • Like Like x 1
  2. penfold42

    penfold42 Moderator Developer

    Messages:
    655
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
  3. Brindosch

    Brindosch Administrator Administrator

    Messages:
    663
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    Thank you for this great tutorial! Information sharing is always kind ;)
     
  4. shawnleo001

    shawnleo001 New Member

    Messages:
    13
    Hardware:
    RPi2, RPi3, +Arduino
    Thank you. Actually I have already read your post before posing mine here. Your idea inspired me. :)
     
  5. shawnleo001

    shawnleo001 New Member

    Messages:
    13
    Hardware:
    RPi2, RPi3, +Arduino
    Thank you. It's my pleasure! :)
     
  6. mikeB2210

    mikeB2210 New Member

    Messages:
    20
    Hardware:
    RPi3
    Is there anywere a list about the possible hyperion commands. Because I want to know how I can set a background color by remote Control.
     
  7. penfold42

    penfold42 Moderator Developer

    Messages:
    655
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    More than the list 'hyperion-remote -h' gives you ?
     
  8. mikeB2210

    mikeB2210 New Member

    Messages:
    20
    Hardware:
    RPi3
    sorry, but I´m a newbie ;-)
    Is it really so easy? SSH into Libreelec and enter in the command line "hyperion-remote -h"? or what is the right syntax? Thanks for help
     
  9. penfold42

    penfold42 Moderator Developer

    Messages:
    655
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
  10. mikeB2210

    mikeB2210 New Member

    Messages:
    20
    Hardware:
    RPi3
    thanks I will try it
     
  11. mikeB2210

    mikeB2210 New Member

    Messages:
    20
    Hardware:
    RPi3
    no luck :-((
    ssh with putty....hyperion-remote -h
    I got: -sh: Hyperion-remote: not found

    what is my mistake?
     
  12. TPmodding

    TPmodding Administrator Staff Member Administrator

    Messages:
    775
    Hardware:
    RPi1/Zero, RPi2, RPi3, +Arduino
    you have to go to the hyperion/bin folder and type there "./hyperion-remote.sh -h"
     
  13. starkillerOG

    starkillerOG New Member

    Messages:
    3
    Hardware:
    RPi3, +AtmoOrb
    I have been looking to control my hyperion system with a colorwheel remote for a while.
    When I watch movies the system performs outstanding, but I also want to use it as ambiant lighting if my TV is off.

    I found that Milight makes nice 2.4GHz color wheel remotes that are sold separately for about $8,- (AliExpress)
    I also found this github project: esp8266_milight_hub, that is able to listen to the remote signals using a cheap NodeMCU + ESP8266 and a NRF24L01+ (together about $4,-) and decode the signals and sent them to HomeAssistant. (some more about the signal structure can be found in this blog).

    I think it would be possible to edit the relevant parts of the esp8266_milight_hub project code and use it to receive the signals from the remote and send commands to hyperion to turn on/off, to change color and to change the brightness.

    Unfortunately I am completely new to using electronic boards like esp's and NodeMCU's and am not familiar with how to program them.
    Maybe there is someone who would like to give this a go?
     
  14. starkillerOG

    starkillerOG New Member

    Messages:
    3
    Hardware:
    RPi3, +AtmoOrb
    Just in case someone else wants to do this, I got it working and the remote is nice and responsive.
    I can set color (set Hue set Sat and set Lum), turn 5 diffrent groups of lights (5 diffrent Hyperion instances) on/off and change between HDMI grabbing mode and solid color mode on the hardware remote.

    I used the esp8266_milight_hub software to get the remote signals, used Mosquitto as the MQTT broker to communicate the messages and used Eventghost with some phython code to translate the messages to Hyperion commands that I sent to the JSON interface to control Hyperion.

    More information is in this discussion.
     
    • Like Like x 1