No connection from hass to PYNX584

Hello,

I have been struggling for a long time but cannot figure it out. My Pi has been configured with PYNX584 and when I ssh into it I can read the zones and set the alarm. However on my hass I get a connection error. The IP and port are correctly configured. It is probably something really silly but I cannot find it. Does anyone have any clue where to look?

This is the config on the pi:

[Unit]
Description=NX584 daemon
[Service]
Type=simple
User=pi
WorkingDirectory=/usr/local/bin/
ExecStart=/usr/local/bin/nx584_server --config /home/pi/alarmpanel.ini --serial /dev/ttyUSB0 --baud 9600 --listen localhost --port 5007 --log /home/pi/nx584.log
Restart=on-failure
[Install]
WantedBy=multi-user.target

And the alarmpanel.ini file:

[config]
max_zones = 24
euro_date_format = False

[zones]
1 = Voordeur
2 = Hal
3 = Werkkamer
4 = Slaapkamer
5 = Deur Keuken
6 = Keuken
7 = Rook Bijkeuken
8 = Deur Bijkeuken
9 = Woonkamer
10 = Deur Woonkamer Links
11 = Deur Woonkamer Rechts
12 = Rook Keuken
13 = Deur Garage Links
14 = Deur Garage Rechts
15 = Garage
16 = Rook Overloop
17 = Overloop
18 = Slaapkamer Niek
19 = Slaapkamer Claire
20 = Serre
21 = Deur Serre Rechts
22 = Deur Serre Links
23 = Meterkast
24 = Rook Serre

On the hass the error is:

2021-09-07 14:47:41 ERROR (SyncWorker_3) [homeassistant.components.nx584.binary_sensor] Unable to connect to NX584: HTTPConnectionPool(host='192.168.1.210', port=5007): Max retries exceeded with url: /zones (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f7f375bb280>: Failed to establish a new connection: [Errno 111] Connection refused'))
2021-09-07 14:47:41 ERROR (MainThread) [homeassistant.components.nx584.alarm_control_panel] Unable to connect to http://192.168.1.210:5007: HTTPConnectionPool(host='192.168.1.210', port=5007): Max retries exceeded with url: /zones (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f7f372ab6d0>: Failed to establish a new connection: [Errno 111] Connection refused'))

And the configuration part of configuration.yaml:

# Networx Alarm panel
alarm_control_panel:
  - platform: nx584
    host: 192.168.1.210
    name: NX584
    port: 5007

binary_sensor:
  - platform: nx584
    host: 192.168.1.210
    port: 5007
    zone_types:
      1: opening
      2: motion
      3: motion
      4: motion
      5: opening
      6: motion
      7: smoke
      8: opening
      9: motion
      10: opening
      11: opening
      12: smoke
      13: opening
      14: opening
      15: motion
      16: smoke
      17: motion
      18: motion
      19: motion
      20: motion
      21: opening
      22: opening
      23: opening
      24: smoke

Solved with the help of the builder. changed the localhost in the config to 0.0.0.0