Compare commits

...

2 commits

9 changed files with 257 additions and 14 deletions

View file

@ -1,14 +1,84 @@
substitutions: substitutions:
node_name: aq-outdoor node_name: aq-outdoor
node_friendly_name: Outdoor node_friendly_name: Outdoor
http_timeout: 3s node_area: Garage
packages: packages:
- !include ../common/esp32-idf.yaml - !include
- !include ../common/airgradient_open_air.yaml file: framework/esp32_idf.yaml
- !include ../common/wifi-influxdb.yaml
- !include ../common/wifi-km6g-iot.yaml - !include
- !include ../common/base-influxdb.yaml file: unit/airgradient_open_air.yaml
- !include ../common/http-request-idf.yaml
- !include ../common/sntp-time.yaml - !include
- !include ../common/influxdb.yaml file: domain/logger/disabled.yaml
- !include
file: domain/base.yaml
- !include
file: domain/influxdb_v2_oss/base.yaml
- !include
file: domain/network/wifi.yaml
- !include
file: domain/influxdb_v2_oss/wifi.yaml
- !include
file: domain/network/wifi_km6g_iot.yaml
- !include
file: domain/time/sntp.yaml
- !include
file: domain/http_request_idf.yaml
- !include
file: domain/influxdb_v2_oss/core.yaml
- !include
file: domain/sensor/bme280.yaml
vars:
id_suffix: c
name_suffix: C
sensor:
- id: !extend pms5003t_a
temperature:
internal: true
humidity:
internal: true
- id: !extend pms5003t_b
temperature:
internal: true
humidity:
internal: true
- platform: copy
source_id: temperature_a
name: Temperature (A)
filters:
- lambda: !lambda |-
if (x < 10.0f) return (x * 1.327f) - 6.738f;
return (x * 1.181f) - 5.113f;
- platform: copy
source_id: temperature_b
name: Temperature (B)
filters:
- lambda: !lambda |-
if (x < 10.0f) return (x * 1.327f) - 6.738f;
return (x * 1.181f) - 5.113f;
- platform: copy
source_id: humidity_a
name: Humidity (A)
filters:
- lambda: !lambda |-
return std::min(100.0f, (x * 1.259f) + 7.34f);
- platform: copy
source_id: humidity_b
name: Humidity (B)
filters:
- lambda: !lambda |-
return std::min(100.0f, (x * 1.259f) + 7.34f);

View file

@ -0,0 +1,34 @@
defaults:
id: _bme280
window_size: 30
id_suffix: ""
name_suffix: ""
sensor:
- id: ${id}
platform: bme280_i2c
update_interval: 2min
temperature:
id: ${ 'temperature' ~ ( '_' ~ id_suffix if id_suffix | length )}
name: ${ 'Temperature' ~ ( ' (' ~ name_suffix ~ ')' if name_suffix | length )}
filters:
- sliding_window_moving_average:
window_size: ${window_size}
send_every: ${window_size}
humidity:
id: ${ 'humidity' ~ ( '_' ~ id_suffix if id_suffix | length )}
name: ${ 'Humidity' ~ ( ' (' ~ name_suffix ~ ')' if name_suffix | length )}
filters:
- sliding_window_moving_average:
window_size: ${window_size}
send_every: ${window_size}
pressure:
id: ${ 'pressure' ~ ( '_' ~ id_suffix if id_suffix | length )}
name: ${ 'Pressure' ~ ( ' (' ~ name_suffix ~ ')' if name_suffix | length )}
filters:
- sliding_window_moving_average:
window_size: ${window_size}
send_every: ${window_size}

View file

@ -1,10 +1,11 @@
defaults: defaults:
id: _cse7766
current_throttle: 60s current_throttle: 60s
voltage_throttle: 60s voltage_throttle: 60s
power_throttle: 60s power_throttle: 60s
sensor: sensor:
- id: _cse7766 - id: ${id}
platform: cse7766 platform: cse7766
uart_id: ${uart_id} uart_id: ${uart_id}

View file

