hacs_waste_collection_schedule icon indicating copy to clipboard operation
hacs_waste_collection_schedule copied to clipboard

[Bug]: Static sensors becoming unknown

Open CZonin opened this issue 1 year ago • 7 comments

I Have A Problem With:

A specific source

What's Your Problem

Since 2023.11.x my static sensors are randomly changing their state to unknown. The only fix I've found is commenting out my config, restarting, then un-commenting, and restarting again.

Source (if relevant)

No response

Logs

no relevant logs

Relevant Configuration

waste_collection_schedule:
  sources:
    - name: static
      args:
        type: garbage
        frequency: WEEKLY
        weekdays: { MO, TH }
    - name: static
      args:
        type: papers
        frequency: WEEKLY
        interval: 2
        weekdays: WE
        start: '2023-11-15'
    - name: static
      args:
        type: bottles
        frequency: WEEKLY
        interval: 2
        weekdays: WE
        start: '2023-07-05'

sensor:
  - platform: waste_collection_schedule
    name: Garbage
    types:
      - garbage
    details_format: "upcoming"
    value_template: '{% if value.daysTo == 0 %}Today{% elif value.daysTo == 1 %}Tomorrow{% else %}{{value.date.strftime("%a, %b %d")}}{% endif %}'
    source_index: 0
  - platform: waste_collection_schedule
    name: Papers
    types:
      - papers
    details_format: "upcoming"
    value_template: '{% if value.daysTo == 0 %}Today{% elif value.daysTo == 1 %}Tomorrow{% else %}{{value.date.strftime("%a, %b %d")}}{% endif %}'
    source_index: 1
  - platform: waste_collection_schedule
    name: Bottles
    types:
      - bottles
    details_format: "upcoming"
    value_template: '{% if value.daysTo == 0 %}Today{% elif value.daysTo == 1 %}Tomorrow{% else %}{{value.date.strftime("%a, %b %d")}}{% endif %}'
    source_index: 2

Checklist Source Error

  • [X] Use the example parameters for your source (often available in the documentation) (don't forget to restart Home Assistant after changing the configuration)
  • [ ] Checked that the website of your service provider is still working
  • [ ] Tested my attributes on the service provider website (if possible)
  • [X] I have tested with the latest version of the integration (master) (for HACS in the 3 dot menu of the integration click on "Redownload" and choose master as version)

Checklist Sensor Error

  • [X] Checked in the Home Assistant Calendar tab if the event names match the types names (if types argument is used)

Required

  • [X] I have searched past (closed AND opened) issues to see if this bug has already been reported, and it hasn't been.
  • [X] I understand that people give their precious time for free, and thus I've done my very best to make this problem as easy as possible to investigate.

CZonin avatar Nov 11 '23 13:11 CZonin

I have the same issue except it won't add the collection schedule at all. Just says "unavailable".

DerHerzog7 avatar Nov 17 '23 02:11 DerHerzog7

Same issue here. I was using an iCal for London Borough of Bromley. I saw this now had direct support, and making the switch got things working again. However after a week it is back to reporting unknown

geozza123 avatar Nov 21 '23 19:11 geozza123

I am using mymuell.jumomind.com and they provide ics that can be used in hassio with ics calendar custom component. Then with sensor template, I am able to build sensors for my garbage. That way no need for this component.

alanmilinovic avatar Nov 21 '23 19:11 alanmilinovic

I had this issue, I modified start: '2023-07-05' to the next day in the future for the source, and it came back after that.

stephenjamieson avatar Nov 21 '23 20:11 stephenjamieson

Same issue here. I was using an iCal for London Borough of Bromley. I saw this now had direct support, and making the switch got things working again. However after a week it is back to reporting unknown

@geozza123 A fix has gone in for Bromley which could be contributing to them being unknown: https://github.com/mampfes/hacs_waste_collection_schedule/issues/1269

capandcamera avatar Nov 28 '23 11:11 capandcamera

The latest update has fixed my garden waste, but the others are still showing unknown.

geozza123 avatar Dec 06 '23 20:12 geozza123

I have found what my issue is. It looks like the names have changed, (I had some customisation that shortened long names) and it seems these no longer report "collection" on the end. Removing this has fixed my issue

      customize:
        - type: Food Waste collection
          alias: Food Waste
        - type: Garden Waste collection
          alias: Garden Waste
        - type: Mixed Recycling (Cans, Plastics & Glass)
          alias: Mixed Recycling
        - type: Non-Recyclable Refuse
          alias: General Waste
        - type: Paper & Cardboard
          alias: Cardboard

The above seems to now work

geozza123 avatar Dec 07 '23 16:12 geozza123