anyone else seeing this in the logs for the Nederlandse Spoorwegen sensor:
2020-02-07 17:53:23 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 284, in async_update_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 328, in _async_write_ha_state
attr.update(self.device_state_attributes or {})
File "/usr/src/homeassistant/homeassistant/components/nederlandse_spoorwegen/sensor.py", line 190, in device_state_attributes
if self._trips[1].departure_time_actual is not None:
IndexError: list index out of range
2020-02-07 17:53:33 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 284, in async_update_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 328, in _async_write_ha_state
attr.update(self.device_state_attributes or {})
File "/usr/src/homeassistant/homeassistant/components/nederlandse_spoorwegen/sensor.py", line 190, in device_state_attributes
if self._trips[1].departure_time_actual is not None:
IndexError: list index out of range
in multitudes…
my sensors are displaying fine in the frontend…
It looks like there were changes 4 days ago in the git logs
Also, I assume you’ve generated a new API key? “New Setup” kind of implies you did, but just checking.
Breaking Change:
The “RetrieveTripInformationPublic” API (“Public-Travel-Information” product) will be deprecated on 31-01-2020. All users MUST create a new API token for the “Reisinformatie” API (“Ns-App” product) and use that one instead.
You say the sensors are working, but I’m not sure how with this.
I’m not sure if the changes from 4 days ago were include in 0.105.2. You could try manually updating the component to the latest. Just create a custom_component/nederlandse_spoorwegen and do a git pull of the latest manually. After reboot, it will be using this latest one. Just be sure to remove it if the push the latest to HA so you get those future updates.
The recent changes did make it to 0.105! Together with the NSAPI maintainers (not made by NS), we are discovering inconsistencies in the new NS API, it seems that it’s causing multiple different bugs in the integration. I’ll do some more digging today, see what exactly needs fixing.
multitudes of this (and others) keep popping up in the log:
2020-02-09 17:03:53 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.roosendaal_rotterdam fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 461, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 240, in wrapper
result = method(*args, **kwargs)
File "/usr/src/homeassistant/homeassistant/components/nederlandse_spoorwegen/sensor.py", line 208, in update
2,
File "/usr/local/lib/python3.7/site-packages/ns_api.py", line 932, in get_trips
return self.parse_trips(raw_trips, requested_time)
File "/usr/local/lib/python3.7/site-packages/ns_api.py", line 843, in parse_trips
newtrip = Trip(trip, requested_time)
File "/usr/local/lib/python3.7/site-packages/ns_api.py", line 606, in __init__
trip_part = TripSubpart(part)
File "/usr/local/lib/python3.7/site-packages/ns_api.py", line 454, in __init__
stop = TripStop(raw_stop)
File "/usr/local/lib/python3.7/site-packages/ns_api.py", line 409, in __init__
self.platform_changed = bool(self.actual_platform != self.planned_platform)
AttributeError: 'TripStop' object has no attribute 'planned_platform'
Thanks for logging this one, it’s new to me but all revolves around the same issue: single attributes randomly disappear from the API’s response… Don’t know who thought would be a great idea. I’ll mention it in the NSAPI library’s repo, see what we can do