hass-shooter

command module
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2022 License: MIT Imports: 17 Imported by: 0

README

hass-shooter

Go Reference

hass-shooter is a Home Assistant screenshot capture web server suitable for e-ink displays.

Docs

Please, see the command docs.

Dependencies

Installation

Native

Install the hass-shooter command:

go install github.com/jroimartin/hass-shooter@latest
Home Assistant add-on

hass-shooter is available as a Home Assistant add-on. Its installation and configuration is similar to any other add-on. From your Home Assistant server:

  1. Add this add-ons repository: https://github.com/jroimartin/hass-addons
  2. Install the add-on "HASS Shooter".
  3. Configure the add-on parameters from its Configuration tab.
Docker

Build the hass-shooter Docker image:

docker build -t hass-shooter .

Run it:

docker run -ti --rm -p 8000:8000 -v /config/path:/data \
    hass-shooter -c /data/options.json

Documentation

Overview

hass-shooter is a Home Assistant screenshot capture web server suitable for e-ink displays.

Usage:

hass-shooter [flags]

The flags are:

-c string
	configuration file (default "/data/options.json")

hass-shooter depends on Chromium and ImageMagick, so they must be installed first.

The configuration file is a JSON file with the following format:

{
  "hass_base_url": "https://example.com",
  "hass_token": "ACCESS_TOKEN",
  "hass_pages": [
    {
      "path": "/lovelace/default_view",
      "scale": 1
    }
  ],
  "width": 480,
  "height": 800,
  "rotation": 0,
  "listen_addr": ":8000",
  "ignore_cert_errors": false,
  "refresh_time": 60,
  "min_idle_time": 5,
  "timeout": 60
}

The following configuration parameters are supported:

"hass_base_url" is the URL of the Home Assistant server.

"hass_token" is a Home Assistant long-lived access token. More information: https://developers.home-assistant.io/docs/auth_api/#long-lived-access-token

"hass_pages" contains the Home Assistant pages to capture. "path" is the URL path of the page. The full captured URL is hass_base_url + hass_pages[i].path. "scale" is the scale factor used to capture the page.

"width" is the width of the generate image (usually, the width of the e-ink display).

"height" is the height of the generate image (usually, the height of the e-ink display).

"rotation" is the rotation in degrees applied to the resulting images.

"listen_addr" is the HTTP service address to listen for incoming requests.

"ignore_cert_errors" allows to control certificate checking.

"refresh_time" is the time in seconds between screenshots.

"min_idle_time" is the minimum time in seconds without requests to consider a page to be loaded.

"timeout" is the timeout in seconds used by the headless browser.

The screenshots are served in the path "/<idx>", where <idx> is the index of the entry in the "hass_pages" array. The path "/" is equivalent to "/0".

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL