Hello! I would like to share my first python project
One of the most common ways to travel around in Singapore is by public transport, of which buses being the most common. The double decker buses in Singapore are similar to those in London. The Land Transport Authority has a public bus API that can be used to track and determine the bus timings for specified bus stops.
I made a custom component to retrieve specified bus timings for specified bus stops. It can also be installed via HACS:
The API however requires an API key, which can be requested on Datamall.
There may be a few bugs here and there, but generally the component should work fine. Any feedback is appreciated.
Hi, I’m new to HA and I’m looking to build from scratch with HA green since that’s what everyone is suggesting for beginner. Am I able to use this code with HA green? I read a few posts and looks like it will be possible as an integration, correct me if I’m wrong. Thanks in advanced!
Hello. I tried to search for ha-lta in HACS in my home assistant 2024.8 but there isn’t such item. Can you help if this is no longer there? Or its some where else?
This retrieves the arrival information for one specific bus service ServiceNo at one bus stop BusStopCode. You also need to sign up on LTA Datamall to obtain your API key that you can use in accountKey.
I set the scan_interval very high and use a separate automation to home_assistant.update_entity the sensor only when the bus arrival time data is actually available, otherwise when the bus is not running or the API is down for maintenance, the sensor will be unavailable and your logs will be spammed with errors. If this doesn’t bother you, you can set scan_interval to something usable like 60.