Transform your home into a smart environment with native Apple HomeKit integration! ๐
๐ Features โข ๐ฑ HomeKit Setup โข ๐ง Installation โข ๐ Sensors โข ๐ค Contributing
Turn your ESP8266 into a professional Apple HomeKit Weather Station! This project creates a native HomeKit accessory that appears directly in your iPhone's Home app - no additional apps required!
- Native HomeKit Integration ๐ - Appears directly in Apple Home app
- Dual Sensor Support ๐ - DHT11 + BMP280 for redundancy
- Real-time Monitoring โฑ๏ธ - Live temperature and humidity updates
- Zero Configuration โจ - Automatic HomeKit discovery and pairing
- No Bridge Required: Direct HomeKit accessory (not Homebridge!)
- Home App Integration: Shows up automatically in iOS/macOS Home app
- Siri Compatible: "Hey Siri, what's the temperature in the living room?"
- Automation Ready: Trigger scenes based on temperature/humidity thresholds
- DHT11 Sensor: Temperature (-40ยฐC to +80ยฐC) & Humidity (5%-95%)
- BMP280 Sensor: High-precision temperature backup & atmospheric pressure
- Sensor Redundancy: Automatically switches between sensors for reliability
- Calibrated Readings: Factory-calibrated sensors for accuracy
- Auto-Discovery: Appears in HomeKit setup automatically
- Low Power: Efficient ESP8266 implementation
- OTA Updates: Over-the-air firmware updates (future feature)
- Status LED: Visual feedback for connection status
- Multi-Device Access: iPhone, iPad, Mac, Apple Watch, Apple TV
- Secure Connection: End-to-end encryption via HomeKit protocol
- Remote Access: Control from anywhere via Apple TV/HomePod hub
- Automation Engine: Create complex scenes and automations
- Open Home App on your iPhone/iPad
- Tap "+" โ Add Accessory
- Scan QR Code or enter setup code manually
- Follow Setup Wizard - Name your station and assign to a room
๐ Home App Display:
โโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Meteo Station โ
โ ๐ก๏ธ 23.4ยฐC ๐ง 65% /
โ Living Room โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโ
- "Hey Siri, what's the temperature?"
- "Hey Siri, what's the humidity in the living room?"
- "Hey Siri, is it humid inside?"
- Turn on humidifier when humidity < 40%
- Send notifications when temperature exceeds 26ยฐC
- Control smart thermostat based on room temperature
- Turn on fans when humidity > 70%
Component | Model | Purpose | Price |
---|---|---|---|
Microcontroller | ESP8266 (NodeMCU/Wemos D1) | Main controller | ~$3 |
Temperature/Humidity | DHT11 | Primary sensor | ~$2 |
Pressure/Temp Backup | BMP280 | Secondary sensor | ~$3 |
Breadboard | Half-size | Prototyping | ~$2 |
Jumper Wires | Male-to-Male | Connections | ~$2 |
Power Supply | USB 5V 1A | Power source | ~$3 |
๐ฐ Total Project Cost: ~$15
ESP8266 NodeMCU โ DHT11 Sensor
โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโ
3.3V โ VCC
GND โ GND
D5 (GPIO14) โ DATA
ESP8266 NodeMCU โ BMP280 Sensor
โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโ
3.3V โ VCC
GND โ GND
D1 (GPIO5) โ SCL
D2 (GPIO4) โ SDA
# Install PlatformIO
pip install platformio
# Or use VS Code with PlatformIO extension
git clone https://github.com/Arsalan134/AppleHome-TempHumidity.git
cd AppleHome-TempHumidity
Create src/wifi_info.h
:
#ifndef WIFI_INFO_H_
#define WIFI_INFO_H_
const char* wifi_ssid = "YourWiFiName";
const char* wifi_password = "YourWiFiPassword";
#endif
# Build the project
pio run
# Upload to ESP8266
pio run --target upload
# Monitor serial output
pio device monitor --baud 115200
- Temperature Range: -40ยฐC to +80ยฐC (ยฑ2ยฐC accuracy)
- Humidity Range: 5% to 95% RH (ยฑ5% accuracy)
- Response Time: 6-15 seconds
- Power: 3-5V, 2.5mA max current
- Temperature Range: -40ยฐC to +85ยฐC (ยฑ1ยฐC accuracy)
- Pressure Range: 300-1100 hPa (ยฑ1 hPa accuracy)
- Interface: I2C/SPI (using I2C)
- Power: 1.71-3.6V, 2.7ฮผA current
// Smart sensor switching for reliability
if (dht_reading_valid) {
use_dht11_temperature();
} else {
fallback_to_bmp280_temperature();
}
Located in my_accessory.c
:
// Customize your device info
HOMEKIT_CHARACTERISTIC(NAME, "Meteo Station"),
HOMEKIT_CHARACTERISTIC(MANUFACTURER, "Arsalan"),
HOMEKIT_CHARACTERISTIC(MODEL, "MyTemperatureSensor"),
HOMEKIT_CHARACTERISTIC(FIRMWARE_REVISION, "1.0"),
// Adjust reporting frequency (in main.cpp)
static uint32_t next_report_millis = 0;
const uint32_t REPORT_INTERVAL = 10000; // 10 seconds
// Change sensor pins if needed
#define DHTPIN D5 // DHT11 data pin
// BMP280 uses I2C: D1(SCL), D2(SDA)
Problem | Solution |
---|---|
Device not found in Home app | Check WiFi connection, reset HomeKit pairing |
"No Response" in Home app | Verify ESP8266 is powered and connected to WiFi |
Inaccurate readings | Check sensor wiring, ensure proper power supply |
Constant sensor errors | Verify DHT11 connections, try different pins |
// Add this to setup() function
homekit_storage_reset(); // Clears existing HomeKit pairings
Temperature: 23.4ยฐC
Humidity: 65.2%
HomeKit client connected
Characteristic updated: Temperature
- OTA Updates: Wireless firmware updates
- Web Interface: Browser-based configuration
- Data Logging: Store historical data to SD card
- Multiple Sensors: Support for additional sensor types
- Battery Power: Low-power mode for battery operation
- Display Module: OLED/LCD for local readings
- External Antenna: Better WiFi range
- Weatherproof Case: Outdoor installation
- Solar Panel: Self-powered operation
We welcome contributions! Here's how you can help:
- ๐ง Add support for more sensor types (DHT22, SHT30, etc.)
- ๐ฑ Improve HomeKit integration features
- โก Optimize power consumption
- ๐ Add web-based configuration interface
- ๐ Implement data logging capabilities
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature
) - Commit changes (
git commit -m 'Add amazing feature'
) - Push to branch (
git push origin feature/amazing-feature
) - Open Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
This project uses the open-source HomeKit implementation and is compatible with Apple's HomeKit ecosystem without requiring MFi certification.
Arsalan Iravani
I'm an iOS Developer and Smart Home Enthusiast passionate about bridging Apple's ecosystem with custom hardware. This project showcases the power of native HomeKit integration without expensive commercial solutions.
Other Projects: ๐ฑ iOS Apps โข ๐ HomeKit Accessories โข ๐ Automotive Electronics โข ๐ฉ๏ธ Drone Technology
- BMW-OBD2 - OBD2 RPM visualizer for BMW
- Mazda-OBD2 - OBD2 RPM visualizer for Mazda
- Ground-Lora - LoRa ground control station