WallPanel Common API

March 10, 2018 ยท View on GitHub

Commands

KeyValueExample PayloadDescription
clearCachetrue{"clearCache": true}Clears the browser cache
evalJavaScript{"eval": "alert('Hello World!');"}Evaluates Javascript in the dashboard
audioURL{"audio": "http://<url>"}Play the audio specified by the URL immediately
relaunchtrue{"relaunch": true}Relaunches the dashboard from configured launchUrl
reloadtrue{"reload": true}Reloads the current page immediately
urlURL{"url": "http://<url>"}Browse to a new URL immediately
waketrue{"wake": true}Wakes the screen if it is asleep
  • Commands are constructed via valid JSON. It is possible to string multiple commands together:
    • eg, {"clearCache":true, "relaunch":true}
  • For REST
    • POST the JSON to URL http://[mywallpanel]:2971/api/command
  • For MQTT
    • WallPanel subscribes to topic [baseTopic]/command
      • Default Topic: wallpanel/mywallpanel/command
    • Publish a JSON payload to this topic

State

KeyValueExampleDescription
currentUrlURL String{"currentUrl":"http://hasbian:8123/states"}Current URL the Dashboard is displaying
screenOntrue/false{"screenOn":true}If the screen is currently on
  • State values are presented together as a JSON block
    • eg, {"currentUrl":"http://hasbian:8123/states","screenOn":true}
  • For REST
    • GET the JSON from URL http://[mywallpanel]:2971/api/state
  • For MQTT
    • WallPanel publishes state to topic [baseTopic]/state
      • Default Topic: wallpanel/mywallpanel/state

Sensors

SensorKeysExampleNotes
batteryunit, value, charging, acPlugged, usbPlugged{"unit":"%", "value":"39", "acPlugged":false, "usbPlugged":true, "charging":true}
brightnessunit, value{"unit":"lx", "value":"920"}
pressureunit, value{"unit":"??", "value":"21"}
motionvalue{"value": false}Published immediately when motion detected

NOTE: Sensor values are device specific. Not all devices will publish all sensor values.

  • Sensor values are constructued as JSON per the above table
  • For MQTT
    • WallPanel publishes all sensors to MQTT under [baseTopic]/sensor
    • Each sensor publishes to a subtopic based on the type of sensor
      • Example: wallpanel/mywallpanel/sensor/battery

Configuration

KeyValueBehaviorDefault
app.deviceIdStringThe unique identifier for this WallPanel devicemywallpanel
app.preventSleeptrue/falsePrevents the screen from turning offfalse
app.launchUrlURLThe URL the Dashboard launches atTutorial Webpage
app.showActivitytrue/falseOn-screen indication of browser activitytrue
camera.cameraIdintThe camera ID to attach to0
camera.motionEnabledtrue/falseIf the device camera is used for motion detectionfalse
camera.motionCheckIntervalintThe interval the camera is polled for motion in milliseconds500
camera.motionLeniencyintThe leniency on changes in pictures between polls20
camera.motionMinLumaintThe minimum light needed to perform motion detection1000
camera.motionWaketrue/falseIf motion activity should wake the devicetrue
PLANNED: camera.webcamEnabledtrue/falseIf the device camera is used as a webcamfalse
http.enabledtrue/falseSwitch for REST(HTTP) being enabledfalse
http.portintThe port to listen on for REST(HTTP)2971
mqtt.enabledtrue/falseSwitch for MQTT being enabledfalse
mqtt.serverNameStringThe hostname/IP of the MQTT servermqtt
mqtt.serverPortIntThe port number for TCP MQTT1883
mqtt.baseTopicStringThe root topic WallPanel will pub/sub underwallpanel/{app.deviceId}/
mqtt.clientIdStringThe client ID to connect to MQTT with{app.deviceId}
mqtt.usernameStringThe username to connect to MQTT with (or blank)
mqtt.passwordStringThe password to connect to MQTT with (or blank)
mqtt.sensorFrequencyIntThe frequency to post sensor data in seconds, or 0 to never post0

NOTE: Currently these are only configured locally, but the roadmap is considering external configuration (pull or push?) options