shelly schedule create

shelly schedule create

Create a new schedule

Synopsis

Create a new schedule on a Gen2+ Shelly device.

Schedules use cron-like timespec expressions:

  • Format: “ss mm hh DD WW” (seconds, minutes, hours, day of month, weekday)
  • Wildcards: * (any), ranges: 1-5, lists: 1,3,5, steps: 0-59/10
  • Special: @sunrise, @sunset (with optional offset like @sunrise+30)

The calls parameter is a JSON array of RPC calls to execute.

1
shelly schedule create <device> [flags]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
  # Turn on switch at 8:00 AM every day
  shelly schedule create living-room --timespec "0 0 8 * *" \
    --calls '[{"method":"Switch.Set","params":{"id":0,"on":true}}]'

  # Turn off at sunset
  shelly schedule create living-room --timespec "@sunset" \
    --calls '[{"method":"Switch.Set","params":{"id":0,"on":false}}]'

  # Toggle every 30 minutes
  shelly schedule create living-room --timespec "0 */30 * * *" \
    --calls '[{"method":"Switch.Toggle","params":{"id":0}}]'

  # Run script at sunrise + 30 minutes
  shelly schedule create living-room --timespec "@sunrise+30" \
    --calls '[{"method":"Script.Start","params":{"id":1}}]'

Options

1
2
3
4
      --calls string      JSON array of RPC calls to execute (required)
      --enable            Enable schedule after creation (default true)
  -h, --help              help for create
      --timespec string   Cron-like time specification (required)

Options inherited from parent commands

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
      --config string           Config file (default $HOME/.config/shelly/config.yaml)
      --log-categories string   Filter logs by category (comma-separated: network,api,device,config,auth,plugin)
      --log-json                Output logs in JSON format
      --no-color                Disable colored output
      --no-headers              Hide table headers in output
      --offline                 Only read from cache, error on cache miss
  -o, --output string           Output format (table, json, yaml, template) (default "table")
      --plain                   Disable borders and colors (machine-readable output)
  -q, --quiet                   Suppress non-essential output
      --refresh                 Bypass cache and fetch fresh data from device
      --template string         Go template string for output (use with -o template)
  -v, --verbose count           Increase verbosity (-v=info, -vv=debug, -vvv=trace)

SEE ALSO