@ -0,0 +1,63 @@
defaults:
id: _pms5003t
window_size: 30
id_suffix: ""
name_suffix: ""
sensor:
- id: ${id}
platform: pmsx003
type: PMS5003T
uart_id: ${uart_id}
update_interval: 2min
pm_0_3um:
id: ${ 'pm_0_3um' ~ ( '_' ~ id_suffix if id_suffix | length )}
name: ${ 'PM 0.3' ~ ( ' (' ~ name_suffix ~ ')' if name_suffix | length )}
filters:
- sliding_window_moving_average:
window_size: ${window_size}
send_every: ${window_size}
pm_1_0:
id: ${ 'pm_1_0' ~ ( '_' ~ id_suffix if id_suffix | length )}
name: ${ 'PM 1.0' ~ ( ' (' ~ name_suffix ~ ')' if name_suffix | length )}
device_class: pm1
filters:
- sliding_window_moving_average:
window_size: ${window_size}
send_every: ${window_size}
pm_2_5:
id: ${ 'pm_2_5' ~ ( '_' ~ id_suffix if id_suffix | length )}
name: ${ 'PM 2.5' ~ ( ' (' ~ name_suffix ~ ')' if name_suffix | length )}
device_class: pm25
filters:
- sliding_window_moving_average:
window_size: ${window_size}
send_every: ${window_size}
pm_10_0:
id: ${ 'pm_10_0' ~ ( '_' ~ id_suffix if id_suffix | length )}
name: ${ 'PM 10.0' ~ ( ' (' ~ name_suffix ~ ')' if name_suffix | length )}
device_class: pm10
filters:
- sliding_window_moving_average:
window_size: ${window_size}
send_every: ${window_size}
temperature:
id: ${ 'temperature' ~ ( '_' ~ id_suffix if id_suffix | length )}
name: ${ 'Temperature' ~ ( ' (' ~ name_suffix ~ ')' if name_suffix | length )}
filters:
- sliding_window_moving_average:
window_size: ${window_size}
send_every: ${window_size}
humidity:
id: ${ 'humidity' ~ ( '_' ~ id_suffix if id_suffix | length )}
name: ${ 'Humidity' ~ ( ' (' ~ name_suffix ~ ')' if name_suffix | length )}
filters:
- sliding_window_moving_average:
window_size: ${window_size}
send_every: ${window_size}

View file

@ -1,8 +1,10 @@
defaults: defaults:
id: _pmsx003
window_size: 30 window_size: 30
sensor: sensor:
- platform: pmsx003 - id: ${id}
platform: pmsx003
type: PMSX003 type: PMSX003
uart_id: ${uart_id} uart_id: ${uart_id}
update_interval: 2min update_interval: 2min

View file

@ -1,8 +1,10 @@
defaults: defaults:
id: _s8
window_size: 30 window_size: 30
sensor: sensor:
- platform: senseair - id: ${id}
platform: senseair
uart_id: ${uart_id} uart_id: ${uart_id}
update_interval: 2min update_interval: 2min
co2: co2:

View file

@ -1,8 +1,10 @@
defaults: defaults:
id: _sgp4x
i2c_id: _i2c i2c_id: _i2c
sensor: sensor:
- platform: sgp4x - id: ${id}
platform: sgp4x
i2c_id: ${i2c_id} i2c_id: ${i2c_id}
update_interval: 2min update_interval: 2min
voc: voc:

View file

@ -1,9 +1,11 @@
defaults: defaults:
id: _sht4x
i2c_id: _i2c i2c_id: _i2c
window_size: 30 window_size: 30
sensor: sensor:
- platform: sht4x - id: ${id}
platform: sht4x
i2c_id: ${i2c_id} i2c_id: ${i2c_id}
update_interval: 2min update_interval: 2min
temperature: temperature:

View file

@ -0,0 +1,67 @@
esphome:
platformio_options:
upload_speed: 460800
board_build.flash_mode: dio
esp32:
board: esp32-c3-devkitm-1
packages:
- !include
file: ../domain/uart.yaml
vars:
id: pms5003_uart_a
tx_pin: GPIO1
rx_pin: GPIO0
baud_rate: 9600
parity: NONE
- !include
file: ../domain/uart.yaml
vars:
id: pms5003_uart_b
tx_pin: GPIO21
rx_pin: GPIO20
baud_rate: 9600
parity: NONE
- !include
file: ../domain/i2c.yaml
vars:
sda: GPIO7
scl: GPIO6
frequency: 400kHz
- !include
file: ../domain/output/gpio.yaml
vars:
id: _watchdog
pin: GPIO2
- !include
file: ../domain/sensor/pms5003t.yaml
vars:
id: pms5003t_a
uart_id: pms5003_uart_a
id_suffix: a
name_suffix: A
- !include
file: ../domain/sensor/pms5003t.yaml
vars:
id: pms5003t_b
uart_id: pms5003_uart_b
id_suffix: b
name_suffix: B
output:
- id: !extend _watchdog
pin:
ignore_strapping_warning: true
interval:
- interval: 30s
then:
- output.turn_on: _watchdog
- delay: 20ms
- output.turn_off: _watchdog