GoWatchIt
Focus on watching your content, not babysitting it. Automate your entire theater: Plex, Home Assistant, ezBEQ, etc
Install / Use
/learn @iloveicedgreentea/GoWatchItREADME
Table of Contents
Features
Players Supported:
- Plex
- Jellyfin (no support given, but tested)
- Emby (may work due to jellyfin support, no support given and not tested)
Main features:
- Load/unload BEQ profiles automatically, without user action and the correct codec detected
- Set volume based on media type (Movie, Show, etc)
- Trigger lights when playing, pausing, or stopping automatically (e.g turn off lights on play, turn on when paused)
- HDMI Sync detection and automation (pause while HDMI is syncing so you don't sit embarrassed with a audio playing to a black screen)
- Web based UI for configuration
Other cool stuff:
- Mute/Unmute Minidsp automation for things like turning off subs at night
- Various MQTT sensors for playing status, volume control, lights, mute status, and current BEQ profile
- Mobile notifications to notify for events like loading/unloading BEQ was successful or failed
- Dry run and notification modes to verify BEQ profiles without actually loading them
- Built in support for Home Assistant and Minidsp
Setup
⚠️ ⚠️ Warning: You should really set a compressor on your minidsp for safety as outlined in the BEQ forum post. I am not responsible for any damage ⚠️ ⚠️
Prerequisites
ℹ It is assumed you have the following tools working. Refer to their respective guides for installation help.
- MQTT Broker (Optional)
- Home Assistant (Optional)
- Plex or Jellyfin
- ezBEQ
- Minidsp (other DSPs may work but I have not tested them. If ezBEQ supports it, it should be work)
You can configure this to only load BEQ profiles, or do everything else besides BEQ. It is up to you.
Docker Setup
ℹ If you need help deploying with Docker, refer to the Docker documentation. ℹ If you are using Jellyfin, read the Jellyfin specific instructions below
- Deploy the latest version
ghcr.io/iloveicedgreentea/gowatchit:latestto your preferred Docker environment- a docker-compose example is provided in the repo
- You must mount a volume to
/data - Configure the application via web ui ->
http://(your-server-ip):9999 - Set up your player with the instructions below
Plex Specifics
- get your player UUID(s) from
https://plex.tv/devices.xmlwhile logged in - Set up Plex to send webhooks to your server IP, port 9999, and the handler endpoint of
/plexwebhook- e.g
(your-server-ip):9999/plexwebhook
- e.g
- Whitelist your server IP in Plex so it can call the API without authentication. Docs
- Add UUID(s) and user filters to the application config
- Play a movie and check server logs. It should say what it loaded and you should see whatever options you enabled work
Jellyfin Specifics
You must use the official Jellyfin Webhooks plugin to send webhooks to this application.
- Create a Generic webhook (NOT GenericForm)
- Add http://(your-server-ip):9999/jellyfinwebhook as the url
- Types:
- PlaybackStart
- PlaybackStopped
- You can optionally add a user filter
- Item types: Movies, Episodes
note: playbackProgress is not supported because it is way too buggy and unreliable
Configure the webhook in whatever way you want but it must include the following and in this order:
{
"DeviceId": "{{DeviceId}}",
"DeviceName": "{{DeviceName}}",
"ClientName": "{{ClientName}}",
"UserId": "{{UserId}}",
"ItemId": "{{ItemId}}",
"ItemType": "{{ItemType}}",
"NotificationType": "{{NotificationType}}",
{{#if_equals NotificationType 'PlaybackStop'}}
"PlayedToCompletion": "{{PlayedToCompletion}}",
{{/if_equals}}
{{#if_equals NotificationType 'PlaybackProgress'}}
"IsPaused": "{{IsPaused}}",
{{/if_equals}}
"Year": "{{Year}}"
}
Generate API Key
- Navigate to the dashboard
- Click on“API Keys” under “Advanced”
- Click “Create”
- Add API Key to the application config
Emby
Emby support is added by coincidence due to Jellyfin support (its the same API codebase). I have not tested it and do not plan to. Configure it the same way as Jellyfin and it might work but I cannot guarantee it.
Non-Docker Setup
I don't recommend this as it is more work and you will need to set up systemd or something to keep it running. I don't provide support for this method but if you know what you are doing, it is very easy to build the binary and run it.
TLDR: make build
Usage
Web UI
The web UI is the primary way to configure this application. It is available at http://(your-server-ip):9999
It will automatically restart the application when you save.
Each section has an enable/disable toggle. If you disable a section, it will not be used. For example, if you disable BEQ, it will not load BEQ profiles. If you disable MQTT, it will not send MQTT messages.
General Usage
This application will load BEQ profiles automatically when you play something in Plex. It will also set volume, lights, and mute/unmute minidsp if you enable those options. The application itself is not controlling things like lights but relies on Home Assistant to perform the action via MQTT. In theory, you could use any home automation system but Home Assistant is the only one officially supported but anything that can receive MQTT messages should work.
Home Assistant Quickstart
MQTT
MQTT is used so this application could theoretically be used with any home automation system. Only Home Assistant is officially supported. You will need to set MQTT up first. Detailed instructions here https://www.home-assistant.io/integrations/mqtt/
- Install mosquito mqtt add on
- Install mqtt integration
- Set up your topics in HA and the application's config
- Set up Automations in HA based on the payloads of MQTT
Features that will write to Topics of your choosing:
- Current BEQ Profile
- Lights
- Minidsp mute status
- Item type (Movie, Show, etc)
- Playing status
These Topics allow you to trigger automations in HA based on sensor values such as:
- Triggering HVAC when playing status is true for X minutes (e.g circulate stale air)
- Toggling lights when playing status changes
- Displaying current BEQ profile on a dashboard
- Modulating volume based on item type (e.g a lower volume for shows, higher for movies)
- Muting/unmuting minidsp(s) and showing the status
Here are some sensor examples
mqtt:
binary_sensor:
- name: "subs_muted"
state_topic: "theater/subs/status"
payload_on: "false"
payload_off: "true"
- name: "plex_playing"
state_topic: "theater/plex/playing"
payload_on: "true"
payload_off: "false"
sensor:
- name: "lights"
state_topic: "theater/lights/front"
value_template: "{{ value_json.state }}"
- name: "volume"
state_topic: "theater/denon/volume"
value_template: "{{ value_json.type }}"
- name: "beq_current_profile"
state_topic: "theater/beq/currentprofile"
Automation Example
Here is an example of an automation to change lights based on MQTT.
Assuming you have the following sensor:
mqtt:
sensor:
- name: "lights"
state_topic: "theater/lights/front"
value_template: "{{ value_json.state }}"
This will turn the light(s) on/off depending on the state of the sensor, state is changed by a message sent to the topic
alias: MQTT - Theater Lights
description: Trigger lights when mqtt received, depending on state
trigger:
- platform: mqtt
topic: theater/lights/front
condition: []
action:
- if:
- condition: state
entity_id: sensor.lights
state: "on"
then:
- service: light.turn_on
data: {}
target:
entity_id: light.caseta_r_wireless_in_wall_dimmer
- if:
- condition: state
entity_id: sensor.lights
state: "off"
then:
- service: light.turn_off
data: {}
target:
entity_id: light.caseta_r_wireless_in_wall_dimmer
mode: queued
max: 10
Handlers
/plexwebhook
/jellyfin
/minidspwebhook
This endpoint accepts commands used by minidsp-rs which are performed by EZbeq. Here is how to trigger it with Home Assistant
rest_command:
minidsp:
url: "http://192.168.88.56:9999/minidspwebhook"
method: POST
payload: '{"command": "{{ command }}" }'
content_type: 'application/json'
verify_ssl: false
And then inside an automation, you make an action
# unmute subs
- service: rest_command.minidsp
data:
command: "off" (or "on")
Using the above you can automate the mute and unmute of your minidsp with any automation sourc
