Skip to content

Latest commit

 

History

History
71 lines (49 loc) · 3.05 KB

api_golemio_cz.md

File metadata and controls

71 lines (49 loc) · 3.05 KB

Praha - Czech Republic

Support for schedules provided by Golemio API, open data platform for Prague, CZ.

Configuration via configuration.yaml

waste_collection_schedule:
    sources:
    - name: api_golemio_cz
      args:
        lat: LAT
        lon: LON
        radius: RADIUS
        api_key: API_KEY
        ignored_containers:
          - 123
          - 456
        auto_suffix: True
        suffix: SUFFIX

Configuration Variables

lat integer (required): Latitude of the location.

lon integer (required): Longitude of the location.

radius integer (required): Radius from the defined location, use low value to select a single separation point.

api_key string (required): API key for Golemio API, see below.

only_monitored boolean (optional): Only return monitored containers (the state is not reported by the integration though).

ignored_containers: list of integers (optional): List of IDs for containers to ignore.

auto_suffix: boolean (optional): Automatically append address as the suffix to all containers found in this query.

suffix: string (optional): Suffix to append to all containers found in this query.

Example

waste_collection_schedule:
    sources:
    - name: api_golemio_cz
      args:
        lat: 50.104802397741665
        lon: 14.538238985303936
        radius: 1
        api_key: !secret golemio_api_key
        suffix: " - Chvalská"
        ignored_containers: 
          - 35895

Getting the API key

To get the API key, you must register at the Golemio site with a verified e-mail address. Follow instructions at the Golemio site and save the generated token to your secrets.yaml.

Using suffix and auto_suffix

The suffix and auto_suffix arguments are used to append text to the end of the container types. This is useful when you have multiple containers with the same type, but in different locations. The suffix is generally useful if you have multiple config entries, each targeting a single separation point, while the auto_suffix is essentially necessary to use queries that return multiple separation points, each container will be then appended with an address (e.g. Papír - Oktábcových 1039/1). If both arguments are supplied, suffix is appended after the auto-generated suffix.

Ignoring containers

Sometimes you don't want to get all containers, for example if a pick date is not provided for the container and a warning is shown in the logs. You can use ignored_containers list to exclude these containers from the result.

Note on calculation of collection dates

The API provides only a single future date in a single query. However, the schema contains information about weekdays and frequency of the collection which are used for calculation of other dates. Currently, the integration calculates one past date (or today's date, because the API does not return the collection date if it's today) and future dates to return 10 dates for every container returned in the query.