Giter Site home page Giter Site logo

vas3k / home-assistant-berlin-transport Goto Github PK

View Code? Open in Web Editor NEW
110.0 5.0 32.0 123 KB

Berlin (BVG) and Brandenburg (VBB) transport widget for Home Assistant

License: MIT License

Python 100.00%
berlin bvg home-assistant lovelace python hafas lovelace-card vbb vbb-hafas

home-assistant-berlin-transport's Introduction

Hi there 👋 I'm Vasily

  • 🇩🇪 I live in Berlin, Germany.
  • 🐍 I'm an engineer at Parity Technologies.
  • 🤖 Most of the time I'm writing on Python and Go. Sometimes JavaScript.
  • 🚀 I love pet-projects. They help me grow professionally all my life.
  • ✏️ I write articles on my blog (in Russian): vas3k.ru.
  • ✉️ You can shoot me an email at [email protected].

🛠 My fancy badge area

python golang postgres redis aws k8s terraform html javascript css React Vite django docker swagger fastapi asyncio git github pycharm prometheus GitLab CI jupyter pandas kafka conda homeassistant ElasticSearch openstreetmap raspberry pi stripe Ethereum latex

🐶 My pet-projects

vas3k.club is a small IT-lifestyle community with private and paid memberships that has emerged around my blog vas3k.ru and satellite chat-rooms. We are trying to build a helpful and candid ecosystem, which the Internet has lost a long ago. Therefore, we carefully select and filter new members and do not seek wild growth. The whole development process is open and managed on GitHub. The project attracted many volunteers who improve it together.

Timetable widget for my Smart Home dashboard. It uses the BVG (Berlin Transport) API to get trains, buses and trams arriving at the specified stop and allows you to plan your trips. Community liked the widget and it is now being used by hundreds of people.

Fast and simple media upload proxy on Go. Supports images and videos. Can resize and transcode them in-flight and cache the result. Optimized for small projects and blogs. Not meant to be used by anyone except me :D

My little experiment around information consumption, biased news and fighting FOMO. Unlike social networks, where newsfeeds make up by tops and likes, I made a site that aggregates several (sometimes opposite) news sources on one page and allows to analyze them myself. A small number of people really loved it and uses it every day.

🤝 Connect with me

me@vas3k.ru linkedin twitter vas3k.ru vas3k.com

home-assistant-berlin-transport's People

Contributors

braintimeexception avatar cornelicorn avatar gamdschi avatar herzogvonwiesel avatar kalambet avatar marcosterland avatar mrueg avatar vas3k avatar vdenisyuk avatar vincemue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

home-assistant-berlin-transport's Issues

Custom element not found: berlin-transport-timetable-card

Hellooo,

I tried this promising integration, but somehow failed to get the card running. Its my first custom card without HACS, so its probably something I am missing.

I added the integration and can see two entities.

I added the card to www directory:
image

and added the resource:
image

but in the dashboard, I receive an errors
image

Thanks alot!

Error occurred loading configuration flow

Hi. Unfortunately after installation and HA restart I have such error message:


Logger: homeassistant.config_entries
Source: config_entries.py:809
First occurred: 22:54:09 (2 occurrences)
Last logged: 22:54:51

Error occurred loading configuration flow for integration berlin_transport: No module named 'custom_components.berlin_transport.config_flow'


2022-12-03 23:14:50.563 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading configuration flow for integration berlin_transport: No module named 'custom_components.berlin_transport.config_flow'


Home Assistant 2022.11.1
Frontend 20221102.1 - latest

config_flow missing?

I can not install the sensor component following the documentation.

I tried the example configuration-yaml as well as a custom one with my own stops and ids. But whenever I want to add the entity "Berlin (BVG) and Brandenburg (VBB) transport" I get the following error in the home assistance interface: "Der Konfigurationsfluss konnte nicht geladen werden: {"message":"Invalid handler specified"}"

In the log file it shows "2023-02-09 09:41:57.597 ERROR (MainThread) [homeassistant. config_entries] Error occurred loading configuration flow for integration berlin_transport: No module named 'custom_ components berlin_transport.config_flow'"

I can not find the file berlin_transport.config_flow in the git - but I'm new to home assistant and do not understand (yet) the whole concept of flows.

Screenshot 2023-02-09 at 10 07 48

Home Assistant 2023.2.3
Supervisor 2023.01.1
Operating System 9.5
Frontend 20230202.0 - latest

Caching API responses

As https://v6.vbb.transport.rest/ mentions, they support caching.

