Dashticz - Module - Public Transport

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Dashticz - Module - Public Transport

Post by robgeerts »

First of all, thanks to @ultrara1n who started to build this module just the way the calendar- and trashmodule is coded too :)
In latest beta it is possible to show the timetable of the public transport company VVS (Germany) AND NS (Netherlands) with live data.

VVS:
To call the function properly, you will need the correct station id from: https://efa-api.asw.io/api/v1/station/
So for Stuttgart Central Station the station id is 5006118

Then add this to config.js:

Code: Select all

var publictransport = {}
publictransport.hbf= { show_via: true, station: '5006118', title:'Trains', show_lastupdate:true, provider: 'VVS', icon: 'train', interval: 15, results: 5 };
9292.nl:
First get the station id from http://api.9292.nl/0.1/locations?lang=nl-NL&q=eindhoven
(Change eindhoven to your own search parameter).
Then copy the id!

Code: Select all

//example station id: station-eindhoven
var publictransport = {}
publictransport.ovinfo= { show_via: true, station: 'station-eindhoven', title:'OV Info', show_lastupdate:true, provider: '9292', icon: 'train', results: 5 };
publictransport.ovinfotrain= { show_via: true, station: 'station-eindhoven', title:'Bus', show_lastupdate:true, provider: '9292-bus', icon: 'bus', results: 5 };
publictransport.ovinfobus= { show_via: true, station: 'station-eindhoven', title:'Trein', show_lastupdate:true, provider: '9292-train', icon: 'train', results: 5 };
Mobiliteit.lu:
To call the function properly, you will need the correct station name, for example:
Luxembourg/Centre, Royal

Then add this to config.js:

Code: Select all

var publictransport = {}
publictransport.ovinfobus = { key:'ovinfobus', show_via: false, station: 'Luxembourg/Centre, Royal', provider: 'mobiliteit',title:'Royal Stop',show_lastupdate:true, icon: 'bus', width:6,  results: 4}

icon is simply font-awesome without fa, interval = time in seconds for refreshing the data, and results = number of shown results. Also possible is to customize the width, but i would not change the value of 12 because of the size of the output.

If anyone can provide JSON-output from other transport companies, please send me a message and I will add these!
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: Dashticz - Module - Public Transport

Post by robgeerts »

In latest beta, NS is working too!
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Dashticz - Module - Public Transport

Post by EdwinK »

Thanks again. I don't really need it, but it's good to see it can be placed

Don't know if you can use this, but this is a dataset of RET Rotterdam.

http://rotterdamopendata.nl/dataset/ret

There are more API's to be found from parking garages in Rotterdam (and maybe even other cities)
Last edited by EdwinK on Tuesday 16 May 2017 11:32, edited 2 times in total.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
qwerk
Posts: 222
Joined: Tuesday 22 July 2014 7:21
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Netherlands
Contact:

Re: Dashticz - Module - Public Transport

Post by qwerk »

real nice, Dashticz is getting better and better, I have the stations I need.
Will there be a possibility for title? ( For I have multiple stations in view)
And is the bus also coming ??

Rob , keep up the good work.
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: Dashticz - Module - Public Transport

Post by robgeerts »

I was already looking into a timetable for buses.
I could use the 9292.nl-API..
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: Dashticz - Module - Public Transport

Post by robgeerts »

Check latest beta :)
And first post of this topic for the configuration ;)
qwerk
Posts: 222
Joined: Tuesday 22 July 2014 7:21
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Netherlands
Contact:

Re: Dashticz - Module - Public Transport

Post by qwerk »

that was quick ( as always)
do you use the word "station" in the script?
I would like to use the nearest busstop,

normally you would give station-village station-arnhem
but now I would like to be able to http://9292.nl/andelst/bushalte-wilhelminastraat

Is that do-able?

goodluck.....
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: Dashticz - Module - Public Transport

Post by robgeerts »

Yes, use:

Code: Select all

var publictransport = {}
publictransport.ovinfobus= { station: 'andelst/bushalte-wilhelminastraat', provider: '9292-bus', icon: 'bus', results: 5 };
qwerk
Posts: 222
Joined: Tuesday 22 July 2014 7:21
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Netherlands
Contact:

Re: Dashticz - Module - Public Transport

Post by qwerk »

I get nothing anymore ( transportation) herokuapp issues?
exception
:
{type: "System.Web.HttpException", message: "Not Found"}
message
:
"Not Found"
type
:
"System.Web.HttpException"
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: Dashticz - Module - Public Transport

Post by robgeerts »

qwerk wrote: Will there be a possibility for title? ( For I have multiple stations in view)
Title now possible (see startpost for example config)
Download latest beta!
vgr2
Posts: 71
Joined: Monday 29 August 2016 12:02
Target OS: -
Domoticz version:
Contact:

Re: Dashticz - Module - Public Transport

Post by vgr2 »

Hi rob, with some of your last update multiple stations did not work correctly in showing the time at the 5 results. First station looks fine, second and more station only the last result is correct. 1-4 results are not updated. Can You check this please?
qwerk
Posts: 222
Joined: Tuesday 22 July 2014 7:21
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Netherlands
Contact:

Re: Dashticz - Module - Public Transport

Post by qwerk »

My bus and train stations all look fine and are updated.
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: Dashticz - Module - Public Transport

Post by robgeerts »

Mine are updated too..
blacksn0w
Posts: 99
Joined: Friday 10 March 2017 22:27
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany
Contact:

Re: Dashticz - Module - Public Transport

Post by blacksn0w »

What are about the "loading..." text, why not updating it silent in the background instead of creating this visual distraction?
Migration done, hello Home Assistant.
vgr2
Posts: 71
Joined: Monday 29 August 2016 12:02
Target OS: -
Domoticz version:
Contact:

Re: Dashticz - Module - Public Transport

Post by vgr2 »

That's my. Only first station is ok.
Attachments
Unbenannt.JPG
Unbenannt.JPG (47.23 KiB) Viewed 8244 times
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: Dashticz - Module - Public Transport

Post by robgeerts »

Could you send me your config?
vgr2
Posts: 71
Joined: Monday 29 August 2016 12:02
Target OS: -
Domoticz version:
Contact:

Re: Dashticz - Module - Public Transport

Post by vgr2 »

I had send you my config by PN
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: Dashticz - Module - Public Transport

Post by robgeerts »

vgr2 wrote:I had send you my config by PN
Thansk, could you test latest beta version?
blacksn0w wrote:What are about the "loading..." text, why not updating it silent in the background instead of creating this visual distraction?
Fixed in latest beta version!
freakshock
Posts: 64
Joined: Friday 14 April 2017 13:39
Target OS: NAS (Synology & others)
Domoticz version:
Location: The Netherlands
Contact:

Re: Dashticz - Module - Public Transport

Post by freakshock »

Idea for a configurable feature for this module:
How about making it possible to exclude results between the current time and the first departure time listed?

For instance: I have added my local trainstation near my house. It takes at least 15 minutes from my house to get there. It would be nice to be able to exclude results that show the trains leaving from the current time +15 minutes.

If I don't have this feature I have to make my list really long :lol:
vgr2
Posts: 71
Joined: Monday 29 August 2016 12:02
Target OS: -
Domoticz version:
Contact:

Re: Dashticz - Module - Public Transport

Post by vgr2 »

Now it's perfect,

Is there a possibility for me to change the font size?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest