I’m looking at integrating the local transit system with Home Assistant. Specifically, I want to watch the closest bus stop and tram stops and 1) put tokens on a map card showing the active busses on those lines and 2) provide information about approaching busses. My intention is to use the second to make a classic train-station-style board (probably virtually with a rpi and screen, but a real flipboard would be amazing), and possibly some lights / alerts about approaching service.
I definitely can use the RESTful integration, but to make this really useful as the busses and trains approach, I’d want to call every 15 seconds or so, which … is a lot. So, what I’d really like to do is use the Server Side Streaming API that the agency provides.
https://www.mbta.com/developers/v3-api/streaming
I know how to do the API side with Python Requests, but am new to integrating something like this with Home Assistant. My questions are:
- First of all… is there anything already existing that I could just use that I’ve missed?
- Or, are there integrations doing something similar I could look at for reference?
- Is it better to make this a “close” integration, or should I look at using MQTT or something? (I haven’t delved into that at all?)
- Would it be useful to make a general “Streaming JSON API”, integration, or should I just focus on making a specific one for the MBTA?
Thanks for your help!