I’ve created a custom component to display realtime departure times for stations within the BVG route network (including S-Bahn data). The component displays the time in minutes until the next departure, including delays. You can define a walking distance, so only departures that are “reachable” by you in a timely manner are displayed.
The component along with detailed instructions can be downloaded from here:
# Example configuration.yaml entry
sensor:
- platform: bvgsensor
name: U2 Rosa-Luxemburg-Platz
stop_id: "900000100016"
direction: "Pankow"
walking_distance: 5
There is no custom component for the Berlin public transport up till now and I had same spare, time so I decided to create one.
Update: released version 0.3.5
you can now specify multiple directions, e.g. if your route is served by multiple lines with different directions
the component is now time zone aware (using the time zone from your HA config)
Very good idea. Will try on weekend. If you want a feature request: use vbb-hafas instead of “just” bvg since this one will get the data of sbahn and bvg in berlin.
thanks, apreciate your feedback!
As for the feature request, the sbahn is included in the data-feed, so you may use it right away
Will update the description acordingly.
I would like to add the sensor to my ha (version 0.88). But it does not recognize the sensor?
I placed bvgsensor.py in /home/homeassistant/.homeassistant/config/custom_components/bvgsensor.py, changed permissions to homeassistant.homeassistant
My configuration.yaml:
It looks like the path for the custom_component is wrong. You would need to add the sensor folder…
the whole path would look something like this: ...../YOUR_CONFIG_PATH/custom_components/sensor/bvgsensor.py
So my config path should be --> /home/homeassistant/.homeassistant
Now I got only warnings in the log-file:
2019-02-24 14:02:43 WARNING (SyncWorker_3) [custom_components.sensor.bvgsensor] No valid connection found. Please check your configuration.
2019-02-24 14:02:04 WARNING (SyncWorker_1) [homeassistant.loader] Integrations need to be in their own folder. Change sensor/bvgsensor.py to bvgsensor/sensor.py. This will stop working soon.
Now I added your example-config with rosa-luxemburg - but still not working.
I’ve just checked your configuration and your configured stop_id (900000162001) is “S Karlshorst” and from what I saw in the data feed there is no connection with an final destination to “S Hackescher Markt” …
If you want the departure times for the S3, please specify the final destination which would be “S Spandau”.
You can also specify multiple destinations if there is more than one connection you could use…
hi @der_heinrich, i have just updated the code on github (v0.3.0). Please try the updated version and let me know if the problem still exists. I’ve tested it with the configuration below.
Fortunately it is pretty simple to get it up and running with 0.89 and beyond. Simply create a folder named bvgsensor within your custom_component folder and rename the file bvgsensor.py to sensor.py
You mean copy the custom component to the folder restart and than add the sensor?
Or should I add something additional to the configuration.yaml to load the custom component?
Im running into a similar problem: I have the sensor.py in the correct folder, “config\custom_components\bvgsensor\sensor.py”. Rights are set correctly as well. After restarting Hass.io I add