A typical implementation could be to initially choose your favourite route(s), and based on HA local time, display the next bus/train + the next hour) and also get any deviation info. This woudl be a great feature for any commuter, or even in-frequent travellers.
@ludeeus
I can’t get this to work for some reason.
In the log it looks like this.
Error while setting up platform ruter
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
return fut.result()
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/sensor/ruter.py", line 42, in setup_platform
add_devices([RuterSensor(stopid, destination)])
File "/config/custom_components/sensor/ruter.py", line 55, in __init__
self.update()
File "/config/custom_components/sensor/ruter.py", line 60, in update
self._defined_destination)
File "/config/deps/lib/python3.6/site-packages/pyruter/__init__.py", line 31, in getDepartureInfo
departureResponse = departureRequest[count]['MonitoredVehicleJourney']
IndexError: list index out of range
2018-09-28 19:14:22 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 336, in _async_add_entity
msg)
Not working.
I am getting this error:
2018-09-28 21:00:48 ERROR (SyncWorker_0) [homeassistant.util.yaml] YAML file /config/automations.yaml contains duplicate key "data". Check lines 73 and 77.
The other sensor it is talking about is this one:
# Weather prediction
sensor:
- platform: yr
name: Weather
forecast: 24
monitored_conditions:
- temperature
- precipitation
- windSpeed
- humidity
It is telling me I have to sensors in the config, which is true. One is for the buss timetable the other one is for Yr weather forecast. The buss timetable shows and works, but the weather does not show after including the second sensor (which is the sensor for ruter).
One is:
# Weather prediction
sensor:
- platform: yr
name: Weather
forecast: 24
monitored_conditions:
- temperature
- precipitation
- windSpeed
- humidity
Works great, thank you! Would be nice to set how many departures to display, to display the next two or three departures e.g. Also interesting to see how people use this sensor in Lovelace.