Aurélien P.
Workflows by Aurélien P.
Send daily weather forecasts from OpenWeatherMap to Telegram with smart formatting
# 🌤️ Daily Weather Forecast Bot A comprehensive n8n workflow that fetches detailed weather forecasts from OpenWeatherMap and sends beautifully formatted daily summaries to Telegram. ## 📋 Features - **📊 Daily Overview**: Complete temperature range, rainfall totals, and wind conditions - **⏰ Hourly Forecast**: Weather predictions at key times (9AM, 12PM, 3PM, 6PM, 9PM) - **🌡️ Smart Emojis**: Context-aware weather icons and temperature indicators - **💡 Smart Recommendations**: Contextual advice (umbrella alerts, clothing suggestions, sun protection) - **🌪️ Enhanced Details**: Feels-like temperature, humidity levels, wind speed, UV warnings - **📱 Rich Formatting**: HTML-formatted messages with emojis for excellent readability - **🕐 Timezone-Aware**: Proper handling of Luxembourg timezone (CET/CEST) ## 🛠️ What This Workflow Does 1. **Triggers daily at 7:50 AM** to send morning weather updates 2. **Fetches 5-day forecast** from OpenWeatherMap API with 3-hour intervals 3. **Processes and analyzes** weather data with smart algorithms 4. **Formats comprehensive report** with HTML styling and emojis 5. **Sends to Telegram** with professional formatting and actionable insights ## ⚙️ Setup Instructions ### 1. OpenWeatherMap API - Sign up at [OpenWeatherMap](https://openweathermap.org/api) - Get your free API key (1000 calls/day included) - Replace `API_KEY` in the HTTP Request node URL ### 2. Telegram Bot - Message [@BotFather](https://t.me/BotFather) on Telegram - Send `/newbot` command and follow instructions - Copy the bot token to n8n credentials - Get your chat ID by messaging the bot, then visiting: - https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates - Update the `chatId` parameter in the Telegram node ### 3. Location Configuration - Default location: Strassen, Luxembourg - To change: modify `q=Strassen` in the HTTP Request URL - Format: `q=CityName,CountryCode` (e.g., `q=Paris,FR`) ## 🎯 Technical Details - **API Source**: OpenWeatherMap 5-day forecast - **Schedule**: Daily at 7:50 AM (configurable) - **Format**: HTML with rich emoji formatting - **Error Handling**: 3 retry attempts with 5-second delays - **Rate Limits**: Uses only 1 API call per day - **Timezone**: Europe/Luxembourg (handles CET/CEST automatically) ## 📊 Weather Data Analyzed - Temperature ranges and "feels like" temperatures - Precipitation forecasts and accumulation - Wind speed and conditions - Humidity levels and comfort indicators - Cloud coverage and visibility - UV index recommendations - Time-specific weather patterns ## 💡 Smart Features - **Conditional Recommendations**: Only shows relevant advice - **Night/Day Awareness**: Different emojis for time of day - **Temperature Context**: Color-coded temperature indicators - **Weather Severity**: Appropriate icons for weather intensity - **Humidity Comfort**: Comfort level indicators - **Wind Analysis**: Descriptive wind condition text ## 🔧 Customization Options - **Schedule**: Modify trigger time in the Schedule node - **Location**: Change city in HTTP Request URL - **Forecast Hours**: Adjust `desiredHours` array in the code - **Temperature Thresholds**: Modify emoji temperature ranges - **Recommendation Logic**: Customize advice triggers ## 📱 Sample Output 🌤️ Weather Forecast for Strassen, LU 📅 Monday, 2 June 2025 📊 Daily Overview 🌡️ Range: 12°C - 22°C 💧 Comfortable (65%) ⏰ Hourly Forecast 🕒 09:00 ☀️ 15°C 🕒 12:00 🌤️ 20°C 🕒 15:00 ☀️ 22°C (feels 24°C) 🕒 18:00 ⛅ 19°C 🕒 21:00 🌙 16°C 📡 Data from OpenWeatherMap | Updated: 07:50 CET ## 🚀 Getting Started 1. Import this workflow to your n8n instance 2. Add your OpenWeatherMap API key 3. Set up Telegram bot credentials 4. Test manually first 5. Activate for daily automated runs ## 📋 Requirements - n8n instance (cloud or self-hosted) - Free OpenWeatherMap API account - Telegram bot token - Basic understanding of n8n workflows --- **Perfect for**: Daily weather updates, team notifications, personal weather tracking, smart home automation triggers.
Send hourly crypto market analysis from Binance to Telegram
# 📈 Daily Crypto Market Summary Bot (Binance to Telegram) This workflow fetches 24h price change data from Binance for selected crypto pairs (BTC/USDC, ETH/USDC, SOL/USDC) every hour using a cron schedule. It performs in-depth analysis—including volatility, volume, bid-ask spread, momentum, and market comparison—then formats a detailed market summary. The final report is sent to a Telegram chat using HTML formatting, highlighting top gainers, losers, and key metrics in a clean, readable layout. --- ## 🔑 Key Features - ⏱ Runs every hour (`cron: 5 * * * *`) - 🔍 Filters and analyzes major coins: BTC, ETH, SOL - 📊 Calculates market metrics: - Volatility - Bid-ask spread - Momentum - Estimated market cap - Market average comparison - 📈 Highlights gainers, losers, and top coins by volume - ✂️ Splits messages to fit Telegram’s 4096 character limit - 💬 Sends output in rich HTML format to a Telegram group or chat --- ## 🎯 Use Cases - ✅ Crypto traders wanting hourly performance insights - ✅ Telegram groups needing automated market updates - ✅ Analysts monitoring key coin metrics in real-time - ✅ Bot developers creating crypto dashboards or alerts --- ## 🛠 Technical Details - **Data Source:** Binance 24hr ticker API (`/api/v3/ticker/24hr`) - **Coins Monitored:** `BTCUSDC`, `ETHUSDC`, `SOLUSDC` (can be expanded) - **Metrics Calculated:** - Price change percentage - Volatility (high vs low price) - Bid-ask spread % - Momentum (vs weighted average) - Estimated market cap - Number of trades - Market average movement - **Message Format:** - HTML with emojis, bold styling, and section headings - Auto-split messages when exceeding Telegram's 4096-char limit - **Error Handling:** - Retry on HTTP failure (up to 5 times with 5s delay) - Message length checked and split for Telegram compatibility --- ## ⚙️ Setup Requirements 1. **Telegram Bot Token** — Create a bot via [@BotFather](https://t.me/BotFather) on Telegram 2. **Chat ID** — Use a personal ID or group chat ID (add the bot to the group) 3. **n8n Instance** — Either cloud or self-hosted 4. *(Optional)* Modify `relevantSymbols` in the Function node to track different coins --- ## 🧠 Notes - This workflow is highly customizable—feel free to modify the analytics, tracked pairs, or formatting. - Great base for alerting systems or crypto dashboards. --- ## 📷 Example Output (Telegram) ```html 📊 Crypto Market Summary — 2025-04-20 14:05:05 UTC 🌐 Market Overview (BTC, ETH, SOL) Average Change: -1.54% 24h Volume: $850,358,765.46 Most Volatile: SOLUSDC (4.53%) Most Liquid: BTCUSDC (0.0000% spread) 💹 Top by Volume ETHUSDC: $403,860,356.75 | -1.640% SOLUSDC: $279,241,338.60 | -1.706% BTCUSDC: $167,257,070.12 | -1.261% 📉 Losers SOLUSDC 🔻 Change: -1.71% (24h) 💰 Current: $137.10 📊 Range: $135.82 - $141.97 📈 Volatility: 4.53% 🔄 Volume: 2.01M | $279,241,338.60 ⚖️ Bid-Ask Spread: 0.0073% ⬇️ vs Market Avg: -0.17% 🔽 Momentum: -1.42% 🔢 Trades: 366,119 ETHUSDC 🔻 Change: -1.64% (24h) 💰 Current: $1,577.42 📊 Range: $1,565.60 - $1,631.98 📈 Volatility: 4.24% 🔄 Volume: 252.11K | $403,860,356.75 ⚖️ Bid-Ask Spread: 0.0044% ⬇️ vs Market Avg: -0.10% 🔽 Momentum: -1.53% 🔢 Trades: 596,801 BTCUSDC 🔻 Change: -1.26% (24h) 💰 Current: $84,336.65 📊 Range: $83,963.35 - $85,634.50 📈 Volatility: 1.99% 🔄 Volume: 1.97K | $167,257,070.12 ⚖️ Bid-Ask Spread: 0.0000% ⭐ vs Market Avg: 0.27% 🔽 Momentum: -0.68% 🔢 Trades: 124,202