hacs_waste_collection_schedule: Calender is Blank and Error when trying to call service

Hi trying to configure for Wiltshire Council in the UK. I am getting this error when I manually call the service and the calender is blank. Am I missing something?

websocket_api script: Error executing script. Unexpected error for call_service at pos 1: async_setup.<locals>.fetch_data() takes 0 positional arguments but 1 was given

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 451, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 684, in _async_call_service_step await service_task File "/usr/src/homeassistant/homeassistant/core.py", line 1755, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1798, in _execute_service await self._hass.async_add_executor_job( File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) TypeError: async_setup.<locals>.fetch_data() takes 0 positional arguments but 1 was given

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 17 (7 by maintainers)

Most upvoted comments

Yay! I’ll create a PR for the source so it automatically pads uprn to 12 digits.

Adding the 0 solved it for me too!!

That uprn returns a blank calendar on the Wilts web site, so not surprising nothing shows up in HA. image

Changing the uprn to the neighbouring house gives me this: image image

However, it looks like the uprn has to be 12 digits long - the website is padding the uprn with a leading 0. Maybe all the ones I tried previously were already 12 digits. If you do that to your own uprn what happens?

Some random SN12 postcodes also seem to work for me.

Pretty much every house in the UK should have a uprn, and the underlying query on the Wilts website is using it to pull back the calendar it displays. If you find your uprn from findmyaddress, then that should also be what their website is using.

The test case for Wilt uses:

  • BA149QP
  • 100121085972

Can you get that working on your HA instance? If that starts displaying, then we’ve ruled out config issues.

@jb123567: Do you get a collection calendar on the Wilts web site? @andonevris: If you can see the calendar on the website then perhaps there’s something odd going on with the config.

I’m also getting no data for Wilts. Using exactly the same config as the example you gave but with SN12 postcode

waste_collection_schedule:

sources:

- name: wiltshire_gov_uk
  args:
    postcode: "SN12 xxx"
    uprn: "1009xxxxxxx"
  calendar_title: Wilts
  • platform: waste_collection_schedule
name: Wiltshire
details_format: appointment_types
date_template: '{{value.date.strftime("%A %d %B %Y")}}'
add_days_to: true

image

I’ve got it working on a different but local address. By any chance is your address relatively new? Mine is 2016 and doesnt work. An older address, say 1990’s works. Must be a Wilts council issue.

Actually yes my house is 3 years old, that might be it.

I can manually search for my address at the wilts council website and it finds my address and displays the calendar fine.

I wonder if new addresses after a certain date don’t have a UPRN attached to them? Not sure how you would check. I will make some enquiries!