Use a better id

This commit is contained in:
Abílio Costa 2022-01-05 00:07:21 +00:00 committed by GitHub
parent 1253896e68
commit 051c18e2b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,7 +112,7 @@ You must set the ``address`` of the ``modbus_controller`` to the current address
return; return;
} }
esphome::modbus_controller::ModbusController *controller = id(epever); esphome::modbus_controller::ModbusController *controller = id(pzem);
auto set_addr_cmd = esphome::modbus_controller::ModbusCommandItem::create_write_single_command( auto set_addr_cmd = esphome::modbus_controller::ModbusCommandItem::create_write_single_command(
controller, 0x0002, new_address); controller, 0x0002, new_address);
@ -122,23 +122,17 @@ You must set the ``address`` of the ``modbus_controller`` to the current address
modbus: modbus:
send_wait_time: 200ms send_wait_time: 200ms
id: mod_bus_epever id: mod_bus_pzem
modbus_controller: modbus_controller:
- id: epever - id: pzem
## the current device addr ## the current device addr
address: 0x1 address: 0x1
modbus_id: mod_bus_epever modbus_id: mod_bus_pzem
command_throttle: 0ms command_throttle: 0ms
setup_priority: -10 setup_priority: -10
update_interval: 30s update_interval: 30s
uart:
rx_pin: GPIO16
tx_pin: GPIO17
baud_rate: 9600
stop_bits: 2
See Also See Also
-------- --------