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.

Trashcan Reminder

245

Comments

  • JanHJanH Member
    @grazyfrog ok, tnx, I'll wait till monday for testing again
  • One of the apps i always wanted!  

    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!
  • @grazyfrog ;
    It's fixed now! Thanks!
    And the paper- and PMD-container was outside indeed, yesterday. :smile: 
     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. :smile: 

  • thayoung1 No source linked so manual work has to be done for this.
  • tim1990 said:
    One of the apps i always wanted!  

    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!
    Same trashguys here. Hope u can put them on the list.
  • Here we have Twente Milieu,.Can you put them on the list?
  • Would be nice if you can edit a personal schedule in homey. This is not working for a lot of people.
  • posthok said:
    Would be nice if you can edit a personal schedule in homey. This is not working for a lot of people.
    You could make a calendar yourself and use https://apps.athom.com/app/nl.netactive.homey.ical2voice
  • FreeFragsFreeFrags Member
    edited October 2016
    Almere doesnt seem to be working would be great if it gets added. It can be found on mijnAfvalWijzer though
  • FreeFrags said:
    Almere doesnt seem to be working would be great if it gets added. It can be found on mijnAfvalWijzer though
    Same here for Bergen Limburg can also be found on MijnAfvalWijzer.
  • RemcoHanninkRemcoHannink Member
    edited November 2016
    Hello,

    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:
    <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetContainerDatesResponse xmlns="http://www.meurs-software.nl/afval-ris"><GetContainerDatesResult><StatusCode>Ok</StatusCode><ContainerDatesList><ContainerDates><Code>00</Code><PickUpDateList><string>2016-01-06</string><string>2016-01-20</string><string>2016-02-03</string><string>2016-02-17</string><string>2016-03-02</string><string>2016-03-16</string><string>2016-03-30</string><string>2016-04-13</string><string>2016-04-30</string><string>2016-05-11</string><string>2016-05-25</string><string>2016-06-08</string><string>2016-06-22</string><string>2016-07-06</string><string>2016-07-20</string><string>2016-08-03</string><string>2016-08-17</string><string>2016-08-31</string><string>2016-09-14</string><string>2016-09-28</string><string>2016-10-12</string><string>2016-10-26</string><string>2016-11-09</string><string>2016-11-23</string><string>2016-12-07</string><string>2016-12-21</string></PickUpDateList></ContainerDates><ContainerDates><Code>11</Code><PickUpDateList><string>2016-01-13</string><string>2016-01-27</string><string>2016-02-10</string><string>2016-02-24</string><string>2016-03-09</string><string>2016-03-23</string><string>2016-04-06</string><string>2016-04-20</string><string>2016-05-04</string><string>2016-05-18</string><string>2016-06-01</string><string>2016-06-15</string><string>2016-06-29</string><string>2016-07-13</string><string>2016-07-27</string><string>2016-08-10</string><string>2016-08-24</string><string>2016-09-07</string><string>2016-09-21</string><string>2016-10-05</string><string>2016-10-19</string><string>2016-11-02</string><string>2016-11-16</string><string>2016-11-30</string><string>2016-12-14</string><string>2016-12-28</string></PickUpDateList></ContainerDates><ContainerDates><Code>22</Code><PickUpDateList><string>2016-01-25</string><string>2016-03-07</string><string>2016-04-18</string><string>2016-05-30</string><string>2016-07-11</string><string>2016-08-22</string><string>2016-10-03</string><string>2016-11-14</string><string>2016-12-24</string></PickUpDateList></ContainerDates></ContainerDatesList></GetContainerDatesResult></GetContainerDatesResponse></soap:Body></soap:Envelope>
    The needed JSON should look like:
    let dates = {
        REST: ['29-12-2016',
                     '01-12-2016',
                     '03-11-2016',
                     '06-10-2016',
                 '08-09-2016',
                     '11-08-2016'],
        GFT: [ '14-07-2016',
                     '16-06-2016',
                 '19-05-2016',
                 '21-04-2016',
                 '24-03-2016',
                 '25-02-2016',
                     '28-01-2016'] }
    Kind regards,

    Remco
  • I just added speech functionality and you are now able to add a schedule yourself.
    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 :)



  • @MrDutchfighter ;
    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

  • Hi 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


  • @MrDutchfighter...kudo's.. I will test the app
  • @MrDutchfighter ..Got my first notification.. seems to work fine  :)
  • RemcoHanninkRemcoHannink Member
    edited December 2016
    Hello,

    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
  • The trash API is called every 24 hours. So best is to take the current date - 2 weeks and current date +4 weeks or so to retrieve the data. If you look in my branch you can find some handy date features already known within the trash app
  • @MrDutchfighter ;

    I managed to add a start- and end date as you suggested:
    var startDate = new Date();
    startDate = dateFormat(startDate.setDate(startDate.getDate() - 14), "yyyy-mm-dd");
    console.log("startDate is: " + startDate);
    var endDate = new Date();
    endDate = dateFormat(endDate.setDate(endDate.getDate() + 30), "yyyy-mm-dd");
    console.log("endDate is: " + endDate);
    I now have a new trashapi.js with 2 more providers. Should I sent a Pull Request to your repository or to the repository of apstemmer ? I have tried to contact him about another app (Dru fireplace) but never got a response from him. I heard he is a former intern of Atom and has now left.
  • posthokposthok Member
    edited December 2016
     :) 
  • You can add it to my repository, then I will bundle it with my pull request and contact him again. I've already had contact with him earlier this week
  • @MrDutchfighter ,
    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:

    Hellendoorn
    Enschede
    Hengelo
    Oldenzaal
    Almelo
    Borne
    Losser
     
    How can i get the code to you? I have no experiences with a pull request. Can you help me with that?

    Gr. Remco

  • Maybe u can add some for midden nederland also?
  • 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}

  • RemcoHanninkRemcoHannink Member
    edited December 2016
    @FreeFrags:
    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?
  • If you made a fork of my branch you can go to the web interface (your own branch) and click "Pull request". Then follow the wizard.

    It can also be done via command line: https://help.github.com/articles/syncing-a-fork/


  • @Rocodamelshe:
    What part of midden Nederland did you have in mind and what app/api/trash calendar does your community use?
    http://inzamelschema.rmn.nl
    Zeist
  • @FreeFrags:
    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?
    Looking at recyclemanager.nl it covers almost the entire netherlands. 
    Adding this would be much appreciated!
Sign In or Register to comment.