How to setup Device Tracker with opnsense?

Hi I´m pretty new to HA and wanted to use opnsense to track my devices but im not quite understanding how to do it. I created a new User in Opnsense for the homeassistant and put the URL, my Api.key and api.secret in the configuration.yaml but i get this error everytime:

Logger: homeassistant.setup
Source: components/opnsense/
First occurred: 09:51:54 (1 occurrences)
Last logged: 09:51:54

Error during setup of component opnsense
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/", line 235, in _async_setup_component
    result = await task
  File "/usr/local/lib/python3.10/concurrent/futures/", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/opnsense/", line 55, in setup
  File "/usr/local/lib/python3.10/site-packages/pyopnsense/", line 52, in get_arp
    return self._get('diagnostics/interface/getArp')
  File "/usr/local/lib/python3.10/site-packages/pyopnsense/", line 54, in _get
    return self._process_response(response)
  File "/usr/local/lib/python3.10/site-packages/pyopnsense/", line 44, in _process_response
    return json.loads(response.text)
  File "/usr/local/lib/python3.10/json/", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.10/json/", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.10/json/", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Can somebody help me?

Did you figure it out, @Mystiko? It got the same error trying to configure the Opnsense integration. And since the configuration is so minimal, I have a hard time understanding what might be wrong…

No i did not find a solution for this(sry). I switched to using the unifi controller intergration which just works fine.

In my case i forgot to add /api at the end of router URL. JSON Decode Error generally means that the component got an unexpected answer.


In case others are still having issues with this, it appears that the key/secrete pair that are provided needs to come from an opnsense user that is a member of admins

It’s not required for the user to be member of “admins”, but the user needs to be member of a group that got the rights granted listed on OPNSense - Home Assistant

User with API Key requires privileges for Type:

GUI Name: Diagnostics: ARP Table
GUI Name: Diagnostics: Network Insight