robbrad / UKBinCollectionData

UK Council Bin Collection Data Parser Outputting Bin Data as a JSON
MIT License
105 stars 73 forks source link

'No devices or entities' showing for Haringey Council #670

Closed TomAnks closed 2 months ago

TomAnks commented 3 months ago

Name of Council

Haringey Council

Issue Information

I am running on a Raspberry Pi, I have installed the HACS repository, and I have the UPRN for my council (Haringey), but at the moment the add-on just shows ‘No devices or entities’:

647b1426b1f24d6aa9c9f1cc161fef1926923385

This seems similar to the Selenium issue that was reported previously, but that doesn’t seem to be how Haringey provides its data.

Verification

dp247 commented 3 months ago

What parameters did you use in settings? I'll see if I can find the issue

TomAnks commented 3 months ago

Haringey Council for both the name and the council from the dropdown:

image

And then my UPRN, which I know is correct as it works on the council's website. I even tried with a neighbour's, but that didn't work either.

dp247 commented 3 months ago

Cool, if you wouldn't mind, could you email me your UPRN? My email is on my GitHub profile - it'd help with the debug for sure. Also, could you post your HA log file too please (either mail or here, whichever is easiest)

TomAnks commented 3 months ago

For some further information, I receive the following error from the logs:

This error originated from a custom integration.

Logger: custom_components.uk_bin_collection.sensor
Source: helpers/update_coordinator.py:315
integration: UK Bin Collection Data (documentation, issues)
First occurred: 15:30:03 (1 occurrences)
Last logged: 15:30:03

Unexpected error fetching Haringey (TEST) data: 'NoneType' object has no attribute 'find'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 315, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/uk_bin_collection/sensor.py", line 133, in _async_update_data
    data = await self.hass.async_add_executor_job(self.ukbcd.run)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/uk_bin_collection/uk_bin_collection/collect_data.py", line 96, in run
    return self.client_code(
           ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/uk_bin_collection/uk_bin_collection/collect_data.py", line 115, in client_code
    return get_bin_data_class.template_method(address_url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/uk_bin_collection/uk_bin_collection/get_bin_data.py", line 78, in template_method
    bin_data_dict = self.parse_data(
                    ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/uk_bin_collection/uk_bin_collection/councils/HaringeyCouncil.py", line 37, in parse_data
    .find(text=date_regex)
     ^^^^
AttributeError: 'NoneType' object has no attribute 'find'
TomAnks commented 2 months ago

@robbrad / @dp247 I raised a similar issue I was having with hacs_waste_collection_schedule and it was resolved (see here). Any chance this same fix is what needs to be implemented for UKBinCollectionData?

robbrad commented 2 months ago

@TomAnks - just raised a PR for @dp247 to approve

robbrad commented 2 months ago

@dp247 thank you buddy

@TomAnks can you test it works?

TomAnks commented 2 months ago

@robbrad / @dp247 We have bins! Thank you for your help.

image

However, my property also has 'Communal Food' and 'Communal Refuse' listed on the Haringey website which aren't showing up in HA. Any way to get those included? They are collected at different intervals to the other bins. I know the fix ignores those without a td.next-service element, but my communal food waste (for example) does have a last collection date listed.

image