FaserF / ha-rewe

Rewe Discounts Homeassistant Integration
GNU General Public License v3.0
15 stars 4 forks source link
hacs-integration homeassistant

hacs_badge

CURRENTLY NOT WORKING ANYMORE, SINCE API HAS BEEN TAKEN DOWN! SEE https://github.com/FaserF/ha-rewe/issues/22

Rewe.de Homeassistant Discounts Sensor

Gets discounts and highlights from the rewe.de API.

Rewe.de Sensor

This integration provides the following informations with a refresh interval of 24 hours until now:

Sensors:

Sensor Attributes:

Installation

1. Using HACS (recommended way)

This integration is a official HACS Integration.

Open HACS then install the "Rewe" integration.

If you use this method, your component will always update to the latest version.

2. Manual

where <config> is your Home Assistant configuration directory.

NOTE: Do not download the file by using the link above directly, the status in the "master" branch can be in development and therefore is maybe not working.

Configuration

Go to Configuration -> Integrations and click on "add integration". Then search for Rewe.

Getting the rewe market ID

  1. Go to the REWE Marktsuche
  2. Enter your city or PLZ and choose your desired REWE
  3. Select "Marktinfos"
  4. Copy the marked id from the URL
Rewe.de Sensor

Configuration Variables

Lovelace cards

Sample Lovelace card from KrizzeOne

Provided by KrizzeOne:

# **Süßes und Salziges**
|            |        |       |
| :------------: |:------------- | -----:|
 {%- set product_list_loop =  state_attr('sensor.rewe_440421', 'discounts') -%}

{%- for product in product_list_loop -%} {% if 'Süßes & Salziges' in product.category and product.product != '' %}
| <img src="https://github.com/FaserF/ha-rewe/raw/main/{{product.picture_link[0] }}" width="50" height="50"/> | {{product.product }}
| ![badge](https://badgen.net/badge/{{ product.price | urlencode }}/€)
|  {%- endif -%}
{%- endfor -%}

Downsides / Considerations:

Sample Lovelace card from schblondie

Provided by schblondie:

Automations in HA

A full automation example for HA would be:

message: >
    Neues Angebot im Rewe Prospekt für
    {%- set product_list_loop =  state_attr('sensor.rewe_440421', 'discounts') -%}
    {%- for product in product_list_loop -%}
    {% if 'Spezi' in product.product or 'Käse' in product.product or 'Nutella' in product.product %}

    {{product.price.price }} € - {{product.product }}

    {{ product.picture_link[0] }}
    {%- endif -%}
    {%- endfor -%}

Bug reporting

Open an issue over at github issues. Please prefer sending over a log with debugging enabled.

To enable debugging enter the following in your configuration.yaml

logger:
    logs:
        custom_components.rewe: debug

Thanks to

This integration uses the great python code from Foo-Git Rewe-discounts