This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
Comments
http://inzamelschema.rmn.nl/
Thats our trashguy. Would'n't want to ask you to addd it but don't know how its done. maybe just write a simple TUT for it and we can alle add it!
It's fixed now! Thanks!
And the paper- and PMD-container was outside indeed, yesterday.
Even though Homey reminded us the whole evening to put the other one outside for today, but that was probably because I didn't configure the app yet.
I reversed engineered the afval app from our community (Hellendoorn) and I ended up with an XML file with all the dates inside. <Code>00 is REST, <Code>11 is GFT and <Code>22 is papier.
Now I am looking for a way to parse this XML file to the necessary JSON format. But I have no experience with this. Can anyone help me getting started? I found a XML2JSON parser but what do i do from there regular expressions or filters ?
The output from their web service (POST) is:
The needed JSON should look like:
Kind regards,
Remco
If someone wants to test it, the version can be found here: https://github.com/robertraaijmakers/com.athom.trashchecker
The pull request is submitted, so if the owner of the app accepts it and submits the new app to the store it will be available in general soon
Great work, what speech functionality did you add?
I will test it out and try to add our trash schedule with your additions.
I am working on adding our schedule (community Hellendoorn and twente) to the trashapi. I have a return XML with all the dates inside, but I haven't managed yet to convert it to the needed JSON format, any tips there ?
Gr. Remco
You can ask Homey four type of questions regarding your waste collection:
- When is the green container collected?
- What is collected next monday?
- Is the residual waste collected this friday?
- Which type of trash is collected next?
Regarding the reading of the XML you can go two ways. I think the easiest is to look for a library that helps you parse the XML format to a 'readable' JSON format: https://www.thepolyglotdeveloper.com/2015/01/parse-xml-response-nodejs/ and then retrieve the settings from the JSON format and push them to the gdates collection. I see that this post is from 2015, so maybe there are already some newer libraries available.Another way is to parse the string with regular expressions and indexOf, but think that is harder depending on the format.
no houten jet to bad
I am adding two afval calendars to this app: Community of Hellendoorn and twentemilieu.nl (Enschede, Hengelo and some others). They both have about the same API (one soap xml and one json). But both API's (hellendoornportal-srvc.2go-mobile.com and wasteapi.2-go.mobile.com) need a start- and end date to return pickup dates.
What do I do with these two parameters? Of course I can put them hardcoded on jan-dec 2017 Or do I check the current month an only get the dates for the current month.
How often and when is the trashapi called ?
Gr. Remco
I managed to add a start- and end date as you suggested:
I got the trashapis.js updated and installed the app on my Homey, everything seems to be working ok.
The following communities are now supported:
How can i get the code to you? I have no experiences with a pull request. Can you help me with that?
Gr. Remco
Please add support for recyclemanager.nl
Should be relatively easy it returns JSON:
https://vpn-wec-api.recyclemanager.nl/v2/calendars?postalcode=${postcode}&number=${housenumber}
I will take a look at this. If it returns JSON, it should me be more of the same. What cities/communities are covered by recyclemanager.nl ?
@Rocodamelshe:
What part of midden Nederland did you have in mind and what app/api/trash calendar does your community use?
It can also be done via command line: https://help.github.com/articles/syncing-a-fork/
Gr. Remco
Zeist
Adding this would be much appreciated!