Is the weather station you use local?
Does anyone know how to get NZ transport timetables into Home Assistant? I’m trying to grab the ones from the Dunedin City Council website and perhaps Airport data as well.
If no API is published then you need to resort to finding out where the public facing website is getting its data. Have a look at my post Home Assistant - New Zealand - #117 by timwelch where I describe using Postman to grab data urls.
I quickly ran it on the bus timetable website and worked out that you could easily pull bus data for a specific stop using JSON values…
Then you’d add it as a REST sensor in your configuration.yaml file like…
rest:
- resource: https://orc.mattersoft.fi/timetable/rest/stopdisplays/59005013
scan_interval: 60
sensor:
- name: "Next Bus Destination"
value_template: "{{ value_json['nextStopVisits'][0]['directionOfLine']['destinationName'] }}"
- name: "Next Bus Due"
value_template: "{{ value_json['nextStopVisits'][0]['stopVisits'][0]['scheduledArrivalTime'] | timestamp_custom('%H:%M', true)}}"
- name: "Scheduled Minutes Until Departure"
value_template: "{{ value_json['nextStopVisits'][0]['stopVisits'][0]['scheduledMinutesUntilDeparture']
It took me a while to work out the JSON path structure in the REST sensor but https://jsonpath.com/ is your friend here.
Hope this helps. Tim
They may use GTFS General Transit Feed Specification (GTFS) - Home Assistant
Do a search on your provider’s website. I found one for ChCh once, but then we moved to an area not serviced by buses, so gave up.
Wow! That’s pretty handy if you live somewhere serviced.
Looks like ORC publish one here - Otago Regional Council GTFS - OpenMobilityData
Saw this thread recently too.
Also quick question re the contact integration, It’s giving me 3 sensors. Do we enter contact energy usage, cumption & free energy consumption into grid consumption? I assume its best to write it the Kwh from the bills after that as well?
Sweet I got this into HA using the GTFS integration, I know the there’s a transport app that actively shows live data of where the bus is, wonder if there will ever be anything like that available.
i dont use it localy BUT it can be
dcc does have api that can be used BUT what you may find the problem to be in town is the buss are run by ORC and not the DCC try this
Same data as the one tim posted isn’t it, I’ve got some routes in, the near me one doesn’t appear to bring anything up in my testing but the others do. Not as good as the live transit app but certainly better than before.
I wonder how we’d get access to the API url for real time tracking, I presume email the regional council?
never hurts to ask you never know they maybe very open to the idea
Which Council was this? The reply seems misinformed - the information would be subjected to LGOIMA. Most other councils (all?) provide this openly.
The Otago Regional Council, wasn’t aware of the LGOIMA at all when I emailed I just asked if they could point me towards how i can get the API url
Frame your question as a request under the Act then
https://www.legislation.govt.nz/act/public/1987/0174/latest/DLM122242.html
That’s certainly worrying. All Council staff - even lifeguards and other non-desk based folks - should be made aware of LGOIMA as part of their continuing training.
In any case, I have asked for the information now and will follow this up.
ECAN has a full developer portal where they make this information available easily and is a great example of how it could be done.
Sorry just to clarify, I wasn’t aware of the LGOIMA so it never came up in the email. Thanks for making the request
Getting this in my dev build when testing the contact sensor integration. I have added all 3 possible sensors in though. No values are showing in the energy tab yet.
Does anyone know the difference between the usage sensor and consumption sensor?