Connect a weather sensor to your Apple HomeKit setup so you can monitor current conditions from all your smart devices.
The HomeKit-enabled smart weather station we’re going to build today works the same way as the official Elgato Eve Diploma, which costs around $80. This is a completely homemade weather station that you can make for less than $10 and integrate it into the Apple Home app on your iOS and macOS devices, such as iPhone, iPad, and MacBook. It also works with smart home automation software, such as Home Assistant.
Things you will need
To build this DIY mart weather station for Apple HomeKit, on which it is recognized as Elgato Eve Degree, you will need the following components:
- D1 Mini or NodeMCU board (ESP8266)
- BME280 Temperature, Humidity and Barometric Pressure Sensor Module
- OLED SSD1306 display (0.96″ or 1.3″, 128×64) (optional)
- A few connecting wires
- Soldering iron and tin
- macOS or Windows PC or laptop
- Micro USB cable
- 5V USB power supply
- 3D printed case (from a drawing on Printables) to house the components
Flash firmware
To make this DIY weather station, we will use the HomeKid firmware. For this you will need access to a macOS or Windows system and a micro USB cable. The instructions for flashing the firmware are as follows:
On macOS
- Download the NodeMCU-PyFlasher.dmg program (from GitHub) and run it on your macOS system.
- Connect the D1 Mini or NodeMCU board to your macOS machine using the micro USB cable, then choose the serial port.
- Click on Browse and choose the main.bin file (GitHub).
- In Baud rateselect 115200.
- Select Quad I/O (QIO).
- Choose clear flash And yes, erase all data.
- Finally, click on the Flash Node MCU button. After a while, the connected D1 Mini or NodeMCU will flash.
On Windows PC/Laptop
- Use the micro USB cable to connect the D1 Mini board to the system.
- Download Espressif Flash Download Tools and extract the zip folder.
- Open the extracted folder and run the flash_download_tool_xx.exe to file.
- Choose ESP8266 In chip type and click ALL RIGHT.
- Click on the first three checkboxes and do the following,
- Type 0x0000 in the first field and click on three dots to select the rboot.bin file (GitHub download).
- Type 0x1000 in the second field and select the blank_config.bin file (GitHub download).
- Type 0x2000 in the third field and select the main.bin file (GitHub).
- Then select the following options,
- Baud rate: 115200.
- Flash size: 4MB.
- Flash mode: DIO or QIO.
- SPI speed: 40MHz.
- Choose the COM port where the D1 Mini or NodeMCU board is connected. Click on Begin. This will begin flashing firmware to the connected D1 Mini or NodeMCU board and may take up to two minutes.
Once the firmware has been successfully flashed, you must restart the device by unplugging the USB power supply and then following the instructions below to connect the card to your Wi-Fi network.
Connect to Wi-Fi network
Close Flash Download tool and connect the D1 Mini to the power adapter or your system.
- On your iOS device, such as an iPhone, open Wi-Fi settings and connect to the HomeKid-XXXX Wi-Fi access point. Use password 12345678.
- In the connection window, tap your WLAN network, then enter the Wi-Fi password. Tap Join. The device will shut down the hotspot, disconnect from your smartphone, and connect to your Wi-Fi network using the password you provided.
If the WLAN network password is wrong, the device will restart the access point (AP) after a while. You can reconnect to the hotspot and enter the correct password.
Connect the components
Refer to the diagram below to connect the BME280 and SSD1306 OLED display to the D1 Mini or NodeMCU board.
- Connect the D1 pin to the SCL brooch BME280.
- Connect the D2 pin to the SDA brooch BME280.
- Connect the D5 pin to the SDA hairpin SSD1306 OLED display.
- Connect the D7 pin to the SCL hairpin SSD1306 OLED display.
- Connect the 3.3V pin to the VDC And VIN pins of the BME280 And SSD1306 OLED display.
- Connect the g pin to the Earth pins of the BME280 And SSD1306 OLED display.
Add the weather station to the Apple Home app (HomeKit)
Connect the micro USB cable to the D1 Mini or NodeMCU and on your iPhone, iPad or MacBook, open the Home app. Then follow these steps to add the HomeKit-enabled DIY weather station as an accessory to the Home app. The weather station we made will be recognized and added as an unofficial accessory. However, it will work the same as an official Elgato Eve Degree sensor for Apple HomeKit.
- Open the Home app, tap the + icon and choose Add an accessory.
- Tap the More actions… then press the uncovered temperature/humidity sensor accessory.
- Faucet Add anyway then enter the code 02182017. Faucet Continue.
- Select the location or room where you will install and use the weather station and press the Continue button.
- You can modify or change the name of the DIY weather station accessory. Faucet Continue > Done.
- Temperature and humidity values will begin to display below the room name. You can tap the accessory at any time to open the control panel and change the properties of the weather station sensor.
To view barometric pressure values and altitude, you will need to install the Eve for HomeKit app on your iOS device. This application provides a much nicer and more intuitive user interface. Installing the app is highly recommended to use this unofficial DIY HomeKit accessory, just like we added the Elgato Eve DIY HomeKit motion sensor.
Troubleshooting Common Problems
If you experience one or more of the following issues, you will need to re-flash the firmware:
- The wireless access point is not visible or cannot find the HomeKid-xxxx AP in Wi-Fi settings.
- The weather station is not visible in the Apple HomeKit app.
In this case, use the flash tools to erase the D1 Mini or NodeMCU board and re-flash the microcontroller board with HomeKidd firmware.
Most Affordable Home Weather Station
You can build and use this affordable DIY HomeKit weather station to measure temperature, humidity, and barometric pressure at your current location or in a room. You can use this sensor to further automate other devices in your Home app, such as a fan or HVAC unit when the temperature rises or falls to a certain value. You can also add and integrate this sensor into a Home Assistant server and create multiple automations for your smart home.