This is a Custom Component for Home-Assistant (https://home-assistant.io), fetches garbage pickup dates for parts of The Netherlands using HVC Groep's REST API.
To use this component in your installation, add the following to your configuration.yaml
file:
# Example configuration.yaml entry
sensor:
- platform: hvcgroep
postcode: 1234AB
huisnummer: 1
resources:
- gft
- plastic
- papier
- restafval
Configuration variables:
- postcode (Required): Your postal code.
- huisnummer (Required): Your house number.
- resources (Required): This section tells the component which types of garbage to get pickup dates for.
You can create 2 extra sensors which hold the type of garbage to pickup today and tomorrow:
- platform: template
sensors:
afval_vandaag:
friendly_name: 'Vandaag'
value_template: >-
{% if is_state_attr('sensor.hvc_groep_gft', 'day', 'Vandaag') %}
{% set gft = 'Groene Bak' %}
{% endif %}
{% if is_state_attr('sensor.hvc_groep_papier', 'day', 'Vandaag') %}
{% set papier = 'Blauwe Bak' %}
{% endif %}
{% if is_state_attr('sensor.hvc_groep_plastic', 'day', 'Vandaag') %}
{% set plastic = 'Plastic' %}
{% endif %}
{% if is_state_attr('sensor.hvc_groep_restafval', 'day', 'Vandaag') %}
{% set restafval = 'Grijze Bak' %}
{% endif %}
{{gft}} {{papier}} {{plastic}} {{restafval}}
- platform: template
sensors:
afval_morgen:
friendly_name: 'Morgen'
value_template: >-
{% if is_state_attr('sensor.hvc_groep_gft', 'day', 'Morgen') %}
{% set gft = 'Groene Bak' %}
{% elif is_state_attr('sensor.hvc_groep_papier', 'day', 'Morgen') %}
{% set papier = 'Blauwe Bak' %}
{% if is_state_attr('sensor.hvc_groep_plastic', 'day', 'Morgen') %}
{% set plastic = 'Plastic' %}
{% endif %}
{% if is_state_attr('sensor.hvc_groep_restafval', 'day', 'Morgen') %}
{% endif %}
{% set restafval = 'Grijze Bak' %}
{% endif %}
{{gft}} {{papier}} {{plastic}} {{restafval}}
And you can group them like so:
Afval Ophaaldagen:
- sensor.hvc_groep_gft
- sensor.hvc_groep_papier
- sensor.hvc_groep_plastic
- sensor.hvc_groep_restafval
- sensor.afval_vandaag
- sensor.afval_morgen
Add the relevant lines below to the configuration.yaml
:
logger:
default: info
logs:
custom_components.hvcgroep: debug