Welcome to Raspberry Pi 5 repository
5. AI Weather Station
OpenClaw AI Weather Station Tutorial
Before starting, please complete [01-Peripheral Hardware Configuration], [02-OpenClaw API-KEY Configuration], [03-OpenClaw Model Switching], [04-AI Voice Interaction Configuration], and [05-Three Dialogue Configuration Tests] in the
Preparation Before Usedirectory. If you are only using TUI/WhatsApp, you can skip04. This article assumes the basic environment is ready and only covers the AI weather station project itself.
1. Tutorial Objectives
This article demonstrates OpenClaw's capability in the desktop weather station scenario through temperature and humidity collection, information display, and AI explanation. After completing this tutorial, readers will be able to:
- Understand how to combine DHT, OLED, and RGB into a local AI weather station
- Communicate with OpenClaw via WhatsApp, TUI, and voice commands
- Complete four project scenarios: environmental collection, AI broadcast, weather card, status warning
2. Hardware Preparation
- OpenClaw main control board
- DHT temperature and humidity sensor
- OLED display screen
- RGB light strip / RGB LED module
[Optional] AI voice module + speaker- Wiring diagram

3. Software Preparation
Code entry points used in this tutorial:
- Temperature and humidity reading command:
/home/pi/hardware_hal_demo/dht - OLED control command:
/home/pi/hardware_hal_demo/oled - RGB control command:
/home/pi/hardware_hal_demo/rgb - Voice entry:
/home/pi/voice_to_openclaw/src/main.py - Terminal text entry:
/home/pi/voice_to_openclaw/src/text_main.py
The focus of this tutorial is "local environment weather station", which is based on DHT indoor temperature and humidity data for display and explanation;
4. Testing Project Basic Capabilities
Before starting this project, please complete an openclaw tui basic conversation self-check first; if you haven't done this yet, see [05-Three Dialogue Configuration Tests]. After passing, proceed with the AI weather station-specific test.
It is recommended to first enter OpenClaw TUI:
openclaw tui
Then test the following types of commands in sequence:
- Read current temperature and humidity
- Display weather card on OLED
- If environment is normal, light up green light
- Give me a brief environmental broadcast
5. Three Ways to Communicate with OpenClaw
| Method | Suitable Scenario | Advantages | Suggested Use |
|---|---|---|---|
| Remote environment viewing, classroom demonstration | Suitable for remotely asking "how is the environment now" | Demonstrate "remote weather station assistant" | |
| TUI | Local debugging, threshold verification | Easiest to troubleshoot sensor and display logic | First to get the collection chain working |
| Voice Code | Voice broadcast, desktop assistant | More like daily usage experience | As the final demonstration solution |
If you have the optional AI voice module + speaker, the TUI and WhatsApp conversations need to broadcast OpenClaw's replies. You can run the following program in the terminal. This is not needed for AI voice module conversations.
- Modify the TTS enable parameter
xxxxxxxxxx/home/pi/voice_to_openclaw/.env
xxxxxxxxxxENABLE_TTS=true # This parameter controls whether to broadcast replies. After saving, run the program below in the terminal.- Terminal input
xxxxxxxxxxcd ~/voice_to_openclawsource .venv/bin/activatepython -m src.openclaw_session_tts
5.1 WhatsApp Solution
For WhatsApp integration and bot creation steps, please refer directly to [05-Three Dialogue Configuration Tests]. After creating, you can remotely check the environment status in WhatsApp, for example:
- How is the indoor environment now? If it's too hot, remind me

5.2 TUI Solution
If you have already completed the TUI self-check from chapter 0, directly enter terminal text dialogue:
xxxxxxxxxxopenclaw tuiThen input project-related commands, for example:
- Get Beijing's current weather and display it on OLED

5.3 Voice Code Solution
xxxxxxxxxxRequires optional AI voice interaction module + speaker
For voice module installation, environment configuration, and basic wake-up flow, please refer directly to [04-AI Voice Interaction Configuration]. After waking up, you can directly speak control content, for example:
- AI weather station

6. Project Implementation
Note: All demonstrations below use the openclaw tui method for conversation. You can also choose WhatsApp or voice to complete.
6.1 Scenario 1: Environmental Collection
Experiment Objective
Read the temperature and humidity of the local environment to complete the most basic data sampling for the weather station.
Effect Description
OpenClaw will call DHT to get current ambient data and return the results to the user, forming a real-time "weather reading" of the indoor environment.
Example Commands
- Read current ambient temperature and humidity
- What are the current indoor temperature and humidity
- Help me check current weather data
6.2 Scenario 2: AI Broadcast
Experiment Objective
Have OpenClaw, not just report numbers, but also summarize the environment status like a weather broadcaster.
Effect Description
OpenClaw can summarize "26 degrees, 57% humidity" into more natural phrases such as "environment is quite comfortable", "a bit muggy", "air is a bit dry", etc.
Example Commands
- Give me a brief environmental broadcast
- Is the current environment comfortable
- Make a weather summary based on current readings
6.3 Scenario 3: OLED Weather Card
Experiment Objective
Display the local temperature and humidity results as a page more like a "weather card".
Effect Description
Besides pure text results, OLED can also arrange location, status, temperature, and humidity into a concise card, making the entire project more like a displayable desktop device.
Example Commands
- Display an indoor weather card on OLED
- Get current weather for xx location and display it on OLED
6.4 Scenario 4: RGB Status Warning
Experiment Objective
Quickly express the current environment status with RGB colors.
Effect Description
For example, light up green when environment is normal, yellow when it's too hot, and red when abnormal. This way, even without looking at text, you can quickly know what state the current environment is in.
Example Commands
- Light up green light if environment is normal
- Light up yellow light if temperature is high
- Light up red light and flash if abnormal