A secure, real-time thermostat dashboard that displays your Home Assistant climate data with Lightning Network QR codes. Built with a modern industrial aesthetic.
- Real-time thermostat monitoring - Updates every 30 seconds
- Secure API handling - Your Home Assistant token never touches the browser
- Lightning QR codes - Two scannable Lightning LNURL codes
- Responsive design - Works beautifully on desktop, tablet, and mobile
- Visual indicators - Color-coded heating/cooling states with animations
- Go to GitHub and create a new repository
- Name it something like
exergy-thermostat(or whatever you prefer) - Make it Public (required for free Vercel hosting)
- Don't add README, .gitignore, or license yet
Upload these files to your new repository:
index.htmlstyle.cssscript.jsapi/thermostat.jsREADME.md(this file)
Option A: Via GitHub Web Interface
- Click "Add file" → "Upload files"
- Drag all files into the upload area
- Click "Commit changes"
Option B: Via Git Command Line
git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/YOUR_USERNAME/YOUR_REPO_NAME.git
git push -u origin main- Go to vercel.com
- Click "Sign Up" and choose "Continue with GitHub"
- Authorize Vercel to access your GitHub account
- Click "Add New..." → "Project"
- Find your repository and click "Import"
- Leave all settings as default
- Click "Deploy"
CRITICAL STEP - Your Home Assistant credentials need to be securely stored:
- In Vercel, go to your project
- Click "Settings" tab
- Click "Environment Variables" in the left sidebar
- Add these three variables:
| Name | Value | Notes |
|---|---|---|
HA_URL |
https://yourhomeassistant.com |
Your Home Assistant URL (no trailing slash) |
HA_TOKEN |
yourtokenkey... |
Your Long-Lived Access Token |
ENTITY_ID |
climate.your_thermostat |
Your thermostat entity ID |
- Make sure to select "Production", "Preview", and "Development" for each variable
- Click "Save"
- Go to "Deployments" tab
- Click the three dots (...) on your latest deployment
- Click "Redeploy"
- Check "Use existing Build Cache"
- Click "Redeploy"
Your dashboard will be live at: https://your-project-name.vercel.app
✅ Token stored in Vercel's encrypted environment variables
✅ Token only used on Vercel's servers (backend)
✅ Browser only receives thermostat data, never the token
✅ GitHub repository contains zero secrets
Even if someone:
- Views your website source code
- Inspects network traffic
- Clones your GitHub repo
They will never see your Home Assistant URL or access token.
-
Use HTTPS for Home Assistant
- If using Nabu Casa, you're already set
- If self-hosted, use a reverse proxy (Nginx/Caddy) with Let's Encrypt
-
Restrict Home Assistant Access
- Use firewall rules to limit external access
- Consider Tailscale or WireGuard VPN
- Enable fail2ban for failed login attempts
-
Monitor Token Usage
- Regularly check Home Assistant logs
- Rotate tokens periodically
- Revoke tokens if compromised
Edit script.js line 5:
REFRESH_INTERVAL: 30000, // milliseconds (30000 = 30 seconds)The QR codes are hardcoded in script.js lines 6-9. To change them:
- Edit the
CONFIG.QR_CODESarray - Commit and push to GitHub
- Vercel will auto-deploy
All colors are defined as CSS variables in style.css lines 1-14. You can easily change the entire color scheme by modifying these values.
Currently displays Fahrenheit. To change to Celsius:
- Edit
index.htmlline 23: Change°Fto°C - Edit
script.jsline 63: Change°Fto°C
- ✅ Chrome/Edge (recommended)
- ✅ Firefox
- ✅ Safari
- ✅ Mobile browsers
Check these in order:
-
Vercel Environment Variables
- Go to Vercel → Settings → Environment Variables
- Verify all three variables are set correctly
- Make sure there are no extra spaces in values
- Click "Redeploy" after any changes
-
Home Assistant Connection
- Can you access your Home Assistant URL in a browser?
- Is your token still valid? (Check HA Profile → Long-Lived Access Tokens)
- Is the entity ID correct? (Check Developer Tools → States in HA)
-
Browser Console
- Open Developer Tools (F12)
- Check Console tab for error messages
- Look for failed network requests
-
Vercel Function Logs
- Go to Vercel → Deployments → Click your deployment
- Scroll to "Function Logs" section
- Look for error messages
This means the API call succeeded but the data format is unexpected:
- Verify your entity ID is a
climateentity - Check that the entity has
current_temperatureattribute - View the raw API response in browser dev tools
- Ensure the QR code content is valid
- Lightning URLs must start with
lightning: - Try scanning with different QR code apps
your-repo/
├── index.html # Main HTML page
├── style.css # Styling and animations
├── script.js # Frontend logic and QR generation
├── api/
│ └── thermostat.js # Vercel serverless function (SECURE!)
└── README.md # This file
If you run into issues:
- Check the troubleshooting section above
- Review Vercel function logs
- Verify your Home Assistant is accessible
- Check that your token hasn't expired
MIT License - Feel free to use and modify!
Built with ⚡ and ❄️ for the Exergy Office