Presence detection (opnsense) does not work for me

My problem is that all device-trackers are being shown always as at Home and never as Away. It does not depend on the connection status of the device in the network as it should.

Homeassistant seems to connect to Opnsense. It showed a SSL connection error at first, but that was fixed by adding my custom CA. I get no error in the logs now.

Here is my Homeassistant configuration:

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

http:
  use_x_forwarded_for: true
  trusted_proxies:
    - 172.30.33.0/24
  ip_ban_enabled: true
  login_attempts_threshold: 5

additional_ca:
  my_private_ca: lan.crt

opnsense:
  url: https://router.lan/api
  api_secret: U+sfLniJujz94...
  api_key: JdjDxeaxhOs3cL...
  verify_ssl: True
  tracker_interfaces:
    - Trusted

group:
  smartphones:
    name: "Our Smartphones"
    entities:
      - device_tracker.phone_alice
      - device_tracker.phone_bob

The interface Trusted is the name of the opnsense interface where both devices are in.

Here is my Opnsense user configuration:

URL

Version

2024.7.4

1 Like

were you able to fix this? I have the same problem that I cannot see any entity for the opnsense integration

1 Like

There is an open issue, maybe you encounter the same problem?

I see entities, they are just always set as at ‘home’ never as ‘away’.

I tried checking the authentication via to the opnsense via curl:
curl -k -u w86XNZob/8Oq8aC5hxh2he+vLN00r0kbNarNtdpoQU781fyoeaOBQsBwkXUt":"puOyw0Ega3xZXeD26XVrJ5WYFepOseySWLM53pJASeTA3" https://192.168.1.1/api/core/firmware/status, but this works also. The next thing I am checking is disabling static ARP entries for this devices…

Hi, Does someone Experience Presence got automatically being away?
when i set the scan interval to 30, after 30sec from reload the status will be changed to away, I tried to configure consider home for 180 sec and scan interval for 150sec still after the time passed that has been set on scan interval it will be automatically turned to away.

  • OPNsense version 24.7.6
  • os-homeassistant-maxit (installed) 1.0

I got same experience as you described.

I’m trying to get this integration to work as well. Let us know here if there’s been any progress or breakthroughs.

I got it to work by solving two issues:

  1. When all your device trackers are shown at ‘Home’ all the time, then make sure that in your opnsense → Services → DHCP → lan → Enable Static ARP entries is DISABLED

  2. When all your device trackers are shown at ‘Away’ all the time, then ssh into your homeassistant.There is a file /config/known_devices.yaml and there I had to make sure an entry matching the device tracker name exists with the right MAC address.

1 Like