Problem with opensky sensor

Been having an issue with opensky sensor the the past week or so. Doesn’t seem to load often on reboots, and when it does, will detect planes for very short period before stopping again. I checked the log, and found the below. I can’t tell from this what is happening. Anyone able to assist?

Logger: homeassistant.helpers.entity
Source: components/opensky/sensor.py:154
First occurred: July 12, 2022 at 6:23:12 PM (3382 occurrences)
Last logged: 5:59:26 AM

Update for sensor.opensky fails
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/simplejson/__init__.py", line 525, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.10/site-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/usr/local/lib/python3.10/site-packages/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 514, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 709, in async_device_update
    raise exc
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/opensky/sensor.py", line 154, in update
    states = self._session.get(OPENSKY_API_URL).json().get(ATTR_STATES)
  File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

It’s a known issue. https://github.com/home-assistant/core/issues/74935

I thought maybe it had something to do with limited API hits. I searched for anything about changes to their policies, but couldn’t find anything (only the current policy, which mentions the 100 hits for anonymous users, but in the absence of finding anything about a change, assumed that was how it always was, and that HA was working within that). Even registered users only get 1000 hits per day. So I’m guessing this integration has very limited uses now.

Are there any alternatives for HA integration? I couldn’t find anything in any of the list of integrations. I have a Silver FlightRadar24 membership. Would be great if I could use that somehow.

1 Like

Have you found a solution?

So basically, this opensky is useless, as it gets clogged extremely fast, and there is no way to add credentials. Sad, i was on a hype with it :frowning:

2 Likes

Hi,
I have made FlightRadar24 integration
You may check it here Custom Component: Flightradar24