Hyperion Remote Control

  • 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:



    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:





    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!!!

  • 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?


  • 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.

Jetzt mitmachen!

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