Hi,
Yes got it to work. But some sensor still need some tuning/tweaking to get the correct results.
Currently working code below. There are a lot of sensors added. So pick out why only applies to your config
# Enable logging
logger:
logs:
component: ERROR
# baud_rate: 0
bluetooth_proxy:
esp32_improv:
authorizer: none
switch:
- platform: gpio
pin: GPIO25
name: "Fan"
id: Fan
light:
- platform: partition
name: "Partition Light 1"
segments:
- id: light1
from: 0
to: 1
- platform: partition
name: "Partition Light 2"
segments:
- id: light1
from: 2
to: 3
- platform: partition
name: "Partition Light 3"
segments:
- id: light1
from: 4
to: 5
- platform: partition
name: "Partition Light 4"
segments:
- id: light1
from: 6
to: 7
- platform: neopixelbus
id: light1
type: GRB
variant: WS2811
pin: GPIO27
num_leds: 8
name: "Status Light"
effects:
- random:
- pulse:
- strobe:
- flicker:
- addressable_rainbow:
- addressable_color_wipe:
- addressable_scan:
- addressable_twinkle:
- addressable_random_twinkle:
- addressable_fireworks:
font:
- file: 'arial.ttf'
id: font1
size: 14
- file: 'arialbd.ttf'
id: font2
size: 16
## Serial Port for the IKEA Sensor
uart:
- id: uart_1
rx_pin: GPIO17
tx_pin: GPIO16
baud_rate: 256000
- id: uart_2
rx_pin: GPIO03
tx_pin: GPIO01
baud_rate: 9600
## I²C Port - For Temp/Humidity/Pressure & CO²/VOC Sensors
i2c:
sda: GPIO21
scl: GPIO22
scan: true
id: bus_a
ld2410:
uart_id: uart_1
binary_sensor:
- platform: ld2410
has_target:
name: Presence
has_moving_target:
name: Moving
id: moving
has_still_target:
name: Still
out_pin_presence_status:
name: out pin presence status
- platform: template
name: "closeby"
id: closeby
lambda: |-
if (id(distance).state < 70) {
// Garage Door is open.
return true;
} else {
// Garage Door is closed.
return false;
}
on_press:
then:
- display.page.show: page1
sensor:
- platform: pm1006
id: pm25
uart_id: uart_2
pm_2_5:
name: "PM 2.5"
update_interval: 15s
# update_interval: 10s
- platform: bh1750
name: "Illuminance"
address: 0x23
update_interval: 10s
- platform: bme280_i2c
temperature:
name: "Temperature"
id: temperature
filters:
- calibrate_linear:
method: least_squares
datapoints:
# Map 0.0 (from sensor) to 1.0 (true value)
- 0.0 -> 1.0
- 18.1 -> 19.0
- 24.4 -> 20.0
pressure:
name: "Pressure"
humidity:
name: "Humidity"
id: humidity
# filters:
# - calibrate_linear:
# method: least_squares
# datapoints:
# # Map 0.0 (from sensor) to 1.0 (true value)
# - 0.0 -> 1.0
# - 33.1 -> 50.0
# - 60.0 -> 53.0
address: 0x76
update_interval: 20s
- platform: ccs811
eco2:
name: "eCO2"
id: eco2
tvoc:
name: "VOC"
id: voc
address: 0x5A
update_interval: 20s
baseline: 0x4481
temperature: temperature
humidity: humidity
- platform: ld2410
light:
name: light
moving_distance:
name : Distance Moving
id: distance
still_distance:
name: Distance Still
moving_energy:
name: Energy Move
still_energy:
name: Energy Still
detection_distance:
name: Detection
display:
- platform: ssd1306_i2c
model: "SSD1306 128x64"
id: my_display
address: 0x3C
update_interval: 1s
pages:
- id: page1
lambda: |-
it.print(0, 0, id(font2), "Radar");
it.printf(0, 20, id(font1), "Afstand: %.1f cm", id(distance).state);
it.printf(0, 40, id(font1), "Beweging: %s", id(moving).state ? "Ja" : "Nee");
- id: page2
lambda: |-
it.print(0, 0, id(font2), "Temp/Hum");
it.printf(0, 20, id(font1), "Temp: %.1f°", id(temperature).state);
it.printf(0, 40, id(font1), "Hum: %.1f %%", id(humidity).state);
- id: page3
lambda: |-
it.print(0, 0, id(font2), "Air");
it.printf(0, 20, id(font1), "eCO2: %.1f ppm", id(eco2).state);
it.printf(0, 40, id(font1), "VOC: %.1f ppb", id(voc).state);
- id: page4
lambda: |-
it.print(0, 0, id(font2), "Air");
it.printf(0, 20, id(font1), "%.0f ug/m2", id(pm25));
- id: page5
lambda: |-
it.fill(COLOR_OFF);
interval:
- interval: 30s
then:
# - display.page.show_next: my_display
# - component.update: my_display
- switch.turn_on: Fan
- delay: 12s
- component.update: pm25
- switch.turn_off: Fan
- interval: 3s
then:
- if:
condition:
lambda: 'return id(distance).state < 70;'
then:
- if:
condition:
display.is_displaying_page: page4
then:
display.page.show: page1
else:
- display.page.show_next: my_display
- component.update: my_display
else:
- display.page.show: page5
I think this is realy the maximum that will fit in to it ![:stuck_out_tongue: :stuck_out_tongue:](https://community.home-assistant.io/images/emoji/twitter/stuck_out_tongue.png?v=12)