It seems like they have changed the token, again.
Next step is to add the token as a parameter so we can easily copy/paste it.
EDIT: token is added as a parameter and working for me.
Question: I would like to show the status in the item if there is no waste collection found.
Would that be OK?
Something like No token found, empty token, Nothing found, …
Compiled it for OH2.5 and OH3.1 and pushed it all to Github. Please check the README for the changes. I played around with the number of days and changing the token, it worked for me. But perhaps I missed some scenario’s.
Current token fetched from the website via developer tools is Crgja3EGWe8jdapyr4EEoMBgZACYYjRRcRpaMQrLDW9HJBvmgkfGQyYqLgeXPavAGvnJqkV87PBB2b8zx43q46sUgzqio4yRZbABhtKeagkVKypTEDjKfPgGycjLyJTtLHYpzwJgp4YmmCuJZN9ZmJY8CGEoFs8MKfdJpU9RjkEVfngmmk2LYD4QzFegLNKUbcCeAdEW
I found out that the x-secret is stored in the main.js file.
Line 5405.
var n=“Crgja3EGWe8jdapyr4EEoMBgZACYYjRRcRpaMQrLDW9HJBvmgkfGQyYqLgeXPavAGvn
JqkV87PBB2b8zx43q46sUgzqio4yRZbABhtKeagkVKypTEDjKfPgGycjLyJTtLHYpzwJgp4YmmCuJZN9ZmJY8CGEoFs8MKfdJpU9RjkEVfngmmk2LYD4QzFegLNKUbcCeAdEW”
Great to hear it helps others
Regarding your suggestions:
I need to check the API
It was built for personal use and I just want to show it as a text item. First feedback was to change format a bit. I will see if I can put it in a JSON and put it in another channel.
Thanks to your binding i was able to handle the requests with some http requests and put everything into Rule DSL where I can handle the returned JSON data.
Maybe an addon? Today I’m using an own google Calendar where I copy this kind of data in. The end result is an image on my dashboard. I’ve created icons for most possible pickups. It’s done by a rule now, but maybe it can be added as an item state? Would be much easier.
The job runs every 12 hours by default, just to avoid being flagged as scraper. You can decrease it to 2 hours.
Mine is still showing data so it seems to be working. But if I remember correctly, the very first time nothing is shown. Then you have to wait 12 hours (or less).
I have never played around with images as an item state. It has been over 6 months since I touched this binding. No promises but if I’m getting bored I might play with this.
Just in case, do you mind sharing your icons/images?
For the moment, no updates from the binding.
I’ll try to play later on with postal code. When I enter it on the site, I’m getting a dropdown since several choices for our postal. Maybe it’s not enough for just a postal code?
Here is my latest set of waste icons.
For my garbage pickup calendar, I really only use the ‘rest’ and the ‘all’. In our street, one week is ‘Rest’, and the other week it’s ‘rest-pmd-paper’. The other icons are because I want to start to keep track on all our waste. So I’m building a scale to weight the waste , and inserts these values automaticlly.
Where I live, we have 3 cities for 1 postal code. So that should cover it.
You can always send me your address privately so I can test it. Perhaps there’s still a bug in my binding.
The token is still the same as last year, you can find it higher in this thread. The one you show is the access token the site will give the app to do the communication. We need to save the one marked as x-secret
Nice set of icons. Need to see if I can include that, no promises
log/events.log.12:2022-02-04 17:14:38.581 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'afvalOphaling' changed from NULL to Nothing to show...
log/events.log.13:2022-02-05 01:16:43.281 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'afvalOphaling' changed from Nothing to show... to (2022-02-11)Restafval***PMD***Papier-karton
So your binding is working perfectly!
I’ve moved from my current situation, to your binding.
I’ve inserted the 2 main values into an seperate item. So they can be used in fe widgets. This is my end result (so far):
rule "Converteer afvalophaling"
when
Item afvalOphaling changed
then
val strAfvalVolgend = afvalOphaling.state.toString.split('\\(2').get(1)
val strAfvalDatum ="2" + strAfvalVolgend.split('\\)').get(0)
val afvalType =strAfvalVolgend.split('\\)').get(1)
afvalOphalingDate.postUpdate(strAfvalDatum)
if (afvalType == "Restafval") afvalOphalingImg.postUpdate("/static/afvalRE.png")
if (afvalType == "PMD") afvalOphalingImg.postUpdate("/static/afvalPM.png")
if (afvalType == "Papier-karton") afvalOphalingImg.postUpdate("/static/afvalPK.png")
if (afvalType == "Restafval***PMD***Papier-karton") afvalOphalingImg.postUpdate("/static/afvalAL.png")
end
Hi Pat, I’m not aware that there is a new token. Mine is still working fine.
Token starts with Crgja3EGWe in my configuration. I can send you the token via PM, if you want.
I am also using the same token as in jelmer1 post from march 21 higher up.
The RecycleappBelgium Binding Thing is online, but the channel give me the same error:
I use openHAB 3.3.0 in a docker container on a synology NAS.
I do not see strange loggings execpt one line when restarting the OH3 container
[INFO ] [um.internal.RecycleappBelgiumHandler] - Start fetching next waste collection…
Looking into the code. Could you set debuglevel to debug?
Then some more info is saved. But I also see that I can improve logging on debug level.
Perhaps time to upgrade to OH3.3 and add some extra logging. MIght take some time though…