openenergymonitor / emonhub

Python service linking and decoding input to MQTT & Emoncms
89 stars 83 forks source link

modbus interfacer nodeid configuration for each register #42

Open yekorzh opened 6 years ago

yekorzh commented 6 years ago

Hi,

I'm interfacing with Fronius Inverter and Fronius Smartmeter over modbus. Both devices are available on the same IP address, but have different modbus device id. Is it possible to add one more configuration option to allow setting of modbus device id for each register read by interface?

For example inverter has device ID 1 and meter device ID 240. I'd use it like this:

... modbusDeviceId=1,1,1,1,1,1,1,1,1,1,1,240,240 rName = Inverter_status,AC_power_watts,AC_LifetimekWh,DayWh,mppt1,mppt2,Vmppt1,Vmppt2,PhVphA,PhVphB,PhVphC,TotWhImp,TotWhExp register = 40118,40092,40102,502,40285,40305,40284,40304,40086,40088,40090,40138,40130 ....

With above settings interface would read last two values from device id 240 and the rest from device with id 1. I understand that interface is currently hardcoded to a device id 1.

Thanks

glynhudson commented 6 years ago

Modbus integration was added by community member @cjthuys. It will be up to him to add this feature. We would accept a PR for this.