Commands, settings, SDK functions, anything in the docs.

Use the CLI

Settings and alarms

Change a display’s language, time zone, brightness and updates, and set its alarms.

On this page

A display's settings and its alarms are stored on LEDABLE's servers, and the CLI tells the display to fetch them after each change, as the phone app does. The examples use $DEVICE for the display's id, as Set up a display explains.

Read the settings

Terminal
ledable settings get --device "$DEVICE"

settings get prints every setting, and how many alarms are set:

JSON
{
  "load": "loaded",
  "write_error": null,
  "settings": {
    "language": "en-US",
    "timezone": "Europe/Berlin",
    "timezonePosixRule": "SDT-1DST-2,M3.5.0/2,M10.5.0/3",
    "displayDurationMs": 10000,
    "autoOtaUpdate": true,
    "brightness": {
      "brightness": 128,
      "autoBrightness": false,
      "autoBrightnessOffset": 0
    }
  },
  "alarms": 2
}

A setting that was never set reads as the value the display then uses.

Change a setting

Terminal
ledable settings language de-DE --device "$DEVICE"
ledable settings timezone Europe/Berlin --device "$DEVICE"
ledable settings duration 15 --device "$DEVICE"
ledable settings brightness 90 --auto on --device "$DEVICE"
ledable settings auto-update on --device "$DEVICE"
  • settings language takes a language and region the app offers, such as en-US, de-DE or zh-CN.
  • settings timezone takes a city time zone such as Europe/Berlin or America/New_York. UTC and the Etc/ zones are not offered. The display follows the zone's daylight saving time by itself.
  • settings duration sets how many seconds each playlist entry shows, unless the entry has its own duration.
  • settings brightness sets the brightness. --auto on lets the light sensor adjust it, and --offset makes the result brighter or dimmer than the sensor suggests; write a negative offset as --offset=-10.
  • settings auto-update turns automatic firmware updates on or off. To update by hand, see Firmware and logs.

Each prints "state": "stored" with the settings as they now are. A value outside what the display takes is refused before anything is written; the reference gives each command's range.

settings page runs the app's settings page and takes one change per line on stdin, which suits several changes in a row; see Scripting.

Alarms

A display rings at the times of its weekly alarm schedule. Each alarm is a time of the week, in seconds, and a sound:

Output
second_of_week = day * 86400 + hour * 3600 + minute * 60

day counts from Sunday, which is 0, and the time is the display's own, in the time zone it is set to. Monday at 07:30 is 1 * 86400 + 7 * 3600 + 30 * 60, which is 113400. A shell can do the sum for you:

Terminal
ledable alarms add $((1*86400 + 7*3600 + 30*60)) --device "$DEVICE"
ledable alarms list --device "$DEVICE"

alarms add adds one alarm, ringing the built-in tone or, with --sound, a sound file on the display. alarms list prints the schedule in the order the alarms ring:

JSON
[
  {
    "second_of_week": 113400,
    "sound_filename": ""
  }
]

An empty sound_filename is the built-in tone. alarms remove removes every alarm at one time of the week, whatever its sound.

Set the whole schedule

To set every alarm at once, write the schedule in a file and replace the display's with it. This one rings at 07:30 on every weekday:

weekdays.json
[
  { "second_of_week": 113400, "sound_filename": "" },
  { "second_of_week": 199800, "sound_filename": "" },
  { "second_of_week": 286200, "sound_filename": "" },
  { "second_of_week": 372600, "sound_filename": "" },
  { "second_of_week": 459000, "sound_filename": "" }
]
Terminal
ledable alarms replace weekdays.json --device "$DEVICE"

alarms replace stores the file's schedule in place of the old one; an empty array [] removes every alarm.

Limits

The display holds at most 5 different sounds, the built-in tone counting as one, at most 20 times for each sound, and a sound file name of at most 63 bytes. A schedule beyond that is refused before anything is written, because the display would reject its whole configuration, every other setting included. The same time twice with the same sound counts once.