Package: greenscreen-control
A simple module, command line utility and tcp server to headlessly control aGreenScreeninstallation and a set of
Chromecasts. Controls the assignment of GreenScreen channels to
Chromecasts using the GreenScreen API, and then can start/stop casting
to a particular Chromecast.Requires a workingGreenScreeninstallation.AppIDIn these instructions, $APPID is the value of your “Application ID” from theGoogle Cast Developer Console. This will
have been setup as part of theGreenScreeninstallation.Using the command line utilitySet the CCTV channel on the Kitchen Chromecast:$ greenscreen_control -c CCTV set-channel KitchenStart casting a given AppID on a Chromecast:$ greenscreen_control -a $APPID cast KitchenStop casting on the Kitchen Chromecast:$ greenscreen_control stop-cast KitchenAvailable arguments:usage: greenscreen_control_cli.py [-h] [-g GREENSCREEN_SERVER] [-a APPID]
                                  [-c CHANNEL] [-l {ERROR,WARNING,INFO,DEBUG}]
                                  [-r TRIES] [-t TIMEOUT] [-w RETRY_WAIT]
                                  {set-channel,cast,stop-cast} chromecast

positional arguments:
  {set-channel,cast,stop-cast}
                        Command
  chromecast            Chromecast name

optional arguments:
  -h, --help            show this help message and exit
  -g GREENSCREEN_SERVER, --greenscreen_server GREENSCREEN_SERVER
                        GreenScreen server:port
  -a APPID, --appid APPID
                        Chromecast Greenscreen App ID
  -c CHANNEL, --channel CHANNEL
                        GreenScreen channel to set
  -l {ERROR,WARNING,INFO,DEBUG}, --loglevel {ERROR,WARNING,INFO,DEBUG}
                        Logging level
  -r TRIES, --tries TRIES
                        Chromecast connection tries. Default is infinite.
  -t TIMEOUT, --timeout TIMEOUT
                        Chromecast socket timeout seconds. Default is 30.
  -w RETRY_WAIT, --retry_wait RETRY_WAIT
                        Seconds to wait between Chromecast retries. Default is
                        5.Starting the serverStart a simple TCP server (default port 4995) to control greenscreen and
Chromecast casting.$ greenscreen_control_server -l INFO -a $APPIDAvailable arguments:usage: greenscreen_control_server.py [-h] [-g GREENSCREEN_SERVER] [-a APPID]
                                     [-c CHANNEL]
                                     [-l {ERROR,WARNING,INFO,DEBUG}]
                                     [-r TRIES] [-t TIMEOUT] [-w RETRY_WAIT]
                                     [-p PORT]

optional arguments:
  -h, --help            show this help message and exit
  -g GREENSCREEN_SERVER, --greenscreen_server GREENSCREEN_SERVER
                        GreenScreen server:port
  -a APPID, --appid APPID
                        Chromecast Greenscreen App ID
  -c CHANNEL, --channel CHANNEL
                        GreenScreen channel to set
  -l {ERROR,WARNING,INFO,DEBUG}, --loglevel {ERROR,WARNING,INFO,DEBUG}
                        Logging level
  -r TRIES, --tries TRIES
                        Chromecast connection tries. Default is infinite.
  -t TIMEOUT, --timeout TIMEOUT
                        Chromecast socket timeout seconds. Default is 30.
  -w RETRY_WAIT, --retry_wait RETRY_WAIT
                        Seconds to wait between Chromecast retries. Default is
                        5.
  -p PORT, --port PORT  TCP server port numberServer ProtocolThe TCP server uses a simple line-based protocol, easily controlled from
scripts, cron or home automation.Assign the “CCTV” channel to the “Kitchen” chromecast, and start casting
it:chromecast=Kitchen,channel=CCTV,cast=1Assign the “CCTV” channel to the “Kitchen” chromecast, don’t cast it
(either prepares for future casting, or assumes already casted):chromecast=Kitchen,channel=CCTVCast the currently assigned channel (whatever that is):chromecast=Kitchen,cast=1Stop casting:chromecast=Kitchen,cast=0Starting the server by defaultUse the included greenscreen_control.service to start the server as a systemd
unit.