updates
This commit is contained in:
147
m5stackfire.yaml
147
m5stackfire.yaml
@@ -1,17 +1,24 @@
|
||||
esphome:
|
||||
name: m5stackfire
|
||||
includes:
|
||||
- my_btmonitor.h
|
||||
libraries:
|
||||
- mbedtls
|
||||
platformio_options:
|
||||
board_upload.flash_size: 16MB
|
||||
board_build.partitions: "../../../m5stackfire_partition.csv"
|
||||
|
||||
external_components:
|
||||
- source:
|
||||
type: git
|
||||
url: https://github.com/ssieb/custom_components
|
||||
components: [ip5306]
|
||||
- source:
|
||||
type: local
|
||||
path: ./my_components
|
||||
|
||||
esp32:
|
||||
board: m5stack-fire
|
||||
flash_size: 16MB
|
||||
#framework:
|
||||
# type: arduino
|
||||
framework:
|
||||
type: arduino
|
||||
type: esp-idf
|
||||
|
||||
psram:
|
||||
|
||||
substitutions:
|
||||
friendly_name: "M5StackFire"
|
||||
@@ -23,6 +30,7 @@ api:
|
||||
- service: mhz19_calibrate_zero
|
||||
then:
|
||||
- mhz19.calibrate_zero: my_mhz19
|
||||
|
||||
wifi:
|
||||
ssid: WLAN
|
||||
password: !secret wifi_password
|
||||
@@ -33,11 +41,6 @@ ota:
|
||||
logger:
|
||||
|
||||
# Power Management
|
||||
external_components:
|
||||
- source:
|
||||
type: git
|
||||
url: https://github.com/ssieb/custom_components
|
||||
components: [ip5306]
|
||||
|
||||
ip5306:
|
||||
battery_level:
|
||||
@@ -64,7 +67,7 @@ binary_sensor:
|
||||
inverted: true
|
||||
on_click:
|
||||
then:
|
||||
- switch.toggle: backlight
|
||||
- switch.toggle: backlight
|
||||
- platform: gpio
|
||||
id: m5stackfire_button_right
|
||||
pin:
|
||||
@@ -80,7 +83,7 @@ switch:
|
||||
pin: 32
|
||||
name: "Backlight"
|
||||
id: backlight
|
||||
restore_mode: ALWAYS_ON
|
||||
restore_mode: ALWAYS_OFF
|
||||
|
||||
light:
|
||||
#- platform: monochromatic # backlight
|
||||
@@ -111,42 +114,44 @@ light:
|
||||
from: 5
|
||||
to: 9
|
||||
|
||||
|
||||
i2c:
|
||||
sda: 21
|
||||
scl: 22
|
||||
scan: True
|
||||
|
||||
# Display
|
||||
#spi:
|
||||
# clk_pin: 18
|
||||
# mosi_pin: 23
|
||||
# miso_pin: 19
|
||||
#
|
||||
#font:
|
||||
# - file: "gfonts://Roboto"
|
||||
# id: roboto
|
||||
# size: 18
|
||||
#
|
||||
#image:
|
||||
# - file: m5stack_display.png
|
||||
# id: img_background
|
||||
# type: RGB24
|
||||
#
|
||||
#
|
||||
#display:
|
||||
# - platform: ili9xxx
|
||||
# model: M5STACK
|
||||
# cs_pin: 14
|
||||
# dc_pin: 27
|
||||
# reset_pin: 33
|
||||
# id: my_display
|
||||
# lambda: |-
|
||||
# it.image(0, 0, id(img_background));
|
||||
# it.printf(240, 67, id(roboto), Color(255, 255, 255), TextAlign::TOP_CENTER, "%.0f ppm", id(co2value).state );
|
||||
# it.printf(240, 125, id(roboto), Color(255, 255, 255), TextAlign::TOP_CENTER, "%.1f °C", id(co2temp).state );
|
||||
# it.printf(240, 184, id(roboto), Color(255, 255, 255), TextAlign::TOP_CENTER, "%.1f %%", id(m5stackfire_dht22_humidity).state );
|
||||
#
|
||||
spi:
|
||||
clk_pin: 18
|
||||
mosi_pin: 23
|
||||
miso_pin: 19
|
||||
|
||||
font:
|
||||
- file: "gfonts://Roboto"
|
||||
id: roboto
|
||||
size: 18
|
||||
|
||||
image:
|
||||
- file: m5stack_display.png
|
||||
id: img_background
|
||||
type: RGB24
|
||||
|
||||
|
||||
display:
|
||||
- platform: ili9xxx
|
||||
model: M5STACK
|
||||
spi_mode: MODE3
|
||||
data_rate: 20MHz
|
||||
cs_pin: 14
|
||||
dc_pin: 27
|
||||
reset_pin: 33
|
||||
update_interval: 20s
|
||||
id: my_display
|
||||
lambda: |-
|
||||
it.image(0, 0, id(img_background));
|
||||
it.printf(240, 67, id(roboto), Color(255, 255, 255), TextAlign::TOP_CENTER, "%.0f ppm", id(co2value).state );
|
||||
it.printf(240, 125, id(roboto), Color(255, 255, 255), TextAlign::TOP_CENTER, "%.1f °C", id(co2temp).state );
|
||||
it.printf(240, 184, id(roboto), Color(255, 255, 255), TextAlign::TOP_CENTER, "%.1f %%", id(m5stackfire_dht22_humidity).state );
|
||||
|
||||
|
||||
uart:
|
||||
id: uart_co2
|
||||
@@ -175,30 +180,32 @@ sensor:
|
||||
id: m5stackfire_dht22_humidity
|
||||
name: "DHT22 humidity"
|
||||
|
||||
mqtt:
|
||||
broker: homeassistant.fritz.box
|
||||
username: !secret mqtt_ble_username
|
||||
password: !secret mqtt_ble_password
|
||||
discovery: false
|
||||
|
||||
esp32_ble_tracker:
|
||||
scan_parameters:
|
||||
interval: 1.2s
|
||||
window: 500ms
|
||||
active: false
|
||||
on_ble_advertise:
|
||||
- then:
|
||||
- lambda: |-
|
||||
const char * detected_device_name = ble_device_name(x.address());
|
||||
if(detected_device_name != nullptr) {
|
||||
auto build_json = [&](JsonObject obj) {
|
||||
obj["id"] = detected_device_name;
|
||||
obj["rssi"] = x.get_rssi();
|
||||
if(x.get_tx_powers().size() > 0)
|
||||
obj["tx_power"] = x.get_tx_powers()[0];
|
||||
};
|
||||
global_mqtt_client->publish_json(std::string("my_btmonitor/devices/") + detected_device_name + "/az_oben",
|
||||
build_json);
|
||||
}
|
||||
# BTLE doesn't work - not enough RAM
|
||||
# PSRAM isn't usable because chip is wired to same pins as UART PORT-C :(
|
||||
|
||||
#
|
||||
#mqtt:
|
||||
# broker: homeassistant.fritz.box
|
||||
# username: !secret mqtt_ble_username
|
||||
# password: !secret mqtt_ble_password
|
||||
# discovery: false
|
||||
#
|
||||
#nimble_tracker:
|
||||
|
||||
#esp32_ble_tracker:
|
||||
# scan_parameters:
|
||||
# interval: 1.2s
|
||||
# window: 500ms
|
||||
# active: false
|
||||
# on_ble_advertise:
|
||||
# - then:
|
||||
# - lambda: |-
|
||||
# auto build_json = [&](JsonObject obj) {
|
||||
# obj["rssi"] = x.get_rssi();
|
||||
# obj["address"] = x.address_str();
|
||||
# obj["address_uint64"] = x.address_uint64();
|
||||
# if(x.get_tx_powers().size() > 0)
|
||||
# obj["tx_power"] = x.get_tx_powers()[0];
|
||||
# };
|
||||
# global_mqtt_client->publish_json("my_btmonitor/raw_measurements/az_oben", build_json);
|
||||
#
|
||||
Reference in New Issue
Block a user