Jalle19 / eda-modbus-bridge

An HTTP/MQTT bridge for Enervent EDA ventilation units
GNU General Public License v3.0
14 stars 3 forks source link

Modbus TCP/IP connection possible? #86

Closed juntta closed 11 months ago

juntta commented 11 months ago

Thanks for great project! :)

I have Enervent Pelican HP eAir and its connected to my LAN with ethernet cable. Unit has software version 1.29 and in Modbus settings menu it has option Modbus TCP. After enabling this I can access registers and coils with Modbus client!

Is it possible to use Modbus TCP connection already with this app or is code changes needed?

Jalle19 commented 11 months ago

Currently only Modbus RTU is supported, but if you're willing to experiment I can probably make a test version that uses Modbus TCP instead.

juntta commented 11 months ago

Sure, happy to help!

Just let me know when to start testing!

Jalle19 commented 11 months ago

Can you try this branch: https://github.com/Jalle19/eda-modbus-bridge/tree/modbus-tcp ? Specify the device like this: -d tcp://192.168.1.40:502, assuming 192.168.1.40 is your ventilation unit and 502 is the port. Do let me know what the default port is so I can use a better example if necessary.

juntta commented 11 months ago

Great, thanks!

I will try this and get back to you with findings.

if I remember right, 502 was indeed the default port.

juntta commented 11 months ago

After short testing TCP connection seems to work just fine. I connected to ventilation unit and used MQTT broker to publish sensor data. Subscribed to mqtt broker and received sensor data just fine.

Might be some extra sensor (f.ex. room temp sensor) data that wasnt there but have to test it further and submit different issue about those.

Anyway, thanks for this enhancement!

Jalle19 commented 11 months ago

That's good news! I'll make a pull request with initial official support for Modbus TCP then.

I don't personally have any optional sensors (room temperature, CO2 etc.) which is why those sensors are not supported at the moment, but I'll gladly add them if you're able to test that they work. These should ideally be optional, i.e. the sensors aren't published to Home Assistant if they're not present (reporting 0).