Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReCollect showing 'services' every weekday #99480

Closed
mtwo opened this issue Sep 1, 2023 · 8 comments · Fixed by #99780
Closed

ReCollect showing 'services' every weekday #99480

mtwo opened this issue Sep 1, 2023 · 8 comments · Fixed by #99780

Comments

@mtwo
Copy link

mtwo commented Sep 1, 2023

The problem

At some point over the past few months, my ReCollect integration started showing 'services' and (sometimes) 'green_cart_service' on every weekday, in addition to my regular weekly garbage, compost, and recycling pickups. This has continued even when I've reloaded the integration, checked that my location and services parameters are still accurate, or substituted in a nearby address. It's making ReCollect less useful, as my current and next pickup entries are almost always clogged with these nonexistent events.

The ReCollect calendar that I copied the location and services parameters from only lists garbage, recycling, and compost, which are the events that I actually want to track.

Here's an example for a nearby address with calendar link: https://api.recollect.net/api/places/92A3A2FC-A98D-11E2-8E28-79B64144C028/services/193/calendar.html?show_print_setup=1&locale=en

image

image

What version of Home Assistant Core has the issue?

core-2023.8.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

ReCollect Waste

Link to integration documentation on our website

https://www.home-assistant.io/integrations/recollect_waste/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Sep 1, 2023

Hey there @bachya, mind taking a look at this issue as it has been labeled with an integration (recollect_waste) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of recollect_waste can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign recollect_waste Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


recollect_waste documentation
recollect_waste source
(message by IssueLinks)

@bachya
Copy link
Contributor

bachya commented Sep 5, 2023

The challenge is that ReCollect is explicitly returning those pickup types in the raw data—for example:

[
  {
    "service_name": "waste",
    "subject": "Services",
    "short_text_message": null,
    "opts": {
      "event_proto": {
        "calendar_only": 1,
        "bic_slot_count": 9999,
        "reminder_only": 1
      },
      "event_type": "pickup"
    },
    "plain_text_message": null,
    "backgroundColor": "#A59E4C",
    "id": 19194,
    "icon_uri_fragment": "0,0,0/checkbox",
    "voice_message": null,
    "sort_order": 0,
    "icon": "checkbox:rgb(0,0,0)",
    "area_name": "Vancouver",
    "borderColor": "#A59E4C",
    "is_week_long": 0,
    "color": "#A59E4C",
    "name": "services",
    "event_type": "pickup",
    "html_message": "<p><strong>Service Sign Up&nbsp;by City of Vancouver. </strong></p>\n\n<p>Got a problem?, <a target=\"_blank\" href=\"http://rco.io/1GU2G\">visit Vancouver&rsquo;s website</a>, <a target=\"_blank\" href=\"http://rco.io/9TRSX\">download the Van311 app</a><a target=\"_blank\" href=\"http://rco.io/SKHCL\">, </a>or call 311.</p>"
  },
  {
    "event_type": "pickup",
    "name": "garbage",
    "html_message": "<p><strong>Garbage service is provided by the City of Vancouver. </strong></p>\n\n<p>Set out your garbage by 7:00 am.</p>\n\n<p>For customer service, <a target=\"_blank\" href=\"http://rco.io/1GU2G\" target=\"_blank\">visit Vancouver&rsquo;s website</a>, <a target=\"_blank\" href=\"http://rco.io/9TRSX\">download the Van311 app</a><a target=\"_blank\" href=\"http://rco.io/SKHCL\" target=\"_blank\">, </a>or call 311.</p>",
    "textColor": "#ffffff",
    "is_week_long": 0,
    "color": "#121111",
    "borderColor": "#121111",
    "area_name": "Vancouver",
    "icon": "garbage:rgb(0,0,0)",
    "zone_id": 768,
    "icon_uri_fragment": "0,0,0/garbage",
    "voice_message": null,
    "sort_order": 15,
    "backgroundColor": "#121111",
    "id": 90,
    "plain_text_message": null,
    "opts": {
      "event_type": "pickup",
      "event_proto": {
        "calendar_only": 0
      }
    },
    "event_id": 23589169,
    "short_text_message": null,
    "subject": "Garbage",
    "service_name": "waste"
  },
  {
    "color": "#22b021",
    "textColor": "#ffffff",
    "is_week_long": 0,
    "html_message": "<p><strong>Green bin service is provided by the City of Vancouver. </strong></p>\n\n<p>Set out your green bin by 7:00 am.</p>\n\n<p>For customer service, <a target=\"_blank\" href=\"http://rco.io/1GU2G\" target=\"_blank\">visit Vancouver&rsquo;s website</a>, <a target=\"_blank\" href=\"http://rco.io/KVMN5\">download the Van311&nbsp;app</a><a target=\"_blank\" href=\"http://rco.io/SKHCL\" target=\"_blank\">, </a>or call 311.</p>",
    "name": "compost",
    "event_type": "pickup",
    "borderColor": "#22b021",
    "icon": "apple_core.vancouver:rgb(11,130,30)",
    "area_name": "Vancouver",
    "voice_message": null,
    "sort_order": 16,
    "icon_uri_fragment": "11,130,30/apple_core.vancouver",
    "zone_id": 768,
    "id": 92,
    "backgroundColor": "#22b021",
    "event_id": 23589326,
    "opts": {
      "event_proto": {
        "calendar_only": 0
      },
      "use_zone_color": 0,
      "event_type": "pickup"
    },
    "plain_text_message": null,
    "short_text_message": null,
    "service_name": "waste",
    "subject": "Green Bin"
  },
  {
    "service_name": "waste",
    "subject": "Recycling",
    "short_text_message": null,
    "event_id": 23783525,
    "opts": {
      "event_proto": {
        "calendar_only": 0
      },
      "event_type": "pickup"
    },
    "plain_text_message": null,
    "id": 1378,
    "backgroundColor": "#001aff",
    "voice_message": null,
    "sort_order": 29,
    "icon_uri_fragment": "0,26,255/recycle",
    "zone_id": 18846,
    "icon": "recycle:rgb(0,26,255)",
    "area_name": "RecycleBC",
    "borderColor": "#001aff",
    "color": "#001aff",
    "is_week_long": 0,
    "html_message": "<p>Place paper,&nbsp;container, and glass recycling at curb by 7:00 a.m. Recycling by Recycle BC (GFL Environmental). For customer service, call 604-282-7966 or email <a href=\"mailto:srrecycle@gflenv.com\">srrecycle@gflenv.com</a></p>",
    "name": "recycling_cov_curbside",
    "event_type": "pickup"
  }
]

