<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Topics tagged with panel]]></title><description><![CDATA[A list of topics that have been tagged with panel]]></description><link>https://www.triggercmd.com/forum/tags/panel</link><generator>RSS for Node</generator><lastBuildDate>Sat, 07 Mar 2026 21:51:25 GMT</lastBuildDate><atom:link href="https://www.triggercmd.com/forum/tags/panel.rss" rel="self" type="application/rss+xml"/><pubDate>Invalid Date</pubDate><ttl>60</ttl><item><title><![CDATA[Download a Youtube video by passing the URL as a parameter]]></title><description><![CDATA[<p dir="auto">I made this <a href="https://youtu.be/KqfRiPy5gFs" rel="nofollow ugc">YouTube video</a> to show how this works.</p>
<p dir="auto">Make sure to adjust the folder paths.  I doubt you'll put your script in d:\appdev\triggercmd\youtube-dl or put your downloaded files in m:\videos\youtube like I did.</p>
<p dir="auto">Create a folder, open a cmd window in that folder, and type these to create the virtual environment with the yt_dlp python module:</p>
<pre><code>python3 -m venv myenv
myenv\Scripts\activate.bat
pip3 install yt_dlp
</code></pre>
<p dir="auto"><strong>youtube-dl.bat contents:</strong></p>
<pre><code class="language-@echo">setlocal enabledelayedexpansion

:: This version of the script differs from the one in the Youtube video in that it handles any of these Youtube URL formats:
:: https://www.youtube.com/watch?v=KqfRiPy5gFs
:: https://youtu.be/KqfRiPy5gFs
:: KqfRiPy5gFs

:: Combine all arguments into a single string
set "input="
for %%A in (%*) do (
    set "input=!input! %%A"
)

:: Remove leading spaces
set "input=%input:~1%"

:: Check if the input contains "youtu.be" format and extract the video ID
echo %input% | findstr /C:"youtu.be" &gt;nul
if not errorlevel 1 (
    set "id=%input:~17%"  :: Strip "https://youtu.be/"
)

:: Check if the input contains "youtube.com/watch?v=" format and extract the video ID
if not defined id (
    echo %input% | findstr /C:"youtube.com/watch?v=" &gt;nul
    if not errorlevel 1 (
        set "id=%input:~32%"  :: Strip "https://www.youtube.com/watch?v="
    )
)

:: If input is just the ID, no need for stripping
if not defined id (
    set "id=%input%"
)

:: Ensure the ID is exactly 11 characters long
set "id=%id:~0,11%"

echo YouTube Video ID: %id%

:: Go to the folder where I want the files to be created
cd /d m:\videos\youtube

:: Activate the Python virtual environment that has the yt_dlp module installed
call d:\appdev\triggercmd\youtube-dl\myenv\Scripts\activate.bat

:: Run the python script to download the video and metadata
python d:\appdev\triggercmd\youtube-dl\youtube-dl.py %id%  &gt; debug.log 2&gt;&amp;1
</code></pre>
<p dir="auto"><strong><a href="http://youtube-dl.py" rel="nofollow ugc">youtube-dl.py</a> contents:</strong></p>
<pre><code>import yt_dlp
import json, uuid, sys

def download_video_metadata(video_url):
    ydl_opts = {
        'quiet': True,
        'skip_download': True,
        'force_generic_extractor': False,
    }
    
    with yt_dlp.YoutubeDL(ydl_opts) as ydl:
        try:
            info_dict = ydl.extract_info(video_url, download=False)
            return info_dict
        except Exception as e:
            print(f"Error: {e}")
            return None

def download_video(video_url):
    ydl_opts = {
        'quiet': False,
        'outtmpl': '%(title)s.%(ext)s',
    }
    
    with yt_dlp.YoutubeDL(ydl_opts) as ydl:
        try:
            ydl.download([video_url])
        except Exception as e:
            print(f"Error: {e}")

