How hiteshrawat289/heatguard works
HeatGuard is a prototype smartphone-based heat-strain early-warning service. A worker profile and GPS weather feed a personalized WBGT estimate and risk band, which inform a work/rest/hydration plan and a localized message delivered over WhatsApp, SMS, or IVR. A separate WhatsApp self-registration flow collects worker context. The README documents the main computation sequence; sampled source confirms key orchestration and registration behaviors. Some delivery and scheduling details are unsampled, so uncertain links are omitted.
Main entry points: orchestrator.py Daily alert orchestrator · registration_flow.py Registration conversation · iso7243.py Risk classification · whatsapp.py WhatsApp sender
Components 19
Risk assessment
- WBGT estimate
HeatGuard/heatstrain/wbgt.py - Risk classification
HeatGuard/heatstrain/iso7243.py - Payout likelihood
HeatGuard/heatstrain/insurance.py - Weather fetch
HeatGuard/heatstrain/weather.py
Worker guidance
- Rest and hydration
HeatGuard/heatstrain/rest_cycle.py - Localized message
HeatGuard/heatstrain/messages.py
Alert delivery
- Daily alert orchestrator
HeatGuard/heatstrain/delivery/orchestrator.py - Worker registry
HeatGuard/heatstrain/delivery/orchestrator.py - Message cache
HeatGuard/heatstrain/delivery/orchestrator.py - Channel interface
HeatGuard/heatstrain/delivery/base.py - WhatsApp sender
HeatGuard/heatstrain/delivery/whatsapp.py - SMS sender
HeatGuard/heatstrain/delivery/sms.py - Voice IVR sender
HeatGuard/heatstrain/delivery/ivr.py
Worker onboarding
- Registration conversation
HeatGuard/heatstrain/delivery/registration_flow.py - Registration state
HeatGuard/heatstrain/delivery/registration.py
Other components
- Worker
- Open-Meteo
- WhatsApp webhook
HeatGuard/examples/webhook_server.py - Twilio
Connections 28
- Worker → Daily alert orchestrator: provides profile
README.md - Daily alert orchestrator → Weather fetch: fetches weather
HeatGuard/heatstrain/delivery/orchestrator.py - Weather fetch → Open-Meteo: requests conditions
README.md - Daily alert orchestrator → WBGT estimate: computes WBGT
README.md - WBGT estimate → Risk classification: supplies WBGT
README.md - Daily alert orchestrator → Risk classification: classifies risk
HeatGuard/heatstrain/delivery/orchestrator.py - Risk classification → Rest and hydration: sets risk plan
README.md - Risk classification → Payout likelihood: checks threshold
README.md - Daily alert orchestrator → Payout likelihood: checks likelihood
HeatGuard/heatstrain/delivery/orchestrator.py - Daily alert orchestrator → Rest and hydration: builds guidance
HeatGuard/heatstrain/delivery/orchestrator.py - Daily alert orchestrator → Localized message: renders alert
HeatGuard/heatstrain/delivery/orchestrator.py - Rest and hydration → Localized message: supplies plan
README.md - Payout likelihood → Localized message: adds note
README.md - Daily alert orchestrator → Worker registry: reads profiles
HeatGuard/heatstrain/delivery/orchestrator.py - Daily alert orchestrator → Message cache: caches message
HeatGuard/heatstrain/delivery/orchestrator.py - Daily alert orchestrator → WhatsApp sender: dispatches alert
HeatGuard/heatstrain/delivery/orchestrator.py - Daily alert orchestrator → SMS sender: dispatches alert
HeatGuard/heatstrain/delivery/orchestrator.py - Daily alert orchestrator → Voice IVR sender: dispatches alert
HeatGuard/heatstrain/delivery/orchestrator.py - WhatsApp sender → Channel interface: implements interface
HeatGuard/heatstrain/delivery/whatsapp.py - SMS sender → Channel interface: implements interface
HeatGuard/heatstrain/delivery/sms.py - Voice IVR sender → Channel interface: implements interface
HeatGuard/heatstrain/delivery/ivr.py - WhatsApp sender → Twilio
- Worker → WhatsApp webhook: sends replies
- WhatsApp webhook → Registration conversation: routes messages
- Registration conversation → Registration state: tracks progress
HeatGuard/heatstrain/delivery/registration_flow.py - Registration conversation → WhatsApp sender: sends prompts
HeatGuard/heatstrain/delivery/registration_flow.py - Registration conversation → Worker registry: stores profile
HeatGuard/heatstrain/delivery/registration_flow.py - Registration conversation → Daily alert orchestrator: starts first alert
HeatGuard/heatstrain/delivery/registration_flow.py