Skip to content

Instantly share code, notes, and snippets.

@bruxy70
Last active April 17, 2025 10:27
Show Gist options
  • Save bruxy70/e668e00e94b34bf699488fe1d8de379a to your computer and use it in GitHub Desktop.
Save bruxy70/e668e00e94b34bf699488fe1d8de379a to your computer and use it in GitHub Desktop.
ESPHome configuration for Vindriktning ESP32 kit https://www.laskakit.cz/laskakit-esp-vindriktning-esp-32-i2c/
substitutions:
device_name: air-quality
wifi_ssid: !secret wifi_ssid
wifi_password: !secret wifi_password
api_password: !secret api_password
ota_password: !secret ota_password
esphome:
name: ${device_name}
comment: IKEA LaskaKit ESP-VINDRIKTNING ESP-32 I2C
esp32:
board: nodemcu-32s
framework:
type: arduino
wifi:
ssid: ${wifi_ssid}
password: ${wifi_password}
api:
password: ${api_password}
ota:
password: ${ota_password}
logger:
uart:
rx_pin: 16
tx_pin: 17
baud_rate: 9600
id: uart2
sensor:
- platform: pm1006
pm_2_5:
name: "Particulate Matter 2.5µm Concentration"
id: pm
accuracy_decimals: 1
on_value:
then:
- if:
condition:
lambda: 'return x < 30;'
then:
- light.addressable_set:
id: status
range_from: 0
range_to: 0
red: 0.0
green: 1.0
blue: 0.0
color_brightness: !lambda |-
return id(sun_elevation).state > 0 ? 1.0 : 0.5;
else:
- if:
condition:
lambda: 'return x > 90;'
then:
- light.addressable_set:
id: status
range_from: 0
range_to: 0
red: 1.0
green: 0.0
blue: 0.0
color_brightness: !lambda |-
return id(sun_elevation).state > 0 ? 1.0 : 0.5;
else:
- light.addressable_set:
id: status
range_from: 0
range_to: 0
red: 1.0
green: 0.72
blue: 0.0
color_brightness: !lambda |-
return id(sun_elevation).state > 0 ? 1.0 : 0.5;
uart_id: uart2
update_interval: 20s
- platform: scd4x
co2:
name: "CO2"
id: co2
on_value:
then:
- if:
condition:
lambda: 'return x < 1000;'
then:
- light.addressable_set:
id: status
range_from: 1
range_to: 1
red: 0.0
green: 1.0
blue: 0.0
color_brightness: !lambda |-
return id(sun_elevation).state > 0 ? 1.0 : 0.5;
else:
- if:
condition:
lambda: 'return x > 1500;'
then:
- light.addressable_set:
id: status
range_from: 1
range_to: 1
red: 1.0
green: 0.0
blue: 0.0
color_brightness: !lambda |-
return id(sun_elevation).state > 0 ? 1.0 : 0.5;
else:
- light.addressable_set:
id: status
range_from: 1
range_to: 1
red: 1.0
green: 0.72
blue: 0.0
color_brightness: !lambda |-
return id(sun_elevation).state > 0 ? 1.0 : 0.5;
humidity:
name: "Humidity"
id: humidity
on_value:
then:
- if:
condition:
lambda: 'return x < 30;'
then:
- light.addressable_set:
id: status
range_from: 2
range_to: 2
red: 1.0
green: 0.0
blue: 0.0
color_brightness: !lambda |-
return id(sun_elevation).state > 0 ? 1.0 : 0.5;
else:
- if:
condition:
lambda: 'return x > 60;'
then:
- light.addressable_set:
id: status
range_from: 2
range_to: 2
red: 0.0
green: 0.0
blue: 1.0
color_brightness: !lambda |-
return id(sun_elevation).state > 0 ? 1.0 : 0.5;
else:
- light.addressable_set:
id: status
range_from: 2
range_to: 2
red: 0.0
green: 1.0
blue: 0.0
color_brightness: !lambda |-
return id(sun_elevation).state > 0 ? 1.0 : 0.5;
- platform: homeassistant
id: sun_elevation
entity_id: sun.sun
attribute: elevation
- platform: wifi_signal
name: "Air quality WiFi Signal Sensor"
entity_category: diagnostic
disabled_by_default: true
update_interval: 60s
switch:
- platform: gpio
pin: 12
id: fan
restore_mode: ALWAYS_ON
disabled_by_default: true
entity_category: diagnostic
light:
- platform: neopixelbus
type: GRB
variant: WS2812
pin: GPIO25
num_leds: 3
id: status
restore_mode: ALWAYS_ON
i2c:
sda: 21
scl: 22
scan: true
id: bus_a
button:
- platform: restart
name: "Restart ${device_name}"
disabled_by_default: true
entity_category: diagnostic
@2801500
Copy link

2801500 commented Apr 17, 2025

By having the SCD41 CO2 connect to the i2c, I thought that that sensor can read temperature.
On the LaskaKit site description says “SCD41 CO2, temperature and air humidity sensor”.
And if that sensor can not read temperature, is it possible to connect both the BME280 and the SCD41 together on the i2c?
Would it be enough space inside the ikea box?

Thanks!!

@2801500
Copy link

2801500 commented Apr 17, 2025

On your video, you copy from https://esphome.io/components/sensor/scd4x.html the config for the SCD41 …

sensor:

  • platform: scd4x
    co2:
    name: "Workshop CO2"
    temperature:
    name: "Workshop Temperature"
    humidity:
    name: "Workshop Humidity"

I see the line for TEMPERATURE, does that mean that the sensor can read it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment