Skip to content

Global Commands

run~

accepted parameters: name of a .cmd or .jsonl file present on the flash filesystem of the plate. Filename must be preceeded by the / character

Run a batch script or load a jsonl page.

Example

run /script.cmd
run /pages_party_mode.jsonl

jsonl~

accepted parameters: one or more json formatted lines

Create new objects or update the properties of an existing object. When updating an existing object the obj property is not required and will be ignored.

Each line in the jsonl payload defines one object and has to be in the json format. If the payload exceeds the MQTT buffer of 2 kB it will be cut off to fit, don't send too many lines in a single payload, you can always sends multiple jsonl commands.

Example

1
jsonl {"obj":"btn","id":14,"x":120,"y":1,"w":30,"h":40,"text_font":"2","text":"Test","text_color":"gray","bg_opa":0,"border_width":0}

For more details see Pages and Objects.

json~

accepted parameters: json array of strings

Use the json command to send multiple commands as an array of strings in one payload.

Example

1
json ['page 3','backlight {"state":"ON","brightness":100}','idle off']

This command will change to page 3, turn the backlight on at ~40% brightness and reset the idle timer.

page~

accepted parameters: [1-12], prev, next or back

Switches the display to show the objects from a different page and return the page number in state/page.

Calling the page command without a parameter will return the value of the current page in state/page.

clearpage~

accepted parameters: [0-12] or all

Deletes all objects on a given page. If no page number is specified, it clears the current page. Use clearpage all to clear all objects on all pages.

To delete individual objects, you can issue the pXbY.delete command.

backlight~

accepted json keys:

  • state: on/off, true/false, 0/1, yes/no
  • brightness: 1..255

Example

backlight {"state":"on","brightness":128} sets the display to half the brightness.

Instead of a json payload, you can use a simple payload. To change the state, use either on/off, true/false, 0, yes/no. A simple integer payload of 1..255 will adjust the brightness.

Example

backlight off
backlight 200 sets the display brightness to ~80%.

moodlight~

accepted json keys:

  • state: on/off, true/false, 0/1, yes/no
  • brightness: 1..255
  • color or
  • r, g, b: 0..255

An RGB moodlight can be controlled by configuring 3 [GPIO pins][3] as type Mood Red, Mood Green and Mood blue. These leds can then be controlled together using the moodlight command.

Example

1
2
3
4
moodlight {"state":"off","color":"green"}
moodlight {"state":true,"color":"#ff00e7"}
moodlight {"color":12345}
moodlight {"state":"on","r":255,"g":0,"b":255}
  • The state key accepts [boolean values][2] to turn the moodlight on or off
  • The brightness key can be set between 1 and 255 to dim the moodlight
  • The color key accepts [color values][1] to set the RGB channels at once
  • Individual r, g and b keys can also be used to set each channel separately

Calling the moodlight command without parameters (or sending an empty payload to the hasp/<nodename>/command/moodlight topic) returns the current state:

Example

1
"state/moodlight" {"state":"ON","brightness":255,"color":"#ff0000","r":255,"g":0,"b":0}

The color is returned as a hexadecimal value and as individual RGB channels.

idle~

accepted parameters: off, short or long

Sets the idle state of the device and publishes the new state via a state/idle status message.

off resets the idle counter as if a touch event occurred on the device. This is helpful e.g. when you want to wake up the display when an external event has occurred, like a PIR motion sensor.

short or long sets the idle timer to the number of seconds configured in the [Display Settings][4]. You can use this to force an idle state, for example at night or when leaving the house.

Calling the idle command without a parameter will also return the current idle state short, long or off in the state/idle topic.

output[x]~

where [x] is number of the gpio pin (0-39)

accepted json keys:

  • state: on/off, true/false, 0/1, yes/no
  • val: 0..255

Changes the state GPIO pin to on or off. If the pin is configured as a LED or Serial Dimmer then the val key will control the brightness.

Note

If the GPIO is assigned to a group then objects and other GPIOs that share the same groupid will change state accordingly.

input[x]~

where [x] is number of the gpio pin (0-39)

read-only

Returns a JSON object containing the current state of the input, either on or off

Example

1
input4 => {"state":"on"}

Last update: 2024-04-26