I notice that opts.event_proto looks different between services/green_cart_service and the pickup types you care about. However, I'm not yet clear on how to generalize providing those options yet... I'll keep thinking on it.

@bachya
Copy link
Contributor

bachya commented Sep 5, 2023

Looking at my place and service ID, I unfortunately don't show any opts:

[
  {
    "is_week_long": 0,
    "icon_uri_fragment": "garbage",
    "service_name": "waste",
    "icon": "garbage",
    "area_name": "Denver",
    "short_text_message": null,
    "id": 183,
    "name": "garbage",
    "sort_order": 0,
    "subject": "Trash",
    "event_type": "pickup",
    "voice_message": null,
    "html_message": "<a target=\"_blank\" href=\"http://rco.io/QX65N\">Learn more about your trash collection</a>",
    "backgroundColor": "#58595b",
    "opts": {},
    "color": "#58595b",
    "plain_text_message": null,
    "borderColor": "#58595B"
  },
  {
    "id": 184,
    "name": "organics",
    "sort_order": 0,
    "event_type": "pickup",
    "subject": null,
    "icon": "leaf:rgb(9,122,7)",
    "zone_id": 1870,
    "area_name": "Denver",
    "short_text_message": null,
    "service_name": "waste",
    "is_week_long": 0,
    "icon_uri_fragment": "9,122,7/leaf",
    "borderColor": "#097a07",
    "event_id": 21320523,
    "color": "#097a07",
    "plain_text_message": null,
    "opts": {},
    "voice_message": null,
    "html_message": "",
    "backgroundColor": "#097a07",
    "textColor": "#FFFFFF"
  },
  {
    "service_name": "waste",
    "is_week_long": 0,
    "icon_uri_fragment": "133,0,214/recycle",
    "id": 182,
    "name": "recycle",
    "sort_order": 0,
    "subject": null,
    "event_type": "pickup",
    "icon": "recycle:rgb(133,0,214)",
    "zone_id": 253790,
    "area_name": "Denver",
    "short_text_message": null,
    "opts": {},
    "html_message": "",
    "voice_message": null,
    "backgroundColor": "#6247ae",
    "textColor": "#FFFFFF",
    "borderColor": "#6247ae",
    "color": "#6247ae",
    "event_id": 23587473,
    "plain_text_message": null
  }
]

@mtwo
Copy link
Author

mtwo commented Sep 6, 2023

Huh, interesting. I'm guessing that either the "calendar_only" or "reminder_only" (probably this one) fields being set to 1 means that the city web views and PDF calendar ignore these events.

It's odd - the 'services' entry appears to exist to remind people that they can install a city app to report problems, but it's ignored in all of the places where the city actually displays data from the ReCollect API. I imagine that the similarly spammy green cart service events are similar.

@bachya

This comment was marked as off-topic.

@bachya
Copy link
Contributor

bachya commented Sep 6, 2023

Good catch, @mtwo. When I include a query param to hide reminder_only flags, I get this response for your location (transformed into Python objects by aiorecollect):

[
    PickupEvent(
        date=datetime.date(2023, 9, 8),
        pickup_types=[
            PickupType(name="garbage", friendly_name="Garbage"),
            PickupType(name="compost", friendly_name="Green Bin"),
            PickupType(name="recycling_cov_curbside", friendly_name="Recycling"),
        ],
        area_name="Vancouver",
    ),
    PickupEvent(
        date=datetime.date(2023, 9, 15),
        pickup_types=[
            PickupType(name="compost", friendly_name="Green Bin"),
            PickupType(name="recycling_cov_curbside", friendly_name="Recycling"),
        ],
        area_name="Vancouver",
    ),
    PickupEvent(
        date=datetime.date(2023, 9, 22),
        pickup_types=[
            PickupType(name="garbage", friendly_name="Garbage"),
            PickupType(name="compost", friendly_name="Green Bin"),
            PickupType(name="recycling_cov_curbside", friendly_name="Recycling"),
        ],
        area_name="Vancouver",
    ),
    PickupEvent(
        date=datetime.date(2023, 9, 29),
        pickup_types=[
            PickupType(name="compost", friendly_name="Green Bin"),
            PickupType(name="recycling_cov_curbside", friendly_name="Recycling"),
        ],
        area_name="Vancouver",
    ),
]

This looks a lot better.

@mtwo
Copy link
Author

mtwo commented Sep 6, 2023

That's perfect, thanks! I'll try this out once it's released and I'll report back if there are any issues!

@mtwo
Copy link
Author

mtwo commented Sep 9, 2023

@bachya it worked, thank you so much!

@github-actions github-actions bot locked and limited conversation to collaborators Oct 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants