111 lines
2.7 KiB
Markdown
111 lines
2.7 KiB
Markdown
# Matrix64 LED Display
|
|
|
|
Display Home Assistant and Netdata data on a 64x64 LED matrix controlled by a Raspberry Pi.
|
|
|
|
## Features
|
|
|
|
- **Weather Display**: Current weather icon and outdoor temperature
|
|
- **Interior Climate**: Temperature and humidity from BTH01-3132 sensor
|
|
- **HDD Temperatures**: From Netdata server
|
|
- **Automatic Brightness**: Adjusts based on ambient light sensor
|
|
|
|
## Project Structure
|
|
|
|
```
|
|
matrix64/
|
|
├── matrix.py # Main entry point
|
|
├── config.py # Environment configuration
|
|
├── weather_icons.py # Weather icon drawing functions
|
|
├── home_assistant.py # Home Assistant API client
|
|
├── netdata.py # Netdata API client
|
|
├── matrix64.service # Systemd service file
|
|
├── install.sh # Installation script
|
|
├── update.sh # Auto-update script
|
|
├── requirements.txt # Python dependencies
|
|
├── .env.example # Configuration template
|
|
└── .env # Your configuration (gitignored)
|
|
```
|
|
|
|
## Installation on Raspberry Pi
|
|
|
|
### Quick Install
|
|
|
|
```bash
|
|
# Download and run the install script
|
|
curl -sSL https://gitlab.kingstudio.es/jocaru/matrix64/-/raw/master/install.sh | sudo bash
|
|
```
|
|
|
|
### Manual Install
|
|
|
|
```bash
|
|
# Clone the repository
|
|
sudo git clone https://gitlab.kingstudio.es/jocaru/matrix64 /opt/matrix64
|
|
cd /opt/matrix64
|
|
|
|
# Install dependencies
|
|
sudo pip3 install -r requirements.txt
|
|
|
|
# Create your configuration
|
|
sudo cp .env.example .env
|
|
sudo nano .env # Edit with your values
|
|
|
|
# Install and enable the service
|
|
sudo cp matrix64.service /etc/systemd/system/
|
|
sudo systemctl daemon-reload
|
|
sudo systemctl enable matrix64
|
|
sudo systemctl start matrix64
|
|
```
|
|
|
|
## Configuration
|
|
|
|
Edit `/opt/matrix64/.env` with your values:
|
|
|
|
```env
|
|
# Home Assistant
|
|
HA_TOKEN=your_long_lived_access_token
|
|
HASS_URL=https://your-hass-instance.com
|
|
|
|
# Entity IDs
|
|
BRIGHTNESS_ENTITY_ID=sensor.your_brightness_sensor
|
|
WEATHER_ENTITY_ID=weather.forecast_home
|
|
INTERIOR_TEMP_ENTITY_ID=sensor.bth01_3132_temperature
|
|
INTERIOR_HUMIDITY_ENTITY_ID=sensor.bth01_3132_humidity
|
|
|
|
# Netdata
|
|
NETDATA_URL=http://your-netdata-server:19999
|
|
```
|
|
|
|
## Service Management
|
|
|
|
```bash
|
|
# Start/stop/restart
|
|
sudo systemctl start matrix64
|
|
sudo systemctl stop matrix64
|
|
sudo systemctl restart matrix64
|
|
|
|
# Check status
|
|
sudo systemctl status matrix64
|
|
|
|
# View logs
|
|
sudo journalctl -u matrix64 -f
|
|
```
|
|
|
|
## Auto-Updates
|
|
|
|
The install script sets up a cron job that:
|
|
- Checks for updates every 5 minutes
|
|
- Pulls changes if available
|
|
- Restarts the service automatically
|
|
|
|
To disable auto-updates:
|
|
```bash
|
|
crontab -e # Remove the matrix64 line
|
|
```
|
|
|
|
## Manual Execution
|
|
|
|
```bash
|
|
cd /opt/matrix64
|
|
sudo python3 matrix.py --led-rows=64 --led-cols=64
|
|
```
|