GithubHelp home page GithubHelp logo

pippyn / home-assistant-sensor-ophaalkalender Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 7.0 46 KB

DEPRECATED - This sensor is now integrated in Afvalbeheer

License: Apache License 2.0

Python 100.00%
deprecated hassio-integration home-assistant

home-assistant-sensor-ophaalkalender's People

Contributors

djm300 avatar jdewever avatar nudded avatar pippyn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

home-assistant-sensor-ophaalkalender's Issues

tuinafval gives unknown status

Hi ,

tuinafval results in uknown sensor status. All others work. However, also a minor issue is that PMD results in an other date output than the others. It also gives the weekday.

image

- platform: ophaalkalender resources: - restafval - tuinafval - papier - pmd postcode: xxxx streetname: xxxx streetnumber: x

Kind Regards,
Robin

wrong date for paper

I tried to configure it for my postal code 8650 and got a date for paper that's set to december (we're april now)
ophaalkalender restafval
Thursday, 16-04-2020
ophaalkalender papier
24-12-2020
ophaalkalender pmd
24-04-2020

unknown status

image
image

- platform: ophaalkalender
  resources:
    - GFT
    - Restafval
    - papier
    - pmd
    - grof huisvuil
    - Glas
    - Textiel
  postcode: xxxx
  streetname: xxxxxxxxxx
  streetnumber: xxx

Sensors give wrong Dates

As the date results of the api are sometimes not ordered, the component gives the first date in the list that > today.
test

it can be solved by adding waste_dict[fraction].sort() in the get_next_collection method.
sol

Connection error Ophaalkalender.be

So I have a test Hassio install where I try out new Home Assistant updates and custom components. I recently updated to HA 0.103.5 and installed the Ophaalkalendar component through HACS.
All works fine for my town/street.

So enter my actual Home Assistant install, this is still a Hasbian install - but also on HA 0.103.5. I manually install the custom component but I can't get it to work... always get:

Error occurred while fetching data: SSLError(MaxRetryError('HTTPSConnectionPool(host=\'www.ophaalkalender.be\', port=443): Max retries exceeded with url: /calendar/findstreets/?query=

Of course I first stopped/disabled the component in the Hassio install and also waited several hours to retry in Hasbian.
Opening the website of Ophaalkalender.be directly and entering my street there also just works.

Any tips?

possibility to show date prefixes as tomorrow, today, .. in dutch

As mentioned before.. LOVE the component, works like a charm !

Now I'm working on a home dashboard and it would be nice to be able to show the words like tomorrow, today, days of the week, .. in dutch..

Even if I set the UI (in user settings) to dutch it stays in english..

Thanks in advance !

time formatting & resource

Hi there,
great work ! thanks !
I did notice 2 issues:
The resource for "tuinafval" is actualy "groenafval" now, perhaps they changed it?
If i change the date formatting it only works for "grof aval".

# ophaalkalender - afvalkalender
  - platform: ophaalkalender
    resources:
      - restafval
      - tuinafval
      - groenafval
      - papier
      - pmd
      - grofafval
    postcode: 8310
    streetname: Astridlaan
    streetnumber: 111
    dateformat: '%d %b'
    #dateonly: 1

address not found

Hello,

i just started with Hassio (hassos 3.8 and Home Assistant 0.104.3) and i installed ophaalkalender 1.1.4 via HACS. When i try to set up the sensor in my configuration.yaml i get an "address not found" error in the logs.

2020-01-29 12:14:13 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for ophaalkalender 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-01-29 12:14:47 ERROR (SyncWorker_0) [custom_components.ophaalkalender.sensor] Address not found!

The address i'm using is zipcode 9450, Fonteinstraat 13. There is data when i enter this address on the website (https://www.ophaalkalender.be/Calendar).

I tried different formatting for the streetname (lowercase, uppercase, with or without
municipality name between brackets (as the site shows when you select the street name), but i still get this error...

Problem related with update to version 0.103.5?

Installed this at the last couple of days of 2019. Seemed to look great to make a new template around and throw away my own written script (yours looks way better written, great job!).

But now I get, on all my services from "Ophaalkalender" the same response... I'm not sure, but it seems this had started after I upgraded HA to 0.103.5?

Thank you in advance!
Update for sensor.ophaalkalender_restafval fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 281, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 461, in async_device_update await self.hass.async_add_executor_job(self.update) 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/ophaalkalender/sensor.py", line 196, in update self.data.update() File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 240, in wrapper result = method(*args, **kwargs) File "/config/custom_components/ophaalkalender/sensor.py", line 114, in update response = requests.get(url).json() File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 897, in json return complexjson.loads(self.text, **kwargs) File "/usr/local/lib/python3.7/site-packages/simplejson/__init__.py", line 525, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.7/site-packages/simplejson/decoder.py", line 370, in decode obj, end = self.raw_decode(s) File "/usr/local/lib/python3.7/site-packages/simplejson/decoder.py", line 400, in raw_decode return self.scan_once(s, idx=_w(s, idx).end()) simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

HA crash

When adding the following to configuration.yaml HA won't start any more

  • platform: ophaalkalender
    resources:
    - restafval
    - tuinafval
    - papier
    - pmd
    - grofafval
    postcode: 1111
    streetname: straatnaam
    streetnumber: 10

Any one else this issues? running latest version of HA and latest version of plugin

thanx

Integration 'ophaalkalender' not found

Hi,

Since v0.92 this is does not work anymore.
I'm currently running HA v0.93.1

Solution:
Create the following files in [homeassistant]/config/custom_components/ophaalkalender/ :
init.py => """Ophaalkalender component."""
manifest.json =>
{
"domain": "ophaalkalender",
"name": "ophaalkalender",
"documentation": "https://github.com/pippyn/Home-Assistant-Sensor-Ophaalkalender/blob/master/README.md",
"dependencies": [],
"codeowners": [],
"requirements": []
}

Check your config. It should not generate any issues.
Next restart HA and you should see these sensors:

      - sensor.ophaalkalender_restafval
      - sensor.ophaalkalender_papier
      - sensor.ophaalkalender_pmd

No 'glas' available

Hi,
is it possible to add 'glas'?
Probably not used everywhere, but where i live, there's a section 'glas' also.
image

(Yellow with white letters, almost impossible to read, but is says 'glas' )

Wrong date selected when json result from ophaalkalender is not sorted chronologically

Hello pippyn

For 1650 Beersel (at least today) the JSON result coming back from ophaalkalender.be is not sorted chronologically. This results in wrong value in next_collection_date and thus wrong date shown in Home assistant interface

I adapted the code to loop through the whole result and select smallest date >= today instead of breaking on first date found.

I am not very familiar with Github so attaching the fix here below. Maybe it can still be improved but it seems to do the trick for me...
Modification done in "get_next_collection" function

sensor.py.txt

Thanks for this very useful sensor!

Status unknown

sensor:

  • platform: ophaalkalender
    resources:
    • restafval
    • tuinafval
    • papier
    • pmd
    • grofafval
      postcode: '2100'
      streetname: 'schotensesteenweg'
      streetnumber: '160'

Could you look into this?

Rename titles (gft, tuinafval) key swapped

Hi pippyn,

Thank you for making this component and also making the effort to make one for Belgium.
After installing I noticed that the GFT/Tuinafval calendar was nog working so I looked into the sensor.py file and found that the key seems swapped:

changing <'tuinafval': 'gft'> to <'gft': 'tuinafval'> solved the issue for me. I don't know if this will change anything for the dutch version.

Thanks

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.