Skip to content

Syntax ‐ v1.x

Jordan Hollinger edited this page Dec 26, 2023 · 5 revisions

Each program is one STEP (with potentially infinite nested STEPs) as defined below.

There may also be a name. If omitted, the name of the file will be used.

If version is omitted, the latest 1.x version will be assumed.

name?
version?
STEP = TRANSITION | SERIAL | PARALLEL

TRANSITION

Performs a change on a set of devices (color, brightness, etc).

Devices may be omitted if they're defined in a parent SERIAL or PARALLEL step.

transition:
  DEVICES?
  PAUSE?
  WAIT?
  STATE

STATE

This is where you set your lights' colors, brightness, and turn them on/off. See Transitions for full documentation.

state:
  on: true
  bri: 254

SERIAL

Runs child steps in order. Child steps may be transitions, SERIAL, or PARALLEL steps.

Devices are optional. If given, they'll be used in any child transitions that don't define their own devices.

serial:
  LOOP?
  DEVICES?
  PAUSE?
  steps: STEP[]

PARALLEL

Runs child steps in parallel. Child steps may be transitions, SERIAL, or PARALLEL steps.

Devices are optional. If given, they'll be used in any child transitions that don't define their own devices.

parallel:
  LOOP?
  DEVICES?
  PAUSE?
  steps: STEP[]

DEVICES

Defines one or more groups, lights, or CLI inputs that will be used in a transition.

devices:
  GROUPS?
  LIGHTS?
  INPUTS?

GROUPS

Groups of Hue lights.

groups:
  - Downstairs
  - Upstairs

LIGHTS

Individual Hue lights.

lights:
  - Lamp 1
  - Lamp 2

INPUTS

Numbered references to Hue lights and groups passed from the command line. The special input $all refers to every light or group passed in.

inputs: $all | inputs:
                 - $1
                 - $2

PAUSE

Pauses the program for N seconds before and/or after the current step is finished.

Version 1.0

pause: 5 # seconds after

Version 1.1

pause: 3

pause:
  before: 1.5
  after: 3

Version 1.2

pause: 3

pause:
  before: 1.5
  after: 3

pause:
  before:
    random:
      min: 1.2
      max: 10
  after:
    random:
      min: 5
      max: 20.5

WAIT

Version 1.1

By default, Huebot pauses the program until a transition is complete. To skip this, set wait: false.

transition:
  state:
    ...
  wait: false

LOOP

Several types of loops may be used inside a SERIAL or PARALLEL step.

LOOP = INFINITE_LOOP | COUNTED_LOOP | RANDOM_LOOP | TIMER_LOOP | DEADLINE_LOOP

INFINITE_LOOP

Runs until you kill the program.

loop:
  infinite: true
  PAUSE?

COUNTED_LOOP

Performs the step N times.

loop:
  count: 10
  PAUSE?

RANDOM_LOOP

Performs the loop a random number of times:

loop:
  random:
    min: 1
    max: 10
  PAUSE?

TIMER_LOOP

Performs the loop until time has run out.

loop:
  timer:
    hours: 1    # optional, defaults to 0
    minutes: 15 # optional, defaults to 0
  PAUSE?

DEADLINE_LOOP

Performs the loop until the given time.

loop:
  until:
    date: "YYYY-MM-DD" # optional, defaults to current date
    time: "HH:MM"      # optional, defaults to "00:00"
  PAUSE?