mampfes / hacs_waste_collection_schedule

Home Assistant integration framework for (garbage collection) schedules
MIT License
988 stars 631 forks source link

[Bug]: Filtered Sensors doesnt show value.daysTo #2506

Closed ckarrie closed 3 weeks ago

ckarrie commented 3 weeks ago

I Have A Problem With:

Sensor configuration

What's Your Problem

I have some problems getting filtered sensors working (showing left days).

What I have done: I added a new sensor to existing source, set template value to {{ value.daysTo }} and filter to "Restmüll" (tried adding other sensors with different filters). The template value {{ value.daysTo }} only works for the initial added sensor (without any filter).

Screenshots: image

Configuration, selected a new created sensor: image

On the sensor popup: image image

Values: image

The initial added sensor works fine: image

section from .storage/core.config_entries:

{
        "created_at": "1970-01-01T00:00:00+00:00",
        "data": {
          "name": "abfallwirtschaft_germersheim_de",
          "args": {
            "city": "Winden",
            "street": ""
          }
        },
        "disabled_by": null,
        "domain": "waste_collection_schedule",
        "entry_id": "01J3CWT9ZG98B8C3BMRRX593P0",
        "minor_version": 1,
        "modified_at": "2024-08-19T19:06:02.079373+00:00",
        "options": {
          "calendar_title": "Abfallwirtschaft Germersheim",
          "separator": ", ",
          "fetch_time": "01:00",
          "random_fetch_time_offset": 60,
          "day_switch_time": "10:00",
          "sensor_select": [
            "Winden Müll Bioabfall"
          ],
          "customize": {
            "Restmüll ": {
              "show": true
            },
            "Heckenschnitt ": {
              "show": true
            },
            "Bioabfall ": {
              "show": true
            },
            "Papier ": {
              "show": true
            },
            "Gelber Sack ": {
              "show": true
            },
            "Glasbox ": {
              "show": true
            }
          },
          "sensors": [
            {
              "name": "Abfall Sensor 1",
              "details_format": "upcoming",
              "value_template": "{{ value.daysTo }}",
              "add_days_to": false
            },
            {
              "name": "Winden Müll Restmüll",
              "details_format": "upcoming",
              "value_template": "{{ value.daysTo }}",
              "types": [
                "Restmüll "
              ]
            },
            {
              "name": "Winden Müll Glasbox",
              "details_format": "upcoming",
              "value_template": "{{ value.daysTo }}",
              "types": [
                "Glasbox "
              ]
            },
            {
              "name": "Winden Müll Bioabfall",
              "details_format": "upcoming",
              "value_template": "{{ value.daysTo }}",
              "types": [
                "Bioabfall "
              ],
              "event_index": 0
            }
          ]
        },
        "pref_disable_new_entities": false,
        "pref_disable_polling": false,
        "source": "user",
        "title": "Abfallwirtschaft Germersheim",
        "unique_id": "abfallwirtschaft_germersheim_de{\"city\": \"Winden\", \"street\": \"\"}",
        "version": 2
      },

There is a space inside the type: "Restmüll " and "Bioabfall ". This could be the problem I guess.

Source (if relevant)

No response

Logs

No response

Relevant Configuration

No response

Checklist Source Error

Checklist Sensor Error

Required

5ila5 commented 3 weeks ago

This seems to be the same as #2325

The type auto suggested these types with spaces at the end, but the internal events have the space removed. Version 2.1.0 should have fixed this (The suggested types should no longer end with a space) or you type in the type manually and do not click the suggested value

You just need to remove the type and re-add the type for your existing sensors

ckarrie commented 3 weeks ago

Oh sorry, didn't find that issue. Your suggestion fixed my issue. I removed the suggested waste type and entered it manually.