# One wiredsensor node, as a reusable ESPHome package. # # Not flashable on its own — it defines no board, no wifi and no bus. It expects # a parent config to supply a `modbus:` component with id `rs485_bus`, and to # include this file once per node with `vars`. See bus-of-nodes.yaml. # # Required vars: # node_id — a unique slug, used for the modbus_controller id # node_addr — the node's RS485 unit address, matching its UNIT_ADDRESS # node_name — human-readable prefix for the entity names # # Only the two measurement entities are exposed here. Per-node copies of every # diagnostic counter multiply fast on a segment of a dozen nodes, so # wiredsensor.yaml keeps the full set for the single-node case and this package # stays deliberately lean. Add what you need — the register map is identical. modbus_controller: - id: ${node_id} address: ${node_addr} modbus_id: rs485_bus update_interval: 30s sensor: - platform: modbus_controller modbus_controller_id: ${node_id} name: "${node_name} temperature" register_type: read address: 0x0000 value_type: S_DWORD unit_of_measurement: "°C" device_class: temperature state_class: measurement accuracy_decimals: 2 filters: - multiply: 0.001 - platform: modbus_controller modbus_controller_id: ${node_id} name: "${node_name} humidity" register_type: read address: 0x0002 value_type: S_DWORD unit_of_measurement: "%" device_class: humidity state_class: measurement accuracy_decimals: 2 filters: - multiply: 0.001 binary_sensor: # On `holding` (0x03) rather than `read` (0x04) so a node whose sensor has # never produced a reading still reports *why* — see wiredsensor.yaml for the # full explanation. - platform: modbus_controller modbus_controller_id: ${node_id} name: "${node_name} sensor fault" register_type: holding address: 0x0005 bitmask: 0x04 device_class: problem entity_category: diagnostic