openhab-addons/bundles/org.openhab.binding.publictransportswitzerland/README.md
Jeremy Stucki 1cae863569
[publictransportswitzerland] Public Transport Switzerland Initial contribution (#8540)
* [publictransportswitzerland] Initital commit

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Add json stationboard

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Add csv stationboard

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Encoding / Data usage

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Update readme

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Update binding.xml

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Remove code owner

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Add more detailed thing status

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Make field filters a constant

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Remove json channel

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Stop scheduler on config error

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Work on i18n

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Remove TODO

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Re-order members

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Update label

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Set status to unknown instead of initializing

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Update version

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Log api response

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Mark CSV advanced

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Add error message

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Update readme

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Move members

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Add dynamic channels

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Implement dispose

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Remove unnecessary translation

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Rename csv -> tsv

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Update readme

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Update train names

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Fix markdown table

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Use UNDEF

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Allow departures without platform

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Work on display logic

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Use null

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Make style checks happy

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Implement refresh command

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Avoid hitting API limits

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Use expiring cache

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Update version

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Increase channel update interval

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Use lower cache expiration time

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Avoid glob import

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Make compiler happier

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Add error explanation

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Skip check

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Print message instead of stacktrace

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Store date format as final field

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Cache configuration

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Work on exception handling

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Update readme

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Make style checks happy

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Bump version

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Work on compiler warnings

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Add more detailed introduction

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Move tsv into group

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Bump version

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Update thing description

Co-authored-by: Fabian Wolter <github@fabian-wolter.de>
Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Update thing description

Co-authored-by: Fabian Wolter <github@fabian-wolter.de>
Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Remove explicit channel creation

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Run mvn spotless:apply

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Migrate to OH3

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Work on OH3 migration

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Bump version

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Define channel-type for departures

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Update copyright notice

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Move channel types below thing types

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Remove ignored files

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Remove author tag

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Update feature description

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Make linter happy

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* [publictransportswitzerland] Update README

Signed-off-by: Jeremy Stucki <dev@jeremystucki.ch>

* Bump version

Signed-off-by: Fabian Wolter <github@fabian-wolter.de>

Co-authored-by: Fabian Wolter <github@fabian-wolter.de>
2021-12-27 21:19:22 +01:00

44 lines
1.7 KiB
Markdown

# Public Transport Switzerland Binding
Connects to the "Swiss public transport API" to provide real-time public transport information. [Link to the API](https://transport.opendata.ch/)
For example, here is a station board in HABPanel. (Download [here](https://github.com/StefanieJaeger/HABPanel-departure-board))
![Departure board in HABPanel](doc/departure_board_habpanel.png)
## Supported Things
### Stationboard
Upcoming departures for a single station. This is what you would usually see displayed at the train station.
#### Channels
| channel | type | description |
|----------------|--------|----------------------------------------------------------------------------------------------|
| departures#n | String | A dynamic channel for each upcoming departure |
| tsv (advanced) | String | A tsv which contains the fields:<br />`identifier, departureTime, destination, track, delay` |
#### UI based Configuration
`station` is the station name for which to display departures.
The name has to be one that is used by the swiss federal railways.
Please consult their [website](https://sbb.ch/en).
#### Textual configuration
##### Thing
```
Thing publictransportswitzerland:stationboard:zurich [ station="Zürich HB" ]
```
##### Items
```
String Next_Departure "Next Departure" { channel="publictransportswitzerland:stationboard:zurich:departures#1" }
String Upcoming_Departures_TSV "Upcoming_Departures_TSV" { channel="publictransportswitzerland:stationboard:zurich:tsv" }
```
## Discovery
This binding does not support auto-discovery.