A productivity enforcement system that automatically turns off your LG TV when you have incomplete tasks in Things 3. Perfect for those who need a little extra motivation to complete their to-do list before relaxing with TV time.
- The system periodically checks Things 3 for tasks with a specific tag (default: "do the thing")
- If any tagged tasks exist, and your LG TV is on, it will automatically turn off your TV
- An LG WebOS TV with network connectivity
- Things 3 app (for task integration)
- macOS (required for Things 3 integration)
-
Clone the repository
git clone https://github.com/yourusername/first-do-the-thing.git cd first-do-the-thing -
Install dependencies:
npm install -
Copy
.env.exampleto.envand update with your configuration:cp .env.example .env -
Obtain your LG TV key:
node scripts/get-tv-key.jsFollow the on-screen instructions to authorize the application on your TV.
-
Update your
.envfile with the obtained TV key. -
Build the project:
npm run build
Start the server:
npm start
For development with auto-reload:
npm run dev
scripts/get-tv-key.js- Get the client key for your LG TV
The application can be configured using environment variables in the .env file:
| Variable | Description | Default |
|---|---|---|
| PORT | Server port | 3000 |
| TV_IP | IP address of the LG TV | - |
| TV_PORT | WebSocket port for the TV | 3001 |
| TV_KEY | Client key for TV authentication | - |
| TV_STATUS_CHECK_INTERVAL | Interval for checking TV status (ms) | 10000 |
| THINGS3_TAG | Tag to search for in Things 3 | do the thing |
| THINGS3_CHECK_INTERVAL | Interval for checking tasks (ms) | 300000 |
The application includes a web-based admin interface that allows you to:
- View the current system status with visual indicators
- See outstanding tasks from Things 3
- Check tasks manually
- Turn off the TV directly (when it's on)
- Monitor system logs in real-time
The admin interface automatically refreshes every 30 seconds to show the latest information, with TV status updating more frequently (every 2-3 seconds).
To access the admin interface, open your browser and navigate to:
http://localhost:3000
POST /api/check-tasks- Manually trigger a task check and TV controlGET /api/status- Get the current status of the systemGET /api/logs- Get system logsGET /api/tasks- Get outstanding tasks with the configured tagPOST /api/tv/turn-off- Directly turn off the TVGET /api/tv/status- Get the current TV connection status

