mirror of
https://github.com/esphome/esphome.git
synced 2026-05-15 01:55:15 +08:00
35de36d690
CI / Create common environment (push) Has been cancelled
CI / Check ruff (push) Has been cancelled
CI / Check flake8 (push) Has been cancelled
CI / Check pylint (push) Has been cancelled
CI / Check pyupgrade (push) Has been cancelled
CI / Run script/ci-custom (push) Has been cancelled
CI / Run pytest (macOS-latest, 3.11) (push) Has been cancelled
CI / Run pytest (ubuntu-latest, 3.10) (push) Has been cancelled
CI / Run pytest (ubuntu-latest, 3.11) (push) Has been cancelled
CI / Run pytest (ubuntu-latest, 3.12) (push) Has been cancelled
CI / Run pytest (ubuntu-latest, 3.13) (push) Has been cancelled
CI / Run pytest (windows-latest, 3.11) (push) Has been cancelled
CI / Check clang-format (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 1/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 2/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 3/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 Arduino 4/4 (push) Has been cancelled
CI / Run script/clang-tidy for ESP32 IDF (push) Has been cancelled
CI / Run script/clang-tidy for ESP8266 (push) Has been cancelled
CI / Run script/clang-tidy for ZEPHYR (push) Has been cancelled
CI / list-components (push) Has been cancelled
CI / Component test ${{ matrix.file }} (push) Has been cancelled
CI / Split components for testing into 20 groups maximum (push) Has been cancelled
CI / Test split components (push) Has been cancelled
CI / CI Status (push) Has been cancelled
CI for docker images / Build docker containers (docker, ubuntu-24.04) (push) Has been cancelled
CI for docker images / Build docker containers (docker, ubuntu-24.04-arm) (push) Has been cancelled
CI for docker images / Build docker containers (ha-addon, ubuntu-24.04) (push) Has been cancelled
CI for docker images / Build docker containers (ha-addon, ubuntu-24.04-arm) (push) Has been cancelled
YAML lint / yamllint (push) Has been cancelled
Synchronise Device Classes from Home Assistant / Sync Device Classes (push) Has been cancelled
117 lines
2.6 KiB
YAML
117 lines
2.6 KiB
YAML
uart:
|
|
- id: uart_modbus_client
|
|
tx_pin: ${client_tx_pin}
|
|
rx_pin: ${client_rx_pin}
|
|
baud_rate: 9600
|
|
- id: uart_modbus_server
|
|
tx_pin: ${server_tx_pin}
|
|
rx_pin: ${server_rx_pin}
|
|
baud_rate: 9600
|
|
|
|
modbus:
|
|
- id: mod_bus1
|
|
uart_id: uart_modbus_client
|
|
flow_control_pin: ${flow_control_pin}
|
|
- id: mod_bus2
|
|
uart_id: uart_modbus_server
|
|
role: server
|
|
|
|
modbus_controller:
|
|
- id: modbus_controller1
|
|
address: 0x2
|
|
modbus_id: mod_bus1
|
|
allow_duplicate_commands: false
|
|
on_online:
|
|
then:
|
|
logger.log: "Module Online"
|
|
- id: modbus_controller2
|
|
address: 0x2
|
|
modbus_id: mod_bus2
|
|
server_registers:
|
|
- address: 0x0000
|
|
value_type: S_DWORD_R
|
|
read_lambda: |-
|
|
return 42.3;
|
|
max_cmd_retries: 0
|
|
- id: modbus_controller3
|
|
address: 0x3
|
|
modbus_id: mod_bus2
|
|
server_registers:
|
|
- address: 0x0009
|
|
value_type: S_DWORD
|
|
read_lambda: |-
|
|
return 31;
|
|
write_lambda: |-
|
|
printf("address=%d, value=%d", x);
|
|
return true;
|
|
max_cmd_retries: 0
|
|
binary_sensor:
|
|
- platform: modbus_controller
|
|
modbus_controller_id: modbus_controller1
|
|
id: modbus_binary_sensor1
|
|
name: Test Binary Sensor
|
|
register_type: read
|
|
address: 0x3200
|
|
bitmask: 0x80
|
|
|
|
number:
|
|
- platform: modbus_controller
|
|
modbus_controller_id: modbus_controller1
|
|
id: modbus_number1
|
|
name: Test Number
|
|
address: 0x9001
|
|
value_type: U_WORD
|
|
multiply: 1.0
|
|
|
|
output:
|
|
- platform: modbus_controller
|
|
modbus_controller_id: modbus_controller1
|
|
id: modbus_output1
|
|
address: 2048
|
|
register_type: holding
|
|
value_type: U_WORD
|
|
multiply: 1000
|
|
|
|
select:
|
|
- platform: modbus_controller
|
|
modbus_controller_id: modbus_controller1
|
|
id: modbus_select1
|
|
name: Test Select
|
|
address: 1000
|
|
value_type: U_WORD
|
|
optionsmap:
|
|
"Zero": 0
|
|
"One": 1
|
|
"Two": 2
|
|
"Three": 3
|
|
|
|
sensor:
|
|
- platform: modbus_controller
|
|
modbus_controller_id: modbus_controller1
|
|
id: modbus_sensor1
|
|
name: Test Sensor
|
|
register_type: holding
|
|
address: 0x9001
|
|
unit_of_measurement: "AH"
|
|
value_type: U_WORD
|
|
|
|
switch:
|
|
- platform: modbus_controller
|
|
modbus_controller_id: modbus_controller1
|
|
id: modbus_switch1
|
|
name: Test Switch
|
|
register_type: coil
|
|
address: 0x15
|
|
bitmask: 1
|
|
|
|
text_sensor:
|
|
- platform: modbus_controller
|
|
modbus_controller_id: modbus_controller1
|
|
id: modbus_text_sensor1
|
|
name: Test Text Sensor
|
|
register_type: holding
|
|
address: 0x9013
|
|
register_count: 3
|
|
raw_encode: HEXBYTES
|
|
response_size: 6
|