Giter VIP home page Giter VIP logo

home_assistant_min_renovasjon's People

Contributors

eyesoft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

home_assistant_min_renovasjon's Issues

Repo not compliant

When I try to add this repo to HACS, I get:
<Plugin eyesoft/home_assistant_min_renovasjon> Repository structure for 2.2.0 is not compliant

Missing sensor

I have had this working for sometime, but now i am missing the restavfall sensor (fraction 1) . The sensor for paper (fraction 2 ) works and updates. I have not done any changes to the setup for the component.
I am running HA 116.2 and I am not sure when the problem came up. All the files for the component is up to date, and i do not find anything in the logs. So it is hard to see where to try to fix this

Error during setup of component min_renovasjon

This happended after updating to 0.118

`Logger: homeassistant.setup
Source: custom_components/min_renovasjon/init.py:181
First occurred: 10:14:29 AM (1 occurrences)
Last logged: 10:14:29 AM

Error during setup of component min_renovasjon
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 213, in _async_setup_component
result = await task
File "/config/custom_components/min_renovasjon/init.py", line 48, in async_setup
min_renovasjon = MinRenovasjon(street_name, street_code, house_no, county_id, date_format)
File "/config/custom_components/min_renovasjon/init.py", line 61, in init
self._kalender_list = self._get_calendar_list()
File "/config/custom_components/min_renovasjon/init.py", line 128, in _get_calendar_list
check_for_refresh = self._check_for_refresh_of_data(kalender_list)
File "/config/custom_components/min_renovasjon/init.py", line 181, in _check_for_refresh_of_data
if tommedato_forste.date() < date.today() or tommedato_neste.date() < date.today():
AttributeError: 'NoneType' object has no attribute 'date'`

Some renovation-sensors are missed/wanted

I preferred this integration before another, because this have comleted hacks-integration with gui-config.
Compared to earlier integration I now have lost sensors:

  • 'sensor.glass_metallemballasje'
  • 'sensor.plastemballasje'.

Could you please consider implement code for these renovation-types/sensors?

Warning of fail in 2023.3

WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that called async_setup_platforms instead of awaiting async_forward_entry_setups; this will fail in version 2023.3. Please report issue to the custom integration author for min_renovasjon using this method at custom_components/min_renovasjon/init.py, line 73: hass.config_entries.async_setup_platforms(config_entry, ["sensor"])

Breaks in latest HA version

This integration does not work with latest HA version
image

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:507
Integration: Sensor (documentation, issues)
First occurred: 07:53:17 (1 occurrences)
Last logged: 07:53:17

Error adding entities for domain sensor with platform min_renovasjon
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1022, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/min_renovasjon/sensor.py", line 117, in async_added_to_hass
    await self.async_update()
  File "/config/custom_components/min_renovasjon/sensor.py", line 99, in async_update
    fraction = await self._min_renovasjon.get_calender_for_fraction(self._fraction_id)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/min_renovasjon/__init__.py", line 200, in get_calender_for_fraction
    for entry in calendar_list:
TypeError: 'NoneType' object is not iterable

404 errors related to images/icons?

I'm getting errors like GET https://<my-HA-url>/local/min_renovasjon/1.png 404, and the icons for the entities seem to be missing. Are these pictures missing from the repo, or should they have been fetched when the addon was installed?

401 error

Getting a 401 error during setup of component min_renovasjon

Log:
2020-02-14 15:19:49 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for min_renovasjon which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant. 2020-02-14 15:19:50 ERROR (MainThread) [custom_components.min_renovasjon] 401 2020-02-14 15:19:50 ERROR (MainThread) [custom_components.min_renovasjon] 401 2020-02-14 15:19:50 ERROR (MainThread) [homeassistant.setup] Error during setup of component min_renovasjon Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 170, in _async_setup_component hass, processed_config File "/config/custom_components/min_renovasjon/__init__.py", line 48, in async_setup min_renovasjon = MinRenovasjon(street_name, street_code, house_no, county_id, date_format) File "/config/custom_components/min_renovasjon/__init__.py", line 61, in __init__ self._kalender_list = self._get_calendar_list() File "/config/custom_components/min_renovasjon/__init__.py", line 121, in _get_calendar_list kalender_list = self._parse_calendar_list(tommekalender, fraksjoner) File "/config/custom_components/min_renovasjon/__init__.py", line 137, in _parse_calendar_list tommekalender_json = json.loads(tommekalender) File "/usr/local/lib/python3.7/json/__init__.py", line 341, in loads raise TypeError(f'the JSON object must be str, bytes or bytearray, ' TypeError: the JSON object must be str, bytes or bytearray, not NoneType

Missing Icons in dashboard view

For some reason the icons are not being displayed in the cards even though icons is activated in the card. I had to manually download the icons from the renovation portal and store them locally. Is this the way it is supposed to work or am I missing some configuration?

Component fails to load when single date is retured from api

Great component. Thanks.

init.py line 135: tommedato_forste, tommedato_neste = calender_entry['Tommedatoer']
...fails when there is only one item in array. FraksjonId = 4 below...

Tommekalender: [{"FraksjonId":2,"Tommedatoer":["2019-08-09T00:00:00","2019-09-06T00:00:00"]},{"FraksjonId":7,"Tommedatoer":["2019-08-09T00:00:00","2019-09-06T00:00:00"]},{"FraksjonId":3,"Tommedatoer":["2019-08-12T00:00:00","2019-08-26T00:00:00"]},{"FraksjonId":1,"Tommedatoer":["2019-08-19T00:00:00","2019-09-02T00:00:00"]},{"FraksjonId":4,"Tommedatoer":["2019-09-23T00:00:00"]}]

Missing entity - sensor.mat_restavfall

Hi,

Since of lately the sensor.mat_restavfall is no longer provided by the integration. The other sensors work as before.
I live in Bærum, Norway.

Do you have any solutions? Tweaks?

Thanks
J

Component will not work after updating to Home Assistant 2021.4

Error message from Home Assistant

Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for min_renovasjon doing I/O at custom_components/min_renovasjon/init.py, line 83: response = requests.get(url, headers=header)

Error while setting up platform min_renovasjon

Is this component working? This would be awesome to implement in HA!
I've got the streetcode from vegvesen.no (just the numbers) and county_id from kommunenummer. I'm on HA version 0.91.2 and get the following error:

Error while setting up platform min_renovasjon
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/min_renovasjon/sensor.py", line 20, in setup_platform
    min_renovasjon = hass.data[DATA_MIN_RENOVASJON]
KeyError: 'data_min_renovasjon'

Sensors frequently unavailable

Since the last update I've experienced frequent "outages" where the sensors are in status unavailable and the debug log shows this:

2023-02-25 23:59:22.010 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up min_renovasjon platform for sensor
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1154, in _create_direct_connection
hosts = await asyncio.shield(host_resolved)
File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 880, in _resolve_host
addrs = await self._resolver.resolve(host, port, family=self._family)
File "/usr/local/lib/python3.10/site-packages/aiohttp/resolver.py", line 33, in resolve
infos = await self._loop.getaddrinfo(
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 860, in getaddrinfo
return await self.run_in_executor(
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.10/socket.py", line 955, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Try again

A full reboot of HA often solves the problem but that's annoying... :|

Any idea? :-)

Min renovasjon not working

Suddenly this custom component stopped working.
I run Home assistant in docker on an ubuntu server. I am running Home assistant 0.112.5.
Here is the error message I get in the log:

Logger: homeassistant.util.async_
Source: util/async_.py:120
First occurred: 12:39:44 (2 occurrences)
Last logged: 12:39:44

Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for min_renovasjon doing I/O at custom_components/min_renovasjon/init.py, line 83: response = requests.get(url, headers=header)
Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for min_renovasjon doing I/O at custom_components/min_renovasjon/init.py, line 95: response = requests.get(url, headers=header)

and

Error during setup of component min_renovasjon
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 193, in _async_setup_component
result = await asyncio.wait_for(task, SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
return fut.result()
File "/config/custom_components/min_renovasjon/init.py", line 48, in async_setup
min_renovasjon = MinRenovasjon(street_name, street_code, house_no, county_id, date_format)
File "/config/custom_components/min_renovasjon/init.py", line 61, in init
self._kalender_list = self._get_calendar_list()
File "/config/custom_components/min_renovasjon/init.py", line 125, in _get_calendar_list
check_for_refresh = self._check_for_refresh_of_data(kalender_list)
File "/config/custom_components/min_renovasjon/init.py", line 170, in _check_for_refresh_of_data
if tommedato_forste.date() < date.today() or tommedato_neste.date() < date.today():
AttributeError: 'NoneType' object has no attribute 'date'

Glass and metal sensor is unavailable, causing timeout and deep recursion error

I'm using HACS version of min_renovasjon, version 2.1.0 and I'm getting this error when trying to start up:

This happens for municipal Tønsberg (3803). I can provide you with the exact address in PM if it actually matters for debugging.

I've got the following sensors (fractions) available and working (except for the one mentioned below):

  • 1 # Restavfall
  • 2 # Papir
  • 3 # Matavfall
  • 4 # Glass/Metallemballasje (this one is non-working)
  • 7 # Plastemballasje

This sequence goes over and over again in very rapid succession (several per second, probably hammering the API):

2022-10-23 20:08:12.558 DEBUG (MainThread) [custom_components.min_renovasjon] Data needs refresh
2022-10-23 20:08:12.558 DEBUG (MainThread) [custom_components.min_renovasjon] _get_tommekalender_from_web_api
2022-10-23 20:08:12.595 DEBUG (MainThread) [custom_components.min_renovasjon] _get_fraksjoner_from_web_api

Until finally I get this stack trace:

2022-10-23 20:08:12.636 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform min_renovasjon
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 691, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 776, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/min_renovasjon/sensor.py", line 117, in async_added_to_hass
    await self.async_update()
  File "/config/custom_components/min_renovasjon/sensor.py", line 99, in async_update
    fraction = await self._min_renovasjon.get_calender_for_fraction(self._fraction_id)
  File "/config/custom_components/min_renovasjon/__init__.py", line 203, in get_calender_for_fraction
    entry = await self.get_calender_for_fraction(fraksjon_id)
  File "/config/custom_components/min_renovasjon/__init__.py", line 203, in get_calender_for_fraction
    entry = await self.get_calender_for_fraction(fraksjon_id)
  File "/config/custom_components/min_renovasjon/__init__.py", line 203, in get_calender_for_fraction
    entry = await self.get_calender_for_fraction(fraksjon_id)
  [Previous line repeated 959 more times]
  File "/config/custom_components/min_renovasjon/__init__.py", line 193, in get_calender_for_fraction
    calendar_list = await self.get_calendar_list()
  File "/config/custom_components/min_renovasjon/__init__.py", line 224, in get_calendar_list
    kalender_list = await self.get_calendar_list(refresh=True)
  File "/config/custom_components/min_renovasjon/__init__.py", line 211, in get_calendar_list
    tommekalender, fraksjoner = await self._get_from_web_api()
  File "/config/custom_components/min_renovasjon/__init__.py", line 131, in _get_from_web_api
    tommekalender = await self._get_tommekalender_from_web_api()
  File "/config/custom_components/min_renovasjon/__init__.py", line 105, in _get_tommekalender_from_web_api
    async with session.get(url) as resp:
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 1138, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 535, in _request
    conn = await self._connector.connect(
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 542, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 907, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore[return-value]  # noqa
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1089, in create_connection
    transport, protocol = await self._create_connection_transport(
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1111, in _create_connection_transport
    transport = self._make_ssl_transport(
  File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 73, in _make_ssl_transport
    _SelectorSocketTransport(self, rawsock, ssl_protocol,
  File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 772, in __init__
    base_events._set_nodelay(self._sock)
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 196, in _set_nodelay
    if (sock.family in {socket.AF_INET, socket.AF_INET6} and
  File "/usr/local/lib/python3.10/socket.py", line 518, in family
    return _intenum_converter(super().family, AddressFamily)
  File "/usr/local/lib/python3.10/socket.py", line 105, in _intenum_converter
    return enum_klass(value)
  File "/usr/local/lib/python3.10/enum.py", line 385, in __call__
    return cls.__new__(cls, value)
  File "/usr/local/lib/python3.10/enum.py", line 688, in __new__
    return cls._value2member_map_[value]
RecursionError: maximum recursion depth exceeded while calling a Python object

Still error when connecting to komteksky.norkart.no whatever I do

Re issue 19, I've completely removed and reinstalled "Min Renovasjon" and whatever I do this error appear when turning on debugging:

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 293, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/min_renovasjon/sensor.py", line 33, in async_setup_entry
calendar_list = await min_renovasjon.get_calendar_list()
File "/config/custom_components/min_renovasjon/init.py", line 216, in get_calendar_list
tommekalender, fraksjoner = await self._get_from_web_api()
File "/config/custom_components/min_renovasjon/init.py", line 134, in _get_from_web_api
tommekalender = await self._get_tommekalender_from_web_api()
File "/config/custom_components/min_renovasjon/init.py", line 108, in _get_tommekalender_from_web_api
async with session.get(url) as resp:
File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 1141, in aenter
self._resp = await self._coro
File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 536, in _request
conn = await self._connector.connect(
File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 540, in connect
proto = await self._create_connection(req, traces, timeout)
File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 901, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1166, in _create_direct_connection
raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host komteksky.norkart.no:443 ssl:default [Try again]
2023-03-19 10:29:48.422 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Min Renovasjon for sensor
Traceback (most recent call last):

Any possibilities for more debugging info?

I might test with Postman if I can get a cURL-snippet or similar :)

Loop issues

Hi.

Just found this component online and would really love to implement it. Seem to have an issue starting it though, and the sensor is not populating.

Any insights?

//Ulf Thomas

2020-10-06 19:54:25 WARNING (MainThread) [homeassistant.util.async_] Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for min_renovasjon doing I/O at custom_components/min_renovasjon/__init__.py, line 83: response = requests.get(url, headers=header)
2020-10-06 19:54:25 WARNING (MainThread) [homeassistant.util.async_] Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for min_renovasjon doing I/O at custom_components/min_renovasjon/__init__.py, line 95: response = requests.get(url, headers=header)
2020-10-06 19:54:25 INFO (MainThread) [custom_components.min_renovasjon] Returning calendar list
2020-10-06 19:54:25 INFO (MainThread) [homeassistant.setup] Setup of domain min_renovasjon took 0.1 seconds

Municipality not included

Hi,
I'm wondering if the Kristiansand municipality will be included? or is it just my zip code that doesn't work? 4639 :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.