Caching-friendly[🔗](https://v6.vbb.transport.rest/#caching-friendly)

This API sends [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) & [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control) headers, allowing clients cache responses properly.

@vas3k do you know if this is something the custom component would benefit from? (I'm not sure if they reload every time the frontend card is triggered)

Also asking because there's a rate limit of 100 reqs/min

Wrong Lovelac Card

Hey together,

thanks for your integration. I follow your steps, but i doesn't got the lovely result.
I do it step by step and got the following result
Screenshot 2023-10-29 123111
Screenshot 2023-10-29 122850

Can you help me?

I'm new in Home Assistant and i hope to get some support of you.

THX
David

Canceled trips are displayed

Dear developers,

I have just noticed that cancelled trips (in case of train cancellations etc.) are unfortunately still displayed.

Perhaps further attributes of the VBB API can be evaluated in order to be able to display aborted trips or not to display them in the first place?

Entity:
Bildschirmfoto vom 2023-02-07 14-47-32

VBB-Fahrinfo:
Bildschirmfoto vom 2023-02-07 14-48-08

Installation on HA 2023.2.4?

Hi,
I guess I ´m doing something wrong, but I can ´t manage to install it correctly, and I get an error on the configuration when trying to re-start: "Invalid config for [sensor.berlin_transport]: [sensors] is an invalid option for [sensor.berlin_transport]. Check: sensor.berlin_transport->sensors. (See ?, line ?)."
I have copied the berlin_transport folder as per instructions:

image

and added this to my sensors.yaml:

Berlin Transport
  • platform: berlin_transport
    sensors:
    departures:
    • name: "S Heiligensee" # free-form name, only for display purposes
      stop_id: 900091203 # actual Stop ID for the API
      direction: 900089303 # Tegel Optional stop_id to limit departures for a specific direction (same URL as to find the stop_id)
      walking_time: 8 # Optional parameter with value in minutes that hides transport closer than N minutes
    • name: "Ziegenorter Pfad" # currently you have to add more than one stop to track
      stop_id: 900091253
      direction: 900089303 # Tegel Optional stop_id to limit departures for a specific direction (same URL as to find the stop_id)
      walking_time: 7 # Optional parameter with value in minutes that hide transport closer than N minutes

Finally, I copied the berlin-transport-timetable-card.js file to www folder, and added it to the resources. (but I cannot see the card yet, I guess I have to re-start... which I can't as I get an error in the config.

image

help please?

Entity not available

Entities are not available since 14.12.2022 @17:35:24
Adapted berlin_transport to the latest changes as of 13.12.2022

Defining how far to look ahead

First of all, awesome integration, many thanks. Also, we seem to live in the same neighbourhood. :-D.

So, it says in the documentation:
After fetching the API, it creates one entity for each stop and writes 10 upcoming departures into attributes.departures.

The behaviour is a bit different for me. It seems to show all connections in the upcoming 5 - 10 minutes. Is there a way to define this time span? For instance set it to 20 or thirty minutes?

Display warnings

The API provides warnings like

				{
					"id": "213021",
					"type": "warning",
					"summary": "Störung.",
					"text": "Aufgrund des Streiks der Gewerkschaft GDL ist der Zugverkehr der S-Bahn Berlin von Mittwoch den 10. Januar 2 Uhr bis einschließlich Freitag den 12.Januar bis 18 Uhr massiv beeinträchtigt. Bitte mit Zugausfällen rechnen. Für Fahrten innerhalb Berlins nutzen Sie bitte die Verkehrsmittel der BVG (U-Bahn, Tram, Bus). Auch der Regional- und Fernverkehr der Deutschen Bahn sind von diesem Streik betroffen. Bitte informieren Sie sich entsprechend bei diesen Unternehmen.\n<a href=\"https://sbahn.berlin/\" target=\"_blank\" rel=\"noopener\">Information</a>",
					"icon": {
						"type": "HIM2",
						"title": null
					},
					"priority": 32,
					"products": {
						"suburban": true,
						"subway": false,
						"tram": false,
						"bus": false,
						"ferry": false,
						"express": false,
						"regional": false
					},
					"company": "VBB",
					"categories": [
						2
					],
					"validFrom": "2024-01-10T03:00:00+01:00",
					"validUntil": "2024-01-10T15:00:00+01:00",
					"modified": "2024-01-08T08:28:13+01:00"
				},

under departures[].remarks[] e.g. on this endpoint: https://v6.vbb.transport.rest/stops/900100003/departures

It would be nice if we could have them displayed in lovelace as well (I'm not sure how to achieve that though) Maybe a little attention mark on the line icon (not sure if this is an easy thing to do in CSS)

cannot hide name of stop in card title

Hi,

I changed show_stop_name to false but the title did not hide.
Am I missing something maybe?

image

type: custom:berlin-transport-timetable-card
show_stop_name: false
max_entries: 5
entities:
  - sensor.u_vinetastr_alex
  - sensor.u_vinetastr_heinersdorf

EDIT: not sure what happend, but suddenly I also had the issue , that the custom card was not found.
Just deleted the card.js and added the lovelace card from scratch incl. the ressource and now everything is working again.

Entity State Unavailable

Hi

I'm new to Home Assistant, and I'm trying to use this component but I'm getting the following error after creating the card:

"Entity State Unavailable"

My configuration:

  • type: custom:berlin-transport-timetable-card
    show_stop_name: true
    max_entries: 8
    entities:
    - sensor.stop_id_900000171514
    - sensor.meraner_str

Home Assistant 2022.12.8

Unsorted list of upcoming departures

The API returns a list of departures in unsorted order, therefore next_departure returns not really a next (closest) departure, but rather a first in the returned list of departures. The widget shows the list in unsorted order as well.

Update API to V6

The V5 of the vbb transport rest API is marked as deprecated and currently not responding.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.