Skip to content
Jordan Hollinger edited this page Dec 22, 2023 · 13 revisions

You can run one or more programs using the huebot command:

huebot run prog1.yaml prog2.json

If your program uses device inputs ($all, $1, $2, etc), you can pass them in as args:

huebot run prog1.yaml --light "LR Lamp" --group "LR Ceiling"

You can capture programs from pipes or standard input:

cat prog.yaml | huebot run
huebot run < prog.yaml
huebot run -i

Validate your programs before running them:

huebot check prog1.yaml --light "LR Lamp" --group "LR Ceiling"

NOTE All examples are in YAML, but JSON is also supported!

The simplest Huebot program is a single transition. The one below uses input devices, but it could also specify light or group names. Read more about devices.

transition:
  devices:
    inputs: $all
  state:
    on: true
    bri: 254
    ctk: 2700
    time: 2

Interesting programs will have multiple transitions. Huebot can run programs with serial steps, parallel steps, or complex nested structures of both.

The following program shows off nested serial & parallel steps as well as loops.

serial:
  steps:
    # Turn all lights on to a mid brightness
    - transition:
        devices:
          groups:
            - LR Ceiling
          lights:
            - LR Lamp 1
            - LR Lamp 2
        state:
          on: true
          bri: 100

    # Loop these parallel steps for an hour
    - parallel:
        loop:
          timer:
            hours: 1
        steps:
          # Parallel branch 1: Fade a light group up and down
          - serial:
              devices:
                groups:
                  - LR Ceiling
              steps:
                - transition:
                    state:
                      bri: 254
                      time: 10 # transition over 10 seconds
                    pause:
                      after: 5 # pause an extra 5 sec after the transition
                - transition:
                    state:
                      bri: 25
                      time: 10
                    pause:
                      after: 5

          # Parallel branch 2: Fade other lights down and up
          - serial:
              devices:
                lights:
                  - LR Lamp 1
                  - LR Lamp 2
              steps:
                - transition:
                    state:
                      bri: 25
                      time: 10
                    pause:
                      after: 5
                - transition:
                    state:
                      bri: 254
                      time: 10
                    pause:
                      after: 5

    # Finally, dim all the lights
    - transition:
        devices:
          groups:
            - LR Ceiling
          lights:
            - LR Lamp 1
            - LR Lamp 2
        state:
          bri: 75
Clone this wiki locally