Skip to content

A wsdot travel times to mqtt bridge process

License

Notifications You must be signed in to change notification settings

mannkind/wsdot2mqtt

Repository files navigation

wsdot2mqtt

Software License Build Status Coverage Status

An experiment to publish WSDOT Travel Times to MQTT.

Use

The application can be locally built using dotnet build or you can utilize the multi-architecture Docker image(s).

Example

docker run \
-e WSDOT__APIKEY="BCz285y032akbAc6amd1" \
-e WSDOT__RESOURCES__0__TravelTimeID="132" \
-e WSDOT__RESOURCES__0__Slug="seattle2everett" \
-e WSDOT__MQTT__BROKER="localhost" \
-e WSDOT__MQTT__DISCOVERYENABLED="true" \
mannkind/wsdot2mqtt:latest

OR

WSDOT__APIKEY="BCz285y032akbAc6amd1" \
WSDOT__RESOURCES__0__TravelTimeID="132" \
WSDOT__RESOURCES__0__Slug="seattle2everett" \
WSDOT__MQTT__BROKER="localhost" \
WSDOT__MQTT__DISCOVERYENABLED="true" \
./wsdot2mqtt 

Configuration

Configuration happens via environmental variables

WSDOT__APIKEY                             - The WSDOT API key
WSDOT__RESOURCES__#__TravelTimeID         - The Travel Time ID for a specific travel time
WSDOT__RESOURCES__#__Slug                 - The slug to identify the specific travel time
WSDOT__POLLINGINTERVAL                    - [OPTIONAL] The delay between travel time lookups lookups, defaults to "0.00:03:31"
WSDOT__MQTT__TOPICPREFIX                  - [OPTIONAL] The MQTT topic on which to publish the collection lookup results, defaults to "home/wsdot"
WSDOT__MQTT__DISCOVERYENABLED             - [OPTIONAL] The MQTT discovery flag for Home Assistant, defaults to false
WSDOT__MQTT__DISCOVERYPREFIX              - [OPTIONAL] The MQTT discovery prefix for Home Assistant, defaults to "homeassistant"
WSDOT__MQTT__DISCOVERYNAME                - [OPTIONAL] The MQTT discovery name for Home Assistant, defaults to "wsdot"
WSDOT__MQTT__BROKER                       - [OPTIONAL] The MQTT broker, defaults to "test.mosquitto.org"
WSDOT__MQTT__USERNAME                     - [OPTIONAL] The MQTT username, default to ""
WSDOT__MQTT__PASSWORD                     - [OPTIONAL] The MQTT password, default to ""

Prior Implementations

Golang