Scripts created to enhance the Hyperion experience on a Raspberry Pi setup. 🌈
Scripts that I created to enhance the Hyperion experience. You can also read this in Italiano
Make sure you have Hyperion installed and configured (installation and configuration via HyperCon is suggested).
Open a terminal window on your Raspberry Pi or connect via SSH (use the Terminal app on MacOS/Linux, or download PuTTY on Windows) and run this command to clone this repository on your device:
cd ~/ && sudo apt-get install git && git clone https://github.com/JFtechOfficial/ultimate-ambilight-setup.git
If you want you can pre-configure the Hyperion effects and buttons script. You can find them in the following directories: Hyperion_effects
, buttons
.
Run the install.sh
script:
cd ~/ultimate-ambilight-setup/
sudo chmod 775 install.sh
sudo ./install.sh
You can decide what to install/reinstall using the -a
, -b
, -c
and -f
arguments (no custom installation arguments means “install everything”).
Options:
General options:
-h --help Show this screen.
-v --version Show version.
Custom installation options:
-a --assistant Install Google Assistant script.
-b --buttons Install buttons script.
-c --clock Install clock effect.
-f --fan Install fan script.
hyperion-mqtt-subscriber
, Raspberry-Pi-PWM-fan
.You can change any configuration value after the installation process. If you do, please remember to reboot your device afterwards
sudo reboot
clock.json
file:
sudo nano ~/ultimate-ambilight-setup/Hyperion_effects/clock.json
owmAPIkey
value pasting your API key (you can use the same API key in the Kodi Weather app btw)latitude
and longitude
values pasting your own latitude and longitudeoffset
value to match your LED setupdirection
value to match your LED setup ( 0
-> clockwise, 1
-> counterclockwise)Ctrl + X
and close Enter
the fileclock.json
file AFTER the installation you can find it in the Hyperion effects directory:
sudo nano /usr/share/hyperion/effects/clock.json
(example with the default path)
buttons.json
file:
nano ~/ultimate-ambilight-setup/buttons/buttons.json
buttons.json
file.short-press
and long-press
values for each pin. You can assign an effect name (e.g. "Rainbow swirl"
) to launch the effect, an RGB value (e.g. [255,0,0]
) to launch the resulting color, the string "clear"
to go back to the default capture mode, or null
to do nothing. I suggest you not modify:
{
"short-press" : "clear",
"long-press" : [0,0,0]
}
You can add as many buttons as you want by pasting (and configuring) the following code after gpio-setup: {
:
"Pin number" :
{
"short-press" : "effect name"/[255,255,255]/null,
"long-press" : "effect name"/[255,255,255]/null
},
Modify the gpio-mode
value to match the pin numbering you’re using (“BCM”/“BOARD”)
Ctrl + X
and close Enter
the filefan.json
file:
nano ~/ultimate-ambilight-setup/Raspberry-Pi-PWM-fan/fan.json
pin
value to match your GPIO setupgpio-mode
value to match the pin numbering you’re using (“BCM”/“BOARD”)Ctrl + X
and close Enter
the fileclient.json
file:
nano ~/ultimate-ambilight-setup/hyperion-mqtt-subscriber/client.json
ip_address
value of the hyperion_server
to match the IP address of the device running Hyperion (“127.0.0.1” if it’s the same device running this script)port
value of the hyperion_server
username
and key
values of the mqtt_broker
to match your Adafruit-IO username and AIO keyeffect-topic
value of the mqtt_broker
to match the name of your Adafruit-IO “effect launching” topiccolor-topic
value of the mqtt_broker
to match the name of your Adafruit-IO “color launching” topicmisc-topic
value of the mqtt_broker
to match the name of your Adafruit-IO “miscellaneous” topicip_address
value of the kodi_server
to match the IP address of the device running Kodi (“127.0.0.1” if it’s the same device running this script)video_uri
value of the kodi_server
to the local path or internet link of the video you want to play (supported: YouTube, Dropbox, Flickr, GoogleDrive, Reddit, Twitch:video, Vimeo, VK and many more)API_key
value with the Yandex API key. Simply set this value as blank (""
) if you use English as main languagefrom_language
value to match your language"custom_actions": [
:
{
"message": "your_message",
"target": "effect name"/[255,255,255]/"clear"/null
},
Ctrl + X
and close Enter
the fileUse your favorite Hyperion client to select and run the clock effect: the second hand has a warmer color when outside is hot and it has a colder color when outside is cold.
Use buttons connected to the GPIO to launch effects or color, to go back to the capture mode, turn on or safely turn off the Raspberry Pi. You can trigger different functions by pressing and long-pressing the buttons.
Use a fan connected to the GPIO: it will automatically start to spin and cool down the system varing its speed depending on the Rasperry Pi’s CPU temperature.
Use IFTTT to interface Google Assistant with the Adafruit-IO mqtt broker. You can send:
effect-topic
earlier)
color-topic
earlier)
misc-topic
earlier)
Now you can use the Google Assistant on your smartphone/tablet/Google Home to tell Hyperion what to do.
Here is a step-by-step video guide about how to build the ultimate Ambilight setup (ITA):
You can also check the wiki
The hyperion.config.json
file is an example of a working configuration file for Hyperion (generated via HyperCon)
Please visit the hyperion-project website to learn more about Hyperion
Please see CONTRIBUTING.md.
Major dependencies:
Can I use the same GPIO pin for the configuration of two different scripts?
No. You should never use the same pin for different tasks at the same time (e.g. controlling the fan and reading the state of a button from the same pin at the same time will not work and could break your Raspberry Pi).
Can I install the Google Assistant client script on a Raspberry Pi different from the one running Hyperion?
Yes. You can run it on any unix machine connected to the same local network: it will send commands to the Raspberry Pi that runs Hyperion. The fan script, buttons script and the clock effect cannot be used in the same way: you must install them on the machine that you intend to use them on.
What about the Raspberry Pi Foundation TV µHAT?
I don’t think I’ll ever use one, IPTV is good enough imho.