Device_tracker.luci: Luci responded with a 403 Invalid token

Hi! I have an issue with the OpenWRT / Luci device tracker. I keep getting the error message

[homeassistant.components.device_tracker.luci] Luci responded with a 403 Invalid token
every time Home Assistant queries the router.

I have found some information in a similar post (https://community.home-assistant.io/t/device-tracker-luci-invalid-response-from-luci-response-404) but it just wont help. I have luci-mod-rpc installed and can access the web interface / Luci via http.

In one post, it was stated that a rm /tmp/luci-indexcache on the router would help, but it does not help for me.

Curl responses:
http:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="refresh" content="0; URL=/cgi-bin/luci" />
</head>
<body style="background-color: white">
<a style="color: black; font-family: arial, helvetica, sans-serif;" href="/cgi-bin/luci">LuCI - Lua Configuration Interface</a>
</body>
</html>

https:

curl: (7) Failed to connect to [IP] port 443: Connection refused

Does it need to be able to connect via https? I dont need https in my LAN…

Any help appreciated.

Which version of OpenWRT and Home Assistant are you using?

  • OpenWrt Chaos Calmer 15.05.1 / LuCI 15.05-149-g0d8bbd2 Release (git-15.363.78009-956be55)
  • Home Assistant 0.87.1

Mmm that is very old. Is there any way you can upgrade to v17 or 18.06?

I am also having this issue. When I upgraded home assistant to 0.87.2, my whole installation started throwing errors and many functions stopped working. After restarting my raspberry pi and switching to the beta channel, everything started working except device_tracker.luci. I am also on Chaos Calmer 15.05.1. I tried upgrading to 18.06 a couple of months ago but the build for my router contained a critical bug that broke WAN port and made it impossible to connect to the internet. I’ll try to upgrade my router again to see if they fixed it and report back.

Updated to OpenWRT 18.06 and no longer getting 403 Invalid token on HA. My sensor is not detecting that when my phone is disconnected from my network. I dont know if it is a new problem or what.

Hi, I also have that problem. Updating OpenWRT would require extensive re-compilation and re-configuration of my setup. Is there a way to make things work with my old version?

There is. Custom components. See here: https://github.com/home-assistant/home-assistant/issues/22271#issuecomment-475527451. Thanks @fbradyirl

1 Like