O'Brien Labs

  • Home
  • Portfolio
  • WordPress
    • Plugins
    • WordPress Tips
  • Random Post
  • About

Keyboard Shortcuts

R - Load a random post.
? - Open this dialog window.
O'Brien Labs > Code Snippets > Windows Media Center status light using a blink(1) USB RGB LED Keyboard Shortcuts

Windows Media Center status light using a blink(1) USB RGB LED

April 8, 2016 by

Share this post:

Get a visual status on your Windows Media Player server with this PowerShell code and a ThingM blink(1) USB RGB LED

More information is here: http://obrienlabs.net/windows-media-center-status-light-using-blink1/

# # This script is designed to loop forever with a 5 second wait between # each loop. It will check if Windows Media Center is recording # and if it is, then set the blink(1) light to RED. If it is not recording # set the blink(1) light to GREEN. # # This script uses the blink(1) GUI software with the API server enabled. # You could use the blink(1) CLI utility instead if you wanted. I chose # to go with the GUI API so that I could use the GUI if needed. # # Pat O'Brien - http://obrienlabs.net # April 8, 2016 # while($true) { # WMC is open locally or on an extender $wmcshell = Get-Process ehshell -ErrorAction SilentlyContinue # WMC is recording a show $wmcrec = Get-Process ehrec -ErrorAction SilentlyContinue if ( $wmcshell -or $wmcrec) { # Recording a show, set status to red Write-Host "ehshell.exe or ehrec.exe found, setting blink(1) status to red" Invoke-RestMethod -URI "http://localhost:8934/blink1/fadeToRGB?rgb=%23FF0000" } else { # Not recording a show, set status to green Write-Host "ehshell.exe or ehrec.exe not found, setting blink(1) status to green" Invoke-RestMethod -URI "http://localhost:8934/blink1/fadeToRGB?rgb=%2300FF00" } # Sleep for 5 seconds, then check again Start-Sleep -s 5 }
wmc_blink_light.ps1
view raw
Share this post:

About Pat

I'm a sysadmin, WordPress Core Contributor, plugin & theme developer. I've also developed a few non-WordPress websites. I'm a technologist at heart. I enjoy tinkering on many projects. Here on my site you will find some of the projects I've worked on. Whether it's the WordPress plugins I've made, some WordPress tips, various tech tips, or even a couple Halloween props.

View all posts by Pat

About

The purpose of this site is for me to share my DIY technical experiences as a place to document them publicly. Hopefully somewhere along the way they are helpful for you.

Recent Posts

  • BelchertownWeather.com website theme for weewx
  • How to setup your own MQTT Broker
  • Nest Thermostat Push Notifications
  • mailx – Send automated Linux email with gmail
  • simplemonitor – who watches the Nagios watchman?

Tags

ad adblock amp Asterisk AutoHotKey battery block Camera car code codesnips database developer Emergency halloween Heat Home Inverter Linux load Nagios night plugins portfolio Power Project Raspberry Pi simplemonitor snippets Tech Tips Timelapse tips Tutorial ublock vision Weather Station webcam website weewx WordPress

Copyright © 2010–2019 O'Brien Labs – All Rights Reserved – Use without permission is illegal.

Please support this website by adding us to your whitelist in your ad blocker. Ads are what helps us bring you premium content! Thank you!