if __name__ == "__main__":
    if len(sys.argv) != 2:
        print("Usage: python3 youtube-dl.py &lt;YouTube Video URL&gt;")
        sys.exit(1)

    video_url = sys.argv[1]
    metadata = download_video_metadata(video_url)
    
    if metadata:
        print("Metadata:")

        filename=metadata.get('title', uuid.uuid4()) + ".json"
        with open(filename, "w") as file:
            json.dump(metadata, file, indent=4)

        print("Downloading video...")
        download_video(video_url)
</code></pre>
<p dir="auto">Make sure you enable parameters:<br />
<img src="/forum/assets/uploads/files/1743379672751-9f121796-6f1f-4241-9d2e-c0e83a221fc2-image.png" alt="9f121796-6f1f-4241-9d2e-c0e83a221fc2-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">If you want to create a panel, you can use this regex to accept any text:  ^.*$<br />
<img src="/forum/assets/uploads/files/1743379762238-8ac7a7eb-9e94-44e6-b259-93c72efd841c-image.png" alt="8ac7a7eb-9e94-44e6-b259-93c72efd841c-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://www.triggercmd.com/forum/topic/3232/download-a-youtube-video-by-passing-the-url-as-a-parameter</link><guid isPermaLink="true">https://www.triggercmd.com/forum/topic/3232/download-a-youtube-video-by-passing-the-url-as-a-parameter</guid><dc:creator><![CDATA[Russ]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Orange Pi Zero 2 image with TRIGGERcmd agent pre-installed and programmed for IR remote control]]></title><description><![CDATA[<p dir="auto">I put this <a href="https://drive.google.com/drive/folders/1G4JnV3VLcLFa76tf-zO2t0jC9h9o4YlW" rel="nofollow ugc">Orange Pi image</a> out on Google Drive if you want to try it.  I have a couple <a href="https://www.amazon.com/Orange-Pi-AllWinner-Open-Source-Expansion/dp/B0BC9Q1HW7" rel="nofollow ugc">Orange Pi Zero 2</a>'s running it so far.  One is in my office and one is in my basement entertainment center room (<a href="https://youtu.be/CkltbMZJXL0" rel="nofollow ugc">youtube video</a>).</p>
<p dir="auto">The Orange Pi has an infrared sensor so I use this IR remote control to run up to 21 different commands - one command per button.  I don't recommend you associate your garage door with one of those buttons though.  IR is not secure - it's just infrared light, and anyone can buy a remote like this for around <strong>$3</strong>:<br />
<img src="/forum/assets/uploads/files/1667085171362-ir_remote.jpg" alt="IR_Remote.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto">I bought a few of these Orange Pi Zero 2's for about $30 each, and I noticed they had these IR receivers built into the expansion boards they came with.  You can see it in the middle of this photo on the top board:<br />
<img src="/forum/assets/uploads/files/1667085037722-orangepizero2-resized.jpg" alt="OrangePiZero2.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto">This is the Orange Pi image file:<br />
<a href="https://drive.google.com/drive/folders/1G4JnV3VLcLFa76tf-zO2t0jC9h9o4YlW" rel="nofollow ugc">https://drive.google.com/drive/folders/1G4JnV3VLcLFa76tf-zO2t0jC9h9o4YlW</a></p>
<p dir="auto">You can write it out to your microSD card with <a href="https://www.balena.io/etcher/" rel="nofollow ugc">belanaEtcher</a> or the Raspberry Pi imager tool.</p>
<p dir="auto">I took the the official Orange Pi Ubuntu image for the Zero 2 hardware from <a href="http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Zero-2.html" rel="nofollow ugc">this page</a>, installed the TRIGGERcmd agent on it.  I also installed a script that runs on boot that shows you a TRIGGERcmd pair code on the hdmi console to pair it with your TRIGGERcmd account.  You can also get the pair code from /root/paircode by ssh'ing to it, but you'll need to know the IP, or you could try the dns name which will be tcmd-orangepizero2 if it works.  Both the <strong>orangepi</strong> and <strong>root</strong> have orangepi as the password.  You should change that.  I'll probably add a command to change that via a built-in TRIGGERcmd command in the next version of this image file.</p>
<p dir="auto">You'll need to pair your Orange Pi with the Pair button under your name in the upper-right.<br />
<img src="/forum/assets/uploads/files/1667085712200-39d1fc0f-9f2a-4a80-ac8f-e8c79e8bb998-image.png" alt="39d1fc0f-9f2a-4a80-ac8f-e8c79e8bb998-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">It will create a computer in your account with a few built-in commands, like the commands to control 2 relays on a <a href="https://www.amazon.com/Qunqi-Channel-Optocoupler-Expansion-Raspberry/dp/B078478SZ9" rel="nofollow ugc">relay board like this</a>.</p>
<p dir="auto">It will also create an <strong>"IR Remote"</strong> panel in your account with a virtual panel button for each physical button on the remote.<br />
<img src="/forum/assets/uploads/files/1667086932632-2c8afaba-8f38-4095-9f09-0aaaf61edbd8-image.png" alt="2c8afaba-8f38-4095-9f09-0aaaf61edbd8-image.png" class=" img-fluid img-markdown" /><br />
You'll just need to associate those virtual buttons with the commands in your account that you want them to run.  I've been running Calculator a lot, but I intend to associate things like my basement lights <a href="https://www.triggercmd.com/forum/topic/1844/run-an-alexa-routine-when-a-command-runs">via an Alexa routine</a> etc.</p>
<p dir="auto">To connect the Orange Pi to Wifi you'll need to plug it into ethernet first and ssh in, or use the console if you have a micro HDMI adapter and keyboard to set it up using the console.  Run <strong>orangepi-config</strong> to setup wifi.  The Orange Pi comes with a nice wifi antenna.  You can see the antenna wire in the photo above.</p>
<p dir="auto">I like that these remotes are so cheap.</p>
<p dir="auto">Here a couple Amazon posts selling them:<br />
<img src="/forum/assets/uploads/files/1667086010350-fa18683c-39c9-4efd-a613-4c382c8b9968-image.png" alt="fa18683c-39c9-4efd-a613-4c382c8b9968-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">I'll probably do a Raspberry Pi image too if people are interested.  I figured the Orange Pi image might be more useful at the moment because it's hard to get the Raspberry Pi's right now.  Notice those remotes come with an IR receiver, which you'll need if you use a Raspberry Pi.</p>
<p dir="auto">If you want to wire up a relay board, this is how to connect the pins:<br />
<img src="/forum/assets/uploads/files/1667087699333-img_20221029_195308438-resized.jpg" alt="IMG_20221029_195308438.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto"><strong>EDIT 11/13/2022:</strong><br />
This is the commands.json file from my laptop running Winamp in the Youtube video:</p>
<pre><code>[
 {
  "trigger": "Reboot in 10 seconds",
  "command": "shutdown /r /t 10",
  "ground": "background",
  "voice": "reboot"
 },
 {
  "trigger": "Calculator",
  "command": "calc",
  "ground": "foreground",
  "voice": "calculator"
 },
 {
  "trigger": "Notepad",
  "command": "notepad",
  "ground": "foreground",
  "voice": "notepad"
 },
 {
  "trigger": "Volume up",
  "command": "nircmd changesysvolume 6000",
  "offCommand": "",
  "ground": "foreground",
  "voice": "",
  "voiceReply": "",
  "allowParams": "false"
 },
 {
  "trigger": "Volume down",
  "command": "nircmd changesysvolume -6000",
  "offCommand": "",
  "ground": "foreground",
  "voice": "",
  "voiceReply": "",
  "allowParams": "false"
 },
 {
  "trigger": "Play/Pause",
  "command": "nircmd sendkeypress c",
  "offCommand": "",
  "ground": "foreground",
  "voice": "",
  "voiceReply": "",
  "allowParams": "false"
 },
 {
  "trigger": "Previous song",
  "command": "nircmd sendkeypress z",
  "offCommand": "",
  "ground": "foreground",
  "voice": "",
  "voiceReply": "",
  "allowParams": "false"
 },
 {
  "trigger": "Next song",
  "command": "nircmd sendkeypress b",
  "offCommand": "",
  "ground": "foreground",
  "voice": "",
  "voiceReply": "",
  "allowParams": "false"
 },
 {
  "trigger": "MilkDrop",
  "command": "c:\\tools\\milkdrop.bat",
  "offCommand": "",
  "ground": "foreground",
  "voice": "",
  "voiceReply": "",
  "allowParams": "false"
 },
 {
  "trigger": "Milkdrop Title",
  "command": "nircmd sendkeypress t",
  "offCommand": "",
  "ground": "foreground",
  "voice": "",
  "voiceReply": "",
  "allowParams": "false"
 },
 {
  "trigger": "Fast forward",
  "command": "nircmd sendkeypress shift+right",
  "offCommand": "",
  "ground": "foreground",
  "voice": "",
  "voiceReply": "",
  "allowParams": "false"
 },
 {
  "trigger": "Rewind",
  "command": "nircmd sendkeypress shift+left",
  "offCommand": "",
  "ground": "foreground",
  "voice": "",
  "voiceReply": "",
  "allowParams": "false"
 },
 {
  "trigger": "Winamp",
  "command": "\"C:\\Program Files (x86)\\Winamp\\winamp.exe\"",
  "offCommand": "",
  "ground": "foreground",
  "voice": "",
  "voiceReply": "",
  "allowParams": "false"
 },
 {
  "trigger": "Previous Milkdrop preset",
  "command": "nircmd sendkeypress backspace",
  "offCommand": "",
  "ground": "foreground",
  "voice": "",
  "voiceReply": "",
  "allowParams": "false"
 },
 {
  "trigger": "Pause Milkdrop preset rotation",
  "command": "nircmd sendkeypress scroll",
  "offCommand": "",
  "ground": "foreground",
  "voice": "",
  "voiceReply": "",
  "allowParams": "false"
 },
 {
  "trigger": "Next Milkdrop Preset",
  "command": "nircmd sendkeypress h",
  "offCommand": "",
  "ground": "foreground",
  "voice": "",
  "voiceReply": "",
  "allowParams": "false"
 },
 {
  "trigger": "Lights color rotate",
  "command": "c:\\tools\\color_rotate.bat",
  "offCommand": "",
  "ground": "foreground",
  "voice": "",
  "voiceReply": "",
  "allowParams": "false"
 }
]
</code></pre>
<p dir="auto">Here's my c:\tools\milkdrop.bat file on that laptop:</p>
<pre><code>tcmd -c russtv -t winamp
ping 127.0.0.1
start /B nircmd win activate stitle "Winamp 5"
ping 127.0.0.1
nircmd sendkeypress x
ping 127.0.0.1
nircmd sendkeypress ctrl+k
nircmd sendkeypress alt+s
</code></pre>
<p dir="auto">Heres my c:\tools\color_rotate.bat script:</p>
<pre><code>set /p lastcolor=&lt; c:\tools\lastcolor.txt
echo Last color was %lastcolor%

goto %lastcolor% else END

:red
echo blue &gt; c:\tools\lastcolor.txt
tcmd -c ds -t ar_lights_blue
goto END

:blue
echo green &gt; c:\tools\lastcolor.txt
tcmd -c ds -t ar_lights_green
goto END

:green
echo red &gt; c:\tools\lastcolor.txt
tcmd -c ds -t ar_lights_red
goto END

:END
</code></pre>
]]></description><link>https://www.triggercmd.com/forum/topic/2394/orange-pi-zero-2-image-with-triggercmd-agent-pre-installed-and-programmed-for-ir-remote-control</link><guid isPermaLink="true">https://www.triggercmd.com/forum/topic/2394/orange-pi-zero-2-image-with-triggercmd-agent-pre-installed-and-programmed-for-ir-remote-control</guid><dc:creator><![CDATA[Russ]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>