https://github.com/gsdevme/glasgow-bin-collection-mqtt
Single purpose service to take the next cycle of bin collections and publish them to MQTT for consumption in Home Assistant.
https://github.com/gsdevme/glasgow-bin-collection-mqtt
Last synced: 4 months ago
JSON representation
Single purpose service to take the next cycle of bin collections and publish them to MQTT for consumption in Home Assistant.
- Host: GitHub
- URL: https://github.com/gsdevme/glasgow-bin-collection-mqtt
- Owner: gsdevme
- Created: 2021-02-03T21:20:09.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-11-30T21:34:27.000Z (over 4 years ago)
- Last Synced: 2023-03-25T11:51:19.007Z (about 3 years ago)
- Language: HTML
- Homepage:
- Size: 60.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Glasgow Council Bin Collection to MQTT
Single purpose service to take the next cycle of bin collections and publish them to MQTT for consumption in Home Assistant.
https://www.glasgow.gov.uk/forms/refuseandrecyclingcalendar/AddressSearch.aspx


## Requirements
- Ability to run a container
- MQTT Server & Your Glasgow Council Bin ID (UPRN), you can grab this from the online form in the URL
### Basic Container Workflow
```bash
docker run -it --name glasgow-bin-collection --rm \
-e MQTT_HOST=> \
-e GLASGOW_COUNCIL_ID=> \
gsdevme/glasgow-bin-collection-mqtt:latest
```
### Kubernetes
```yaml
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: glasgow-bin-collection-cron
spec:
schedule: "0 7 * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: glasgow-bin-collection
image: gsdevme/glasgow-bin-collection-mqtt:latest
imagePullPolicy: IfNotPresent
envFrom:
- configMapRef:
name: glasgow-bin-config
restartPolicy: OnFailure
```
## Home Assistant
For each coloured bin create a `input_datetime` and `automation` like the following
```yaml
# configuration.yaml
input_datetime:
blue_bin:
name: blue_bin
has_date: true
has_time: false
```
```yaml
# automations.yaml
- alias: 'Set blue bin date'
trigger:
platform: mqtt
topic: "gcc/bins/blue"
condition: []
action:
- service: input_datetime.set_datetime
data_template:
entity_id: input_datetime.blue_bin
date: "{{ trigger.payload_json.date }}"
```