Voice-controlled weather app for MentraOS smart glasses with location-based forecasts.
- Voice Commands: Ask "What's the weather?" or "Weather in [city name]"
- Auto-Location: Automatically detects your current location for local weather
- Current Conditions: Temperature, weather description, humidity, and wind
- Multiple Cities: Get weather for any city by voice command
- Smart Display: Clean, readable weather cards optimized for smart glasses
- Audio Feedback: Spoken weather summaries for hands-free use
- Node.js 18+ installed
- MentraOS developer account at console.mentraglass.com
- OpenWeatherMap API key from openweathermap.org
- ngrok for local development
-
Clone the repository:
git clone https://github.com/buildwithfenna/WeatherToday.git cd WeatherToday -
Install dependencies:
npm install # or bun install -
Set up environment variables:
cp .env.example .env
Edit your .env file with the following required variables:
# MentraOS Configuration (Required)
MENTRAOS_API_KEY=your_mentraos_api_key_here
MENTRAOS_PACKAGE_NAME=com.yourcompany.weathertoday
# Weather API Configuration (Required)
OPENWEATHER_API_KEY=your_openweather_api_key_here
# Server Configuration (Optional)
PORT=3000
NGROK_URL=your_ngrok_url_here
NODE_ENV=developmentWhere to get API keys:
- MENTRAOS_API_KEY: Get from console.mentraglass.com after registering your app
- OPENWEATHER_API_KEY: Free API key from OpenWeatherMap
- Register your app at console.mentraglass.com
- Set package name:
com.yourcompany.weathertoday(or your preferred package name) - Set webhook URL: Your ngrok URL +
/webhook(e.g.,https://your-ngrok-url.ngrok.io/webhook) - Required permissions:
MICROPHONE- For voice commandsLOCATION- For current location weather
-
Start the development server:
npm run dev # or bun run dev -
Expose with ngrok (in a separate terminal):
ngrok http --url=your-ngrok-url 3000
-
Test on your MentraOS device:
- Install the Mentra app on your phone
- Launch your WeatherToday! app
- Try voice commands like:
- "What's the weather?"
- "Weather in New York"
- "Current conditions"
- "What's the weather?" - Gets weather for your current location
- "Weather in [city]" - Gets weather for any city (e.g., "Weather in Tokyo")
- "Current conditions" - Shows current weather conditions
- "How's the weather?" - Alternative way to ask for current weather
- Select Button: Get current location weather
- Back Button: Return to welcome screen
npm run build
npm start# Run in development mode with hot reload
npm run dev
# Build TypeScript
npm run build
# Lint code
npm run lint
# Format code
npm run format"Permission denied" errors:
- Ensure MICROPHONE and LOCATION permissions are enabled in the MentraOS Developer Console
- Check that users have approved permissions when installing the app
"Failed to fetch weather data" errors:
- Verify your OpenWeatherMap API key is valid and has sufficient quota
- Check internet connectivity
Location timeout errors:
- Location requests timeout after 10 seconds
- Try specifying a city name instead: "Weather in [your city]"
App not responding to voice commands:
- Check that MICROPHONE permission is granted
- Ensure your ngrok tunnel is active and webhook URL is correct in the developer console
MIT License - see LICENSE file for details.
For MentraOS SDK questions, visit the MentraOS documentation or join the developer community.