hacs_waste_collection_schedule icon indicating copy to clipboard operation
hacs_waste_collection_schedule copied to clipboard

Entity could not be found

Open svenschedlbauer opened this issue 1 year ago • 10 comments

Hi, I don't know where I made the mistake, but I don't find the entity. I have added following lines with the correct address to the configuration.yaml, but the name "zakb_de" can not be found.

waste_collection_schedule:
    sources:
    - name: zakb_de
      args:
        ort: ORT
        strasse: STRAßE
        hnr: HAUSNUMMER
        hnr_zusatz: HAUSNUMMERZUSATZ

edit by @5ila5: fixed yaml fomatation

svenschedlbauer avatar Oct 05 '23 10:10 svenschedlbauer

"zakb_de" can not be found.

what do you mean with that exactly? can you please provide the error log or further explain what you mean by that. the yaml looks fine and the source seems to work on my side

5ila5 avatar Oct 05 '23 13:10 5ila5

Hi @5ila5 normally I should see something here, isn't it? image

svenschedlbauer avatar Oct 05 '23 13:10 svenschedlbauer

yes if you did not set a different calendar_title you should see your calendar entity.

Have you restarted homeassistant after modifying your configuration (quick reload does not work for this integration)?

Are there any logs indicating an error?

5ila5 avatar Oct 05 '23 13:10 5ila5

Yes, I have restarted HA 2 or 3 times in the meanwhile.

  • I have installed waste collection schedule, then restart
  • I have added the code to the configuration.yaml, then restart

svenschedlbauer avatar Oct 05 '23 13:10 svenschedlbauer

Are there any logs for waste_collection_schedule?

5ila5 avatar Oct 05 '23 13:10 5ila5

Im Log finde ich folgendes:

Logger: homeassistant.setup Source: custom_components/waste_collection_schedule/waste_collection_schedule/source/zakb_de.py:54 Integration: waste_collection_schedule (documentation) First occurred: 16:19:34 (1 occurrences) Last logged: 16:19:34

Error during setup of component waste_collection_schedule Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 288, in _async_setup_component result = await task ^^^^^^^^^^ File "/config/custom_components/waste_collection_schedule/init.py", line 109, in async_setup api.add_source_shell( File "/config/custom_components/waste_collection_schedule/init.py", line 202, in add_source_shell SourceShell.create( File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py", line 196, in create source = source_module.Source(**source_args) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source/zakb_de.py", line 54, in init self._hnr_zusatz: str = hnr_zusatz.replace(" ", "+") ^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'replace'

svenschedlbauer avatar Oct 05 '23 14:10 svenschedlbauer

looks like you don't use hnr_zustz. Not quite sure how the yaml parsing works for providing empty hnr_zusatz but it looks like it makes a NoneType out of it but it need to be a string. Either use hnr_zusatz: "" or just do not use hnr_zusatz at all just use:

waste_collection_schedule:
    sources:
    - name: zakb_de
      args:
        ort: ORT
        strasse: STRAßE
        hnr: HAUSNUMMER

5ila5 avatar Oct 06 '23 13:10 5ila5

I have changed it, but I still can't find it.... The log is now ok. He still shows me no entities... :-( image

svenschedlbauer avatar Oct 06 '23 14:10 svenschedlbauer

Did you configure any sensors? And if yes, what are there names? If they don't contain "zakb" in the name, you won't find any entity.

mampfes avatar Oct 06 '23 14:10 mampfes

For some addressees it doesn't seem to work from zakb.

For example I updated the test cases for the zakb_de.py

"Lautertal, Am Wingertsberg 41A": {
    "ort": "Lautertal",
    "strasse": "Wingertsberg",
    "hnr": "41",
    "hnr_zusatz": "A"
}

It doesnt seems to work when i run the tests.

❯ python3 custom_components/waste_collection_schedule/waste_collection_schedule/test/test_sources.py -s zakb_de
Testing source zakb_de ...
  found 84 entries for Abtsteinach, Am Hofböhl 1 
  found 83 entries for Gorxheimertal, Am Herrschaftswald 10
  found 83 entries for Rimbach, Ahornweg 1 B
  found 82 entries for Zwingenberg, Diefenbachstraße 57
  Lautertal, Am Wingertsberg 41A failed: Content line could not be parsed into parts: '<!DOCTYPE html>': <!DOCTYPE html>

jgmGit avatar Feb 06 '24 14:02 jgmGit