├── README.md └── graphics ├── WallPanel-Logo.png ├── WallPanel-Logo.svg ├── wallpanel_icon.pxm └── wallpanel_icon_purple.png /README.md: -------------------------------------------------------------------------------- 1 | # WallPanel Common API 2 | 3 | ## Commands 4 | Key | Value | Example Payload | Description 5 | -|-|-|- 6 | clearCache | true | ```{"clearCache": true}``` | Clears the browser cache 7 | eval | JavaScript | ```{"eval": "alert('Hello World!');"}``` | Evaluates Javascript in the dashboard 8 | audio | URL | ```{"audio": "http://"}``` | Play the audio specified by the URL immediately 9 | relaunch | true | ```{"relaunch": true}``` | Relaunches the dashboard from configured launchUrl 10 | reload | true | ```{"reload": true}``` | Reloads the current page immediately 11 | url | URL | ```{"url": "http://"}``` | Browse to a new URL immediately 12 | wake | true | ```{"wake": true}``` | Wakes the screen if it is asleep 13 | 14 | * Commands are constructed via valid JSON. It is possible to string multiple commands together: 15 | * eg, ```{"clearCache":true, "relaunch":true}``` 16 | * For REST 17 | * POST the JSON to URL ```http://[mywallpanel]:2971/api/command``` 18 | * For MQTT 19 | * WallPanel subscribes to topic ```[baseTopic]/command``` 20 | * Default Topic: ```wallpanel/mywallpanel/command``` 21 | * Publish a JSON payload to this topic 22 | 23 | ## State 24 | Key | Value | Example | Description 25 | -|-|-|- 26 | currentUrl | URL String | ```{"currentUrl":"http://hasbian:8123/states"}``` | Current URL the Dashboard is displaying 27 | screenOn | true/false | ```{"screenOn":true}``` | If the screen is currently on 28 | 29 | * State values are presented together as a JSON block 30 | * eg, ```{"currentUrl":"http://hasbian:8123/states","screenOn":true}``` 31 | * For REST 32 | * GET the JSON from URL ```http://[mywallpanel]:2971/api/state``` 33 | * For MQTT 34 | * WallPanel publishes state to topic ```[baseTopic]/state``` 35 | * Default Topic: ```wallpanel/mywallpanel/state``` 36 | 37 | ## Sensors 38 | Sensor | Keys | Example | Notes 39 | -|-|-|- 40 | battery | unit, value, charging, acPlugged, usbPlugged | ```{"unit":"%", "value":"39", "acPlugged":false, "usbPlugged":true, "charging":true}``` | 41 | brightness | unit, value | ```{"unit":"lx", "value":"920"}``` | 42 | pressure | unit, value | ```{"unit":"??", "value":"21"}``` | 43 | motion | value | ```{"value": false}``` | Published immediately when motion detected 44 | 45 | *NOTE:* Sensor values are device specific. Not all devices will publish all sensor values. 46 | 47 | * Sensor values are constructued as JSON per the above table 48 | * For MQTT 49 | * WallPanel publishes all sensors to MQTT under ```[baseTopic]/sensor``` 50 | * Each sensor publishes to a subtopic based on the type of sensor 51 | * Example: ```wallpanel/mywallpanel/sensor/battery``` 52 | 53 | ## Configuration 54 | Key | Value | Behavior | Default 55 | -|-|-|- 56 | app.deviceId | String | The unique identifier for this WallPanel device | mywallpanel 57 | app.preventSleep | true/false | Prevents the screen from turning off | false 58 | app.launchUrl | URL | The URL the Dashboard launches at | Tutorial Webpage 59 | app.showActivity | true/false | On-screen indication of browser activity | true 60 | camera.cameraId | int | The camera ID to attach to | 0 61 | camera.motionEnabled | true/false | If the device camera is used for motion detection | false 62 | camera.motionCheckInterval | int | The interval the camera is polled for motion in milliseconds | 500 63 | camera.motionLeniency | int | The leniency on changes in pictures between polls | 20 64 | camera.motionMinLuma | int | The minimum light needed to perform motion detection | 1000 65 | camera.motionWake | true/false | If motion activity should wake the device | true 66 | PLANNED: camera.webcamEnabled | true/false | If the device camera is used as a webcam | false 67 | http.enabled | true/false | Switch for REST(HTTP) being enabled | false 68 | http.port | int | The port to listen on for REST(HTTP) | 2971 69 | mqtt.enabled | true/false | Switch for MQTT being enabled | false 70 | mqtt.serverName | String | The hostname/IP of the MQTT server | mqtt 71 | mqtt.serverPort | Int | The port number for TCP MQTT | 1883 72 | mqtt.baseTopic | String | The root topic WallPanel will pub/sub under | wallpanel/{app.deviceId}/ 73 | mqtt.clientId | String | The client ID to connect to MQTT with | {app.deviceId} 74 | mqtt.username | String | The username to connect to MQTT with (or blank) | 75 | mqtt.password | String | The password to connect to MQTT with (or blank) | 76 | mqtt.sensorFrequency | Int | The frequency to post sensor data in seconds, or 0 to never post | 0 77 | 78 | *NOTE:* Currently these are only configured locally, but the roadmap is considering external configuration (pull or push?) options 79 | -------------------------------------------------------------------------------- /graphics/WallPanel-Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WallPanel-Project/wallpanel-api/e8a458f1acf8adc5179e0e00915128e952cdba05/graphics/WallPanel-Logo.png -------------------------------------------------------------------------------- /graphics/WallPanel-Logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /graphics/wallpanel_icon.pxm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WallPanel-Project/wallpanel-api/e8a458f1acf8adc5179e0e00915128e952cdba05/graphics/wallpanel_icon.pxm -------------------------------------------------------------------------------- /graphics/wallpanel_icon_purple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WallPanel-Project/wallpanel-api/e8a458f1acf8adc5179e0e00915128e952cdba05/graphics/wallpanel_icon_purple.png --------------------------------------------------------------------------------