Skip to content

Commit

Permalink
Merge pull request #17 from 0Styless/master
Browse files Browse the repository at this point in the history
Added examples for configuration in dashboard
  • Loading branch information
mampfes authored Sep 20, 2023
2 parents 5dc8a76 + 9ce63ba commit 0b29e54
Show file tree
Hide file tree
Showing 3 changed files with 242 additions and 2 deletions.
244 changes: 242 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ Index | Description (in German)
2.5 | mittlere bis hohe Belastung
3 | hohe Belastung


### Sensor Attributes

Each sensor provides the following attributes (not including default attributes):
Expand All @@ -67,4 +66,245 @@ state_today_desc | geringe Belastung | Human readable description of
state_tomorrow_desc | geringe Belastung | Human readable description of the forecast for tomorrow [in German].
state_in_2_days_desc| geringe Belastung | Human readable description of the forecast for the day after tomorrow [in German].
last_update | 2021-09-28T11:00:00+02:00 | Timestamp representing the last update of the data by DWD.
next_update | 2021-09-29T11:00:00+02:00 | Timestamp representing the next update of the data by DWD.
next_update | 2021-09-29T11:00:00+02:00 | Timestamp representing the next update of the data by DWD.

## Examples

A minimalistic example in combination with [Lovelace-Mushroom-Cards](https://github.com/piitaya/lovelace-mushroom) can look like this:

![](images/dwd-pollenflug-minimalistic.png)

To configure:

* Edit your dashboard
* Add a new Mushroom-Template-Card and copy/paste:

```yaml
square: true
type: grid
columns: 4
cards:
- type: custom:mushroom-template-card
entity: sensor.pollenflug_graeser_124
primary: Gras
icon: mdi:grass
layout: vertical
icon_color: |-
{% if states(config.entity) | int <= 1 %}
green
{% elif states(config.entity) | int <= 2 %}
orange
{% elif states(config.entity) | int <= 3 %}
red
{% endif %}
tap_action:
action: more-info
hold_action:
action: none
double_tap_action:
action: none
multiline_secondary: true
- type: custom:mushroom-template-card
entity: sensor.pollenflug_ambrosia_124
primary: Ambrosia
icon: mdi:flower-pollen
layout: vertical
icon_color: |-
{% if states(config.entity) | int <= 1 %}
green
{% elif states(config.entity) | int <= 2 %}
orange
{% elif states(config.entity) | int <= 3 %}
red
{% endif %}
tap_action:
action: more-info
hold_action:
action: none
double_tap_action:
action: none
multiline_secondary: true
- type: custom:mushroom-template-card
entity: sensor.pollenflug_beifuss_124
primary: Beifuss
icon: mdi:flower-pollen
layout: vertical
icon_color: |-
{% if states(config.entity) | int <= 1 %}
green
{% elif states(config.entity) | int <= 2 %}
orange
{% elif states(config.entity) | int <= 3 %}
red
{% endif %}
tap_action:
action: more-info
hold_action:
action: none
double_tap_action:
action: none
multiline_secondary: true
- type: custom:mushroom-template-card
entity: sensor.pollenflug_birke_124
primary: Birke
icon: mdi:flower-pollen
layout: vertical
icon_color: |-
{% if states(config.entity) | int <= 1 %}
green
{% elif states(config.entity) | int <= 2 %}
orange
{% elif states(config.entity) | int <= 3 %}
red
{% endif %}
tap_action:
action: more-info
hold_action:
action: none
double_tap_action:
action: none
multiline_secondary: true
- type: custom:mushroom-template-card
entity: sensor.pollenflug_erle_124
primary: Erle
icon: mdi:flower-pollen
layout: vertical
icon_color: |-
{% if states(config.entity) | int <= 1 %}
green
{% elif states(config.entity) | int <= 2 %}
orange
{% elif states(config.entity) | int <= 3 %}
red
{% endif %}
tap_action:
action: more-info
hold_action:
action: none
double_tap_action:
action: none
multiline_secondary: true
- type: custom:mushroom-template-card
entity: sensor.pollenflug_hasel_124
primary: Hasel
icon: mdi:flower-pollen
layout: vertical
icon_color: |-
{% if states(config.entity) | int <= 1 %}
green
{% elif states(config.entity) | int <= 2 %}
orange
{% elif states(config.entity) | int <= 3 %}
red
{% endif %}
tap_action:
action: more-info
hold_action:
action: none
double_tap_action:
action: none
multiline_secondary: true
- type: custom:mushroom-template-card
entity: sensor.pollenflug_esche_124
primary: Esche
icon: mdi:flower-pollen
layout: vertical
icon_color: |-
{% if states(config.entity) | int <= 1 %}
green
{% elif states(config.entity) | int <= 2 %}
orange
{% elif states(config.entity) | int <= 3 %}
red
{% endif %}
tap_action:
action: more-info
hold_action:
action: none
double_tap_action:
action: none
multiline_secondary: true
- type: custom:mushroom-template-card
entity: sensor.pollenflug_roggen_124
primary: Roggen
icon: mdi:flower-pollen
layout: vertical
icon_color: |-
{% if states(config.entity) | int <= 1 %}
green
{% elif states(config.entity) | int <= 2 %}
orange
{% elif states(config.entity) | int <= 3 %}
red
{% endif %}
tap_action:
action: more-info
hold_action:
action: none
double_tap_action:
action: none
multiline_secondary: true

```

You can also add the description / forecast:

![Alt text](images/dwd-pollenflug-desc.png)


Code:

```yaml
square: true
type: grid
columns: 2
cards:
- type: custom:mushroom-template-card
entity: sensor.pollenflug_graeser_124
primary: Gras
secondary: >-
Today: {{ state_attr('sensor.pollenflug_graeser_124', 'state_today_desc') }}
Tomorrow: {{ state_attr('sensor.pollenflug_graeser_124', 'state_tomorrow_desc') }}
icon: mdi:grass
layout: vertical
icon_color: |-
{% if states(config.entity) | int <= 1 %}
green
{% elif states(config.entity) | int <= 2 %}
orange
{% elif states(config.entity) | int <= 3 %}
red
{% endif %}
tap_action:
action: more-info
hold_action:
action: none
double_tap_action:
action: none
multiline_secondary: true
- type: custom:mushroom-template-card
entity: sensor.pollenflug_erle_124
primary: Erle
secondary: >-
Today: {{ state_attr('sensor.pollenflug_erle_124', 'state_today_desc') }}
Tomorrow: {{ state_attr('sensor.pollenflug_erle_124', 'state_tomorrow_desc') }}
icon: mdi:flower-pollen
layout: vertical
icon_color: |-
{% if states(config.entity) | int <= 1 %}
green
{% elif states(config.entity) | int <= 2 %}
orange
{% elif states(config.entity) | int <= 3 %}
red
{% endif %}
tap_action:
action: more-info
hold_action:
action: none
double_tap_action:
action: none
multiline_secondary: true
```
Binary file added images/dwd-pollenflug-desc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/dwd-pollenflug-minimalistic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0b29e54

Please sign in to comment.