Introduction: IKEA VINDRIKTNING + BME280 + D1mini

About: Linux System Administrator

Enhance IKEA Sensor by adding Temperature, Pressure and Humidity sensor (BME280)

Step 1: Download and Install ESPHome Locally

Install docker.io

debain based: apt install docker.io

Download ESPHome docker image

docker pull esphome/esphome:latest

Create an alias for esphome docker command

edit ~/.bashrc and add the following line
alias esphome='docker run --rm -v "${PWD}"/esphome-config:/config --device=/dev/ttyUSB0 --net=host -it esphome/esphome'

As root add your user to the docker group

usermod -a -G docker <your user>

Step 2: Run ESPHome

Run in terminal as your user

esphhome

Access the esphome gui

http://localhost:6052/

Step 3: Add the Sensor

Add the new sensor and install the initial firmware

Install by selecting Plug Into The Computer Running ESPHome Dashboard

Edit the sensor and put the following code

esphome:
  name: bedroom-sensor

esp8266:
  board: d1_mini

# Enable logging
logger:

i2c:
  sda: D6
  scl: D5
  scan: False
 
# Ikea Vindriktning PM2.5 sensor
uart:
  rx_pin: D2
  baud_rate: 9600

sensor:
  - platform: bme280
    temperature:
      name: "BME280-1 Temperature"
      oversampling: 16x
    pressure:
      name: "BME280-1 Pressure"
    humidity:
      name: "BME280-1 Humidity"
    # Address is not default!
    address: 0x76
    update_interval: 60s
  - platform: pm1006
    pm_2_5:
      name: "Ikea Vindriktning PM25"
      filters:
        - sliding_window_moving_average:
            window_size: 10
            send_every: 10
# Enable Home Assistant API
api:

ota:

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  fast_connect: true

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:

captive_portal:


Step 4: Solder All of the Components

From D1mini to BME 280

3v3 pin
ground pin
D5 to SCL
D6 to SDA

From D1mini to pm1006

5V pin
Ground
D2 to REST