esphome / feature-requests

ESPHome Feature Request Tracker
https://esphome.io/
420 stars 26 forks source link

[Modbus_Controller] Modbus Server with dynamic adress #2931

Open Alexandreao opened 1 month ago

Alexandreao commented 1 month ago

Describe the problem you have/What new integration you would like

Modbus server with and dynamic address tag. Allow a lambda function to modify the address based on a global variable

Please describe your use case for this integration and alternatives you've tried:

I'm current using the Modbus integration to build a custom air quality sensor. The sensor runs on esp32-c3 and is equipped with Sen54 and radar ld2410. This works fine through Wi-Fi connection, but the idea is to use Wired connection as a Modbus server. Since I will have multiple of these sensors, instead of hardcoded the address for each one, I would like to have an address that can be store on flash memory and replaced via specific command

Additional context

Waveshare was a device (waveshare Modbus_RTU_IO_8CH) where is possible to change the Modbus address using a specific command:

image

nagyrobi commented 1 month ago

This request translates into making the slave address templatable.

Alexandreao commented 2 weeks ago

This request translates into making the slave address templatable.

Can you help me to do this change?