A lightweight, modular dashboard for embedded and IoT devices. SHAD displays widgets like time, weather, local sensor data, calendar events, and background camera feeds from up to 18 cameras. Optimized for lower power ARM devices such as Raspberry Pi 4, you can run 4 camera feeds at around 50% CPU utilization.
Essentially a weather station/clock with background camera feeds for any device capable of running Chromium, or other lightweight browsers with video decoding.
- Modular ES6 Architecture: Complete rewrite from single monolithic HTML to a clean, modular JavaScript architecture with ES6 modules.
- Service-Based Design: Separated concerns into dedicated services:
ConfigManager.js- Central configuration and state managementCameraManager.js- HLS camera stream handling with health monitoringWeatherService.js- Weather data fetching and city searchSensorService.js- Temperature/humidity sensor pollingCalendarService.js- Calendar events and banner displayWidgetManager.js- Widget positioning, resizing, and visibilityhelpers.js- Utility functions (throttle, debounce, formatting)
- Multiple Themes: Choose between Dark, Cats, and Space themes with unique color schemes and fonts.
- Calendar Event Banner: Display scrolling event messages for specific dates with sliding animation.
- HD Mode: New
?dashboard=0URL parameter for camera-only display on powerful devices. - Improved Camera Health Monitoring: Auto-recovery for stalled/frozen camera feeds every 5 seconds.
- Sequential Camera Loading: Staggered initialization for kiosk mode to prevent overwhelming low-power devices.
- Page Visibility Handling: All services pause when tab is hidden, resume on visibility (saves resources).
- Memory Leak Prevention: Proper cleanup of HLS instances, event listeners, and abort controllers.
- Camera Stream Stability: Live sync positioning, cache-busting for manifests, and exponential backoff retries.
- Rate Limiting: Weather API calls now rate-limited to prevent excessive requests.
- XSS Prevention: HTML escaping for user-provided content (city names, calendar messages).
- Improved Error Handling: AbortController support for cancelable fetch requests across all services.
- Widget Boundary Enforcement: Widgets stay within viewport bounds when dragging/resizing.
- Font Scaling: Automatic font size adjustment based on widget dimensions.
src/
├── index.html
├── config/
│ ├── calendar.json # Calendar events
│ └── shad_default1.conf # Configuration presets
├── css/
│ └── styles.css # All styles with theme support
├── js/
│ ├── main.js # Application entry point
│ ├── ConfigManager.js # Central configuration
│ ├── services/
│ │ ├── CalendarService.js
│ │ ├── CameraManager.js
│ │ ├── SensorService.js
│ │ └── WeatherService.js
│ ├── utils/
│ │ └── helpers.js
│ └── widgets/
│ └── WidgetManager.js
└── scripts/
├── kiosk.sh
└── readSensor.sh
- Lightweight & Modular: Clean ES6 module architecture, easy to extend.
- Easy Setup: Just copy the
src/folder to any HTTP server. - Customizable Widgets:
- Time and Date (EU format by default).
- Weather with 4-day forecast (updates every 15 minutes).
- Temperature and Humidity sensors.
- Up to 18 camera feeds in HLS format (.m3u8).
- Calendar event banner with date-based messages.
- Configurable:
- Save up to 10 different configuration presets.
- Widgets can be toggled, moved, and resized via drag-and-drop.
- Background opacity and blur adjustments.
- Multiple color themes (Dark, Cats, Space).
- Two Display Modes:
- Kiosk Mode (
?dashboard=1): Full dashboard with widgets (default). - HD Mode (
?dashboard=0): Camera-only display for high-power devices.
- Kiosk Mode (
- Robust Camera Handling: Health monitoring, auto-recovery, and staggered loading.
- An HTTP server (e.g., Apache, NGINX)
- Any modern web browser on client terminal
- Optional: Raspberry Pi 4 or similar ARM device for low-power setups
- Optional: Restreamer for camera feeds
- Optional:
wtypeutility for kiosk mode
-
Download SHAD
Clone or download the repository to your local machine:
git clone https://github.com/koksny/SHAD.git
-
Set Up HTTP Server
Copy the
src/folder contents to the root directory of your HTTP server.cp -r SHAD/src/* /var/www/html/ -
Access the Dashboard
Open your web browser and navigate to your server's address:
http://yourserveraddress/index.html
-
Open Settings
Open SHAD in your browser and click the ⚙️ settings button.
-
Customize Dashboard
- Toggle widgets on or off.
- Move and resize widgets by dragging.
- Adjust theme, opacity, blur, and font sizes.
-
Export Configuration
At the bottom of the Settings panel, click on Export Configuration.
-
Save Configuration
- A JSON file will be downloaded.
- Rename it to
shad_default1.conf.
-
Deploy Configuration
Place the renamed configuration file in the
config/directory.cp shad_default1.conf /var/www/html/config/
-
Store Multiple Presets
You can store up to 10 presets, named
shad_default0.conftoshad_default9.confin theconfig/folder. -
Switch via Keyboard
Press keys
0-9to switch between configurations. -
Switch via URL
Add
?config=Nto your URL to load a specific configuration.http://yourserveraddress/index.html?config=3
Calendar events display as a scrolling banner at the bottom of the screen.
-
Create Events via Settings
- Navigate to Calendar Management in Settings.
- Select a date and enter a message.
- Click "Save Event".
-
Edit
calendar.jsonDirectlyPlace a
calendar.jsonfile in theconfig/directory:{ "2024-12-25": "Merry Christmas! 🎄", "2024-12-31": "Happy New Year! 🎉" } -
Export Calendar
Use the "Export Calendar" button in Settings to download your events.
-
Supported Formats: HLS (
.m3u8links preferred), RTSP (limited browser support). -
Recommendation:
Use Restreamer to convert RTSP to HLS.
-
Optimization:
Reduce bitrate, resolution, and framerate for low-power devices.
-
Auto-Recovery:
Cameras are monitored every 5 seconds. Stalled feeds are automatically restarted.
-
Supported Sensors: Temperature and Humidity from GPIO or Bluetooth devices.
-
Data Feeding:
Save sensor data to
sensor1.txtorsensor2.txtin the root directory.- Format:
T:xx.x|M:xx - Example:
T:23.5|M:45(Temperature: 23.5°C, Humidity: 45%)
- Format:
-
Update Intervals:
Configure refresh intervals (in seconds) in the Settings panel.
-
Note:
SHAD does not provide a backend for sensor data. You must handle updating the sensor
.txtfiles yourself.
-
Automatic Updates:
The weather widget updates every 15 minutes using the Open-Meteo API.
-
City Search:
Type a city name (minimum 3 characters) to see suggestions.
-
Data Displayed:
- Current temperature and weather icon
- Wind speed and gusts
- Pressure and humidity
- 4-day forecast
SHAD supports two display modes via the dashboard URL parameter:
-
Kiosk Mode (default):
?dashboard=1- Shows all widgets and UI elements.
- Cameras load sequentially (better for Raspberry Pi).
-
HD Mode:
?dashboard=0- Camera-only display, no widgets.
- Cameras load simultaneously (for powerful devices).
- Calendar banner is hidden.
Example: http://yourserver/index.html?config=1&dashboard=0
SHAD includes three built-in themes:
| Theme | Description | Font |
|---|---|---|
| Dark | Default dark mode with blue accents | Inter |
| Cats | Purple/pink theme with warm accents | Quicksand |
| Space | Deep purple theme with cosmic vibes | Space Grotesk |
Change themes in the Settings panel under "Theme".
To run SHAD as a kiosk on a Raspberry Pi:
-
Edit
kiosk.sh- Open
scripts/kiosk.shin a text editor. - Change the SHAD server address to your server.
- Open
-
Make Executable
chmod +x scripts/kiosk.sh
-
Add to Autostart
- Add
kiosk.shto your autostart script or crontab.
- Add
-
Dependencies
Ensure
wtypeis installed for automatic page reload:sudo apt install wtype
-
Customization
If the reload issue doesn't occur on your setup, you can remove the
sleepandwtypecommands fromkiosk.sh.
If you're using the $4 Xiaomi Bluetooth thermometer:
-
Edit
readSensor.sh- Change the Bluetooth MAC address to match your device.
-
Set Up Cron Job
crontab -e
Add a line like:
*/5 * * * * /path/to/scripts/readSensor.sh
This runs the script every 5 minutes.
SHAD includes built-in health status for debugging. Open the browser console and run:
configManager.getHealthStatus()This returns the status of all services including:
- Camera health (playing, stalled, retry count)
- Weather service status
- Sensor polling status
- Widget states
- Author: Koksny
- Weather Data: Open-Meteo - Free weather API.
- Libraries:
- HLS.js - HTTP Live Streaming in JavaScript.
- interact.js - Drag and resize functionality.
This project is licensed under the MIT License.

