Home Assistant companion web server to open a media player entity’s content on IMDb using DuckDuckGo's \
shortcut to visit the first result.
This works by grabbing the current content from a Home Assistant media_player
entity and searching for the exact episode (or just the movie) on DuckDuckGo. For example: \The Americans (2013) season 3 episode 3 Open House site:imdb.com
. Including the episode name increased the chances of getting the proper result for some shows. It's slightly imperfect since it relies on the first result being the right one. I also found that DuckDuckGo was friendlier than Google to my clearly automated searching as I was testing.
Works great in combination with a home screen shortcut on your phone! I used Hermit for Android to generate a single-site browser for easy, silo'd access so I don't end up with a million IMDb tabs. I also added a local network-wide DNS record to redirect lookerupper.example.com
to the server for quick access.
- Clone repository locally.
- Duplicate
.env.example
and rename it to.env
. Update the values (see table below) - Run the server by running
node index.js
from the terminal - Play a movie or TV show on the device you specified in your environment file, then visit
http://localhost:3000
(or the IP address of your machine)
Variable Name | Usage | Example |
---|---|---|
PORT | The port that NodeJS will use to listen for requests | 3000 (default value) |
HASS_HOST | The URL you use to open Home Assistant, including the port number if needed | http://homeassistant.local:8123 |
HASS_TOKEN | Access token from your Home Assistant account. See Home Assistant docs for more info | [a whole bunch of nonsense] |
HASS_ENTITIES | Comma-separated Home Assistant entity IDs of your media devices, in priority order | media_player.emby_shield_tv |
SOURCE_TV | Website to include in your search, | imdb.com (default value) |
SOURCE_MOVIE | Website to include in your search, | imdb.com (default value) |
SOURCE_MUSIC | Website to include in your search, | genius.com (default value) |