travisghansen / hass-opnsense

OPNsense integration with Home Assistant
194 stars 25 forks source link

Cannot add multiple OPNSense instances #116

Closed Damien0505 closed 6 months ago

Damien0505 commented 7 months ago

Hi, Firstly, apologies if this has already been asked, I did have a look through the previous issues but was unable to find an answer.

I am running two instances of OPNSense in a HA arrangement on two different Proxmox nodes.

Adding the first instance of OPNSense (OPNSenseMaster) was without issue and is displaying correctly within HA.

Sadly when attempting to add the second instance (OPNSenseBackup) it does not complete and I am greeted with "Unexpected error".

Checking the logs I cna see the following:

Logger: custom_components.opnsense.config_flow Source: custom_components/opnsense/config_flow.py:148 Integration: OPNsense (documentation, issues) First occurred: 1:24:02 AM (1 occurrences) Last logged: 1:24:02 AM

Unexpected err=AbortFlow('Flow aborted: already_configured'), type(err)=<class 'homeassistant.data_entry_flow.AbortFlow'>

Is there any way to add a second instance of OPNSense within HA?

Kind regards, Damien

Damien0505 commented 6 months ago

Now I am receiving a different error when attempting to add the second OPNSense instance:

This error originated from a custom integration.

Logger: custom_components.opnsense.pyopnsense Source: custom_components/opnsense/pyopnsense/init.py:100 Integration: OPNsense (documentation, issues) First occurred: 2:22:56 PM (3 occurrences) Last logged: 2:29:37 PM

Unexpected get_system_info error err=TypeError("string indices must be integers, not 'str'"), type(err)=<class 'TypeError'>

travisghansen commented 6 months ago

What version of opnsense is on the device? Does it have a hostname and domain properly set?

Damien0505 commented 6 months ago

Hi Travis, Apologies for the slow reply.

Both instances of OPNSense are running v24.1.2_1-amd64 They have unique hostnames set, as well as a common domain.

Regards, Damien

travisghansen commented 6 months ago

The method that fails is pretty basic, not sure what could possibly break there :(

Damien0505 commented 6 months ago

I've even tried creating a fresh HA VM, nothing but HACS and the OPNSense integrations installed, new users on each of the OPNSense installations each with new API keys and sadly still no go. Same errors.

alexdelprete commented 6 months ago

The method that fails is pretty basic, not sure what could possibly break there :(

Could it be that in an HA arrangement the unique id is the same?

travisghansen commented 6 months ago

It shouldn’t no. And even if it did the error would be different.