Files
esphome-configs/mcu-gateway.yaml
T
randy 0f6e2350cc ESPHome 2026.12: on_client_synced, CanPayload, cleanups
- LVGL panels (NSPanels, lvgl, lvgl-4848s040, m5core2, tft), m5paper: api on_client_synced
  instead of a 2 s delay and an api.connected check
- car-can: on_frame x is canbus::CanPayload, frames_per_id keeps it without a heap vector
- gateway: drop the commented ethernet (common/ethernet.yaml has it), LLDP (PR draft),
  manual_ip and use_address
- clock-1, echo: drop the commented neopixelbus lights
2026-12-03 17:01:53 +01:00

221 lines
4.6 KiB
YAML

---
# Hardware: Olimex ESP32-POE-ISO
# Pinout:
# # UEXT
# 3V3 1 2 GND
# GPIO4 3 4 GPIO36 U1TXD/U1RXD
# GPIO16 5 6 GPIO13 I2C-SCL/I2C-SDA
# GPIO15 7 8 GPIO2 HS2_CMD/HS2_DATA0
# GPIO14 9 10 GPIO5 HS2_CLK/SPI_CS
#
# SD/MMC; shared with UEXT, no CS!!!
# GPIO15 HS2_CMD
# GPIO14 HS2_CLK
# GPIO2 HS2_DATA0
#
# GPIO34 BUT1
# GPIO35 Battery Measurment ADC
# GPIO39 Ext Power Sense ADC
# Used:
# GPIO4 uart_modbus (uart tx_pin)
# GPIO12 ethernet (ethernet power_pin)
# GPIO13 i2c (i2c sda)
# GPIO16 i2c (i2c scl)
# GPIO17 ethernet (ethernet)
# GPIO18 ethernet (ethernet mdio_pin)
# GPIO23 ethernet (ethernet mdc_pin)
# GPIO34 user_button (binary_sensor gpio) (inverted)
# GPIO36 uart_modbus (uart rx_pin)
substitutions:
device: gateway
name: Gateway
area: DEV
comment: BLE Proxy, Modbus
esphome:
name: mcu-${device}
friendly_name: ${name}
area: ${area}
comment: ${comment}
esp32:
variant: esp32
toolchain: esp-idf
framework:
type: esp-idf
advanced:
flash_chip: generic
minimum_chip_revision: 3.0
sram1_as_iram: true
external_components:
- source: github://pr#2112
components: ["m5stack_4relay"]
refresh: 1h
packages:
# common: !include common/common.yaml
common_eth: !include common/common_eth.yaml
ipv6_only: !include common/ipv6_only_eth.yaml
i2c:
sda: 13
scl: 16
scan: true
uart:
id: uart_modbus
tx_pin: 4
rx_pin: 36
baud_rate: 9600
# stop_bits: 1
# data_bits: 8
# parity: NONE
# debug:
modbus:
id: modbus_id
modbus_controller:
- id: modbus_temp_1
address: 101
modbus_id: modbus_id
# update_interval: 10s
- id: modbus_temp_2
address: 102
modbus_id: modbus_id
# update_interval: 10s
- id: modbus_adc_1
address: 1
modbus_id: modbus_id
update_interval: 10s
sensor:
- platform: modbus_controller
modbus_controller_id: modbus_temp_1
id: temp_1
name: Temperature 1
address: 0
unit_of_measurement: "°C"
register_type: read
value_type: U_WORD
accuracy_decimals: 1
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: modbus_temp_1
id: hum_1
name: Humidity 1
address: 1
unit_of_measurement: "%"
register_type: read
value_type: U_WORD
accuracy_decimals: 1
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: modbus_temp_2
id: temp_2
name: Temperature 2
address: 0
unit_of_measurement: "°C"
register_type: read
value_type: U_WORD
accuracy_decimals: 1
filters:
- multiply: 0.1
- platform: modbus_controller
modbus_controller_id: modbus_temp_2
id: hum_2
name: Humidity 2
address: 1
unit_of_measurement: "%"
register_type: read
value_type: U_WORD
accuracy_decimals: 1
filters:
- multiply: 0.1
# - platform: bmp085
# temperature:
# name: BMP180 Temperature
# pressure:
# name: BMP180 Pressure
# address: 0x77
# update_interval: 60s
# - platform: bme280
# temperature:
# name: BME280 Temperature
# oversampling: 16x
# pressure:
# name: BME280 Pressure
# humidity:
# name: BME280 Humidity
# address: 0x76
# update_interval: 60s
- platform: modbus_controller
modbus_controller_id: modbus_adc_1
id: adc_1_1
name: Solar Pressure
address: 0
unit_of_measurement: "MPa"
register_type: holding
value_type: U_WORD
accuracy_decimals: 1
filters:
- calibrate_linear:
- 50 -> 0
- 450 -> 5
- platform: modbus_controller
modbus_controller_id: modbus_adc_1
id: adc_1_1_padding
internal: true
address: 1
register_type: holding
value_type: U_WORD
reuse_previous_range: true
switch:
- platform: modbus_controller
modbus_controller_id: modbus_adc_1
name: Readress MODBUS
register_type: holding
address: 0x00FD
entity_category: config
icon: "mdi:toggle-switch"
esp32_ble_tracker:
scan_parameters:
interval: 1100ms
window: 1100ms
active: true
on_ble_advertise:
- mac_address:
- D5:63:3C:12:E6:07
then:
- lambda: |-
ESP_LOGV("ble_adv", "Detected HPA250B");
bluetooth_proxy:
active: true
binary_sensor:
- platform: gpio
pin:
number: 34
inverted: true
id: user_button
on_press:
then:
- button.press: safe
button:
- platform: safe_mode
id: safe
# display:
# - platform: lcd_pcf8574
# dimensions: 20x4
# address: 0x27
# lambda: |-
# it.print(0, 3, "10°C or 10~C");