Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sensor.next_train_from_xxx_to_xxx fails #12

Open
jone9618 opened this issue Feb 11, 2023 · 0 comments
Open

sensor.next_train_from_xxx_to_xxx fails #12

jone9618 opened this issue Feb 11, 2023 · 0 comments

Comments

@jone9618
Copy link

Hello

I have been using this integration for past 6 months. Much better than the official integration (especially given the problems caused by the owners of the data source). Thank you for putting this together.

I occasionally get bursts of errors in my logs. I had it in my mind that this was something to do with the strikes impacting on train movements, but I wondered whether there was something else going on. As you can see from below the number of occurrences are pretty high, so my logs are peppered with them (although oddly no occurrence in past few days).

Here is the log summary:

Logger: homeassistant.helpers.entity
Source: custom_components/realtime_trains_api/sensor.py:176
Integration: realtime_trains_api (documentation)
First occurred: 5 February 2023 at 17:20:19 (1006 occurrences)
Last logged: 9 February 2023 at 23:13:20

Update for sensor.next_train_from_hhl_to_cdf fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 548, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 746, in async_device_update
raise exc
File "/config/custom_components/realtime_trains_api/sensor.py", line 176, in _async_update
estimated = _to_colonseparatedtime(departure["locationDetail"]["realtimeDeparture"])
KeyError: 'realtimeDeparture'

My config is:

  - platform: realtime_trains_api
    username: 'xxxxxxxxxxx'
    password: 'xxxxxxxxxxxx'
    scan_interval:
      seconds: 90
    auto_adjust_scans: true 
    queries:
      - origin: HHL
        destination: CDF
        journey_data_for_next_X_trains: 5 
      - origin: HLL
        destination: CDF
        journey_data_for_next_X_trains: 3

Grateful for any thoughts on whether this is a genuine error or a configuration issue.

Thanks

Simon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant