After making an attempt a number of public transport integrations and messing round with YAML configurations, I lastly added dependable transit info to my Dwelling Assistant dashboard.
Due to a customized integration and about 5 minutes of setup, the entire thing was surprisingly straightforward.
Why I added public transport information to Dwelling Assistant
It’s not (simply) as a result of I’m a nerd
I’m fortunate sufficient to have good transit hyperlinks the place I stay, with two practice traces, a ferry service, and loads of buses inside a couple of minutes’ stroll from my home. As a result of I take the practice each time I can, I wished a dependable solution to rapidly visualize the subsequent departures when leaving the home.
Including this information to Dwelling Assistant as a sensor that sits alongside your different information sources offers you an at-a-glance view of the closest buses, trains, and trams primarily based on wherever you might be. With non-obligatory real-time updates, you may construct out a extra complete dashboard that shows the placement of autos and alerts.
Including this information to Dwelling Assistant primarily turns your good dwelling server right into a transit tracker. With Dwelling Assistant checking for upcoming departures, you may ask your voice assistant when the subsequent practice to the town leaves. With the info accessible in Dwelling Assistant, you may pull it into different gadgets like those powered by ESPHome.
For those who’re notably intelligent, chances are you’ll even have the ability to discover a solution to combine particular companies with notifications, alerts, and different automations. Me? I simply wished so as to add yet one more helpful service to Dwelling Assistant.
Including transit info with GTFS2
Customized integrations come to the rescue
The Basic Transit Feed Specification is, because the title suggests, a regular for delivering details about transit feeds. It’s an industry-standard, so there’s a very good probability that your native public transport authority is utilizing it. It’s what journey planners and mapping companies like Google Maps use. GTFS depends on a static timetable, with non-obligatory real-time parts.
To tug a timetable into Dwelling Assistant, I’m utilizing the GTFS2 integration. To make use of this, you’ll must install the Home Assistant Community Store. From right here, seek for “GTFS2” then click on on it, hit Obtain, and reboot Dwelling Assistant. You’ll now discover GTFS2 in your Dwelling Assistant integrations checklist.
Whenever you first add the combination, you’ll want so as to add a static GTFS supply. You are able to do this by both offering the hyperlink to the ZIP file out of your native transit authority, or by downloading the file and importing it to the combination’s gtfs2-folder listing.
With this performed, head again to Integrations and click on Add Integration once more. Now you can add a schedule or checklist departures in your neighborhood. The primary choice helps you to specify the subsequent companies between two factors, whereas the latter makes use of both the placement of your server or an individual (added below Settings > Individuals) to checklist the close by departures.
I’m utilizing this to get the subsequent trains heading in direction of the town from my native practice station. The mixing does numerous the heavy lifting, and I solely needed to checklist cease names and provides the route a reputation for it to work the primary time. When you’ve arrange a route, you may click on on the combination to see the checklist of entries, then use the “cog” button to allow the Setup Realtime integration? toggle.
It will give fields in which you’ll add feeds for updates, automobile positions, and alerts. You also needs to replace the Knowledge refresh interval to one thing that makes extra sense on your cease. The default worth is quarter-hour, however in case you have extra frequent companies, then you definitely’re going to need to modify this accordingly.
GTFS2 has a listing of transit companies that work with it, however the checklist is much from exhaustive. My native service isn’t listed; I simply tried it out as soon as I discovered the required URLs for GTFS companies. Strive it out; you is perhaps pleasantly stunned.
The subsequent steps
Create your personal departures board
For me, having the subsequent departures to the town on my Dwelling Assistant dashboard as a sensor is what it’s all about. As a little bit of a transit nerd, I’ve wished so as to add information in regards to the subsequent departures to a small devoted show, and this looks like a great way to perform this.
You may feasibly use an ESP32 operating ESPHome with an E-Ink show to create a dashboard extension that sits in your desk or on a hallway desk. If you have already got a wall-mounted Dwelling Assistant pill, add the GTFS2 card to your dashboard, and also you’re performed.
The GTFS2 documentation goes into element about visualizing the data, with some examples for prolonged timetables and maps with real-time automobile positions. You may in all probability even get an LLM like ChatGPT to help you design your own custom card.
Lastly, I uncovered my city-bound trains entity to Dwelling Assistant’s voice assistants, after which added an alias referred to as “trains to the town.” This implies I can ask Dwelling Assistant’s voice assistant “when’s the subsequent practice to the town” to get an correct response.
- Dimensions (exterior)
-
4.41″L x 4.41″W x 1.26″H
- Weight
-
12 Ounces
Dwelling Assistant Inexperienced is a pre-built hub immediately from the Dwelling Assistant group. It is a plug-and-play answer that comes with every thing it’s worthwhile to arrange Dwelling Assistant in your house while not having to put in the software program your self.
Dwelling Assistant isn’t nearly controlling lights and different native gadgets; it could actually hook up with all types of helpful companies to make life that little bit simpler. It begins as an working system on your dwelling, however finally can develop to embody your complete digital life.
Don’t imagine me? Check out what’s possible with the underused calendar feature and why adding your 3D printer to Home Assistant is totally worth it.
Source link

