# Several wiredsensor nodes on one RS485 segment, read by a single ESP32. # # The point of a bus: one gateway, one pair of wires, N sensors. Each node needs # a distinct UNIT_ADDRESS, which means one firmware image per node — see the # Configuration section of the top-level README. # # esphome run bus-of-nodes.yaml # # The per-node entities live in wiredsensor-node.yaml and are instantiated once # per address below, so adding a node is three lines rather than a copied block. substitutions: name: rs485-gateway friendly_name: "RS485 gateway" baud_rate: "19200" tx_pin: GPIO17 rx_pin: GPIO16 de_pin: GPIO4 esphome: name: ${name} friendly_name: ${friendly_name} esp32: board: esp32dev framework: type: esp-idf logger: level: INFO api: encryption: key: !secret api_encryption_key ota: - platform: esphome password: !secret ota_password wifi: ssid: !secret wifi_ssid password: !secret wifi_password ap: {} captive_portal: # ---------------------------------------------------------------- the bus --- uart: id: rs485 tx_pin: ${tx_pin} rx_pin: ${rx_pin} baud_rate: ${baud_rate} data_bits: 8 parity: NONE stop_bits: 1 modbus: id: rs485_bus uart_id: rs485 flow_control_pin: ${de_pin} # ----------------------------------------------------------------- nodes --- # # One entry per node. `node_id` must be unique; `node_addr` must match that # node's UNIT_ADDRESS. # # Requests are serialised across the whole bus — ESPHome waits for each response # before sending the next — so poll cost scales with node count. A node answers # roughly 2 ms after the request ends, so a dozen nodes at 30 s is nowhere near # saturating the segment. If you do see timeouts, `command_throttle` on the # controllers is the knob, not `update_interval`. packages: hallway: !include file: wiredsensor-node.yaml vars: node_id: node_hallway node_addr: "0x01" node_name: "Hallway" cellar: !include file: wiredsensor-node.yaml vars: node_id: node_cellar node_addr: "0x02" node_name: "Cellar" greenhouse: !include file: wiredsensor-node.yaml vars: node_id: node_greenhouse node_addr: "0x03" node_name: "Greenhouse"