Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modbux proxy is not working #66

Closed
prnzngr opened this issue Aug 5, 2023 · 12 comments
Closed

modbux proxy is not working #66

prnzngr opened this issue Aug 5, 2023 · 12 comments

Comments

@prnzngr
Copy link

prnzngr commented Aug 5, 2023

I am littlebit confused what are the network ports settings in the configuration page are for becuse this ports are not opened on the host.
Nevertheless I configured modbusproxy in evcc.yaml but the connection is timing out.

HASS IP: 192.168.1.50

modbusproxy:
  - port: 5200
    uri: 192.168.5.225:502 #Inverter


meters:
  - name: huawei_grid
    type: template
    template: huawei-dongle-powersensor
    usage: grid
    modbus: tcpip
    id: 1
    host: 192.168.1.50 #IP of HASS
    port: 5200

[site ] ERROR 2023/08/05 12:14:12 grid meter: read failed: modbus: exception '4' (server device failure), function '3' [site ] ERROR 2023/08/05 12:14:12 grid meter: read failed: modbus: exception '4' (server device failure), function '3'

When I am using the Inverter IP in meters settings then the connection is working.
What is wrong here?

@thecem
Copy link
Collaborator

thecem commented Aug 5, 2023

This is a issue you have to open in evcc.

what is the reason for proxying?

@prnzngr
Copy link
Author

prnzngr commented Aug 5, 2023

hass and evcc have to connect to inverter.
what is the network ports page for?

@thecem
Copy link
Collaborator

thecem commented Aug 5, 2023

Did you close the usage out of HA to the inverter port?

@prnzngr
Copy link
Author

prnzngr commented Aug 5, 2023

in my configuration you can see that only evcc is connecting to inverter but not HA

@thecem
Copy link
Collaborator

thecem commented Aug 5, 2023

I can’t, since there is no info what you configured in HA.
Make sure:

  • no second connection is established to your inverter.
  • the sponsor token is configured in evcc.yaml
  • there is no other sw using this ports in HA

@prnzngr
Copy link
Author

prnzngr commented Aug 5, 2023

bro, i know therefore this issue here

@thecem
Copy link
Collaborator

thecem commented Aug 5, 2023

gtn! Both subnets are reachable?
From Addon? (Portainer -> Terminal)
From HA?

192.168.5.x
and
192.168.1.x

@prnzngr
Copy link
Author

prnzngr commented Aug 5, 2023

When I am using the Inverter IP in meters settings then the connection is working

@F-Plass
Copy link

F-Plass commented Nov 2, 2023

Hello,

same Problem here.
See the dokumentation of evcc: https://docs.evcc.io/docs/reference/configuration/modbusproxy/

The modbusproxy in evcc is used for inverters, that only allow one modbus connection.
evcc connects to the inverter. Any other device that wants to connect to the inverter can now connect to evcc.

There for a port is configured in evcc and this port must be connected from docker container to HAOS Port.
So the other device can connect to this Port on HAOS.

In the Network Part of Configuration in HAOS evcc Page under "Change the ports on your host that are exposed by the add-on" there has to be perhaps three Ports (5021 - 5023) to configure into the evcc docker container.

@TheDK
Copy link

TheDK commented Nov 5, 2023

The above config by the opener of this issue is incorrect: In the meters config the setting needs to remain the same as before, so the IP:Port of the Modbus gateway of the inverter needs to be specified, NOT the IP:Port of the evcc Modbus Proxy.

The way I understand it, the evcc Modbus Proxy is aware of evcc's connections / requests and then loops in other requests received by the proxy.

Correct setting for the above config:

modbusproxy:
  - port: 5200
    uri: 192.168.5.225:502 #Inverter


meters:
  - name: huawei_grid
    type: template
    template: huawei-dongle-powersensor
    usage: grid
    modbus: tcpip
    id: 1
    host: 192.168.1.225 #IP of HASS
    port: 502

In HA Add-on config port 5200 needs to be specified for Modbus (which is default setting as far as I can tell).

In HA integration config for the inverter you specifiy Modbus TCP/IP and evcc IP with port 5200. This is working for me.

Please report back if this works so the issue can be closed.

@F-Plass
Copy link

F-Plass commented Nov 5, 2023

Ok.
I found it.
Default port is 5200 for the modbusproxy, not Port 5021 as in the test config described on evcc dokumentation.
I could establish a connection.

Thank you.

@thecem
Copy link
Collaborator

thecem commented Nov 11, 2023

@thecem thecem closed this as completed Nov 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants