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.

[Published] sabNZBd

swtttswttt Member
edited November 2016 in Apps

sabNZBd for Homey

Improvements and feature requests are welcome.
Published in the appstore: https://apps.athom.com/app/com.swttt.sabnzbd

If you like this app, please consider buying me a beer! :smile: 


With this app you can add your sabNZBd server as a device to Homey.

Examples:
  • When watching TV(iptv, streams, netflix etc.), pause your downloads
  • Only download during the night (or other timers)
  • Only download when nobody is home
  • If a new download is added say "A new download arrived on your server!" or do something else.
  • NEW: On download added you now can use the title tag. The title tag contains the movie title (ex. Lord of the strings ) or the tv show title, season and episode (ex. The bold and the beatifull season 1 episode 666).

Current features:
  • Pause and resume sabNZBd within flows
  • Log download speed in insights
  • Flow trigger based on new download added (NEW: Now with title label/token)
  • Edit settings and polling rate after the device is added
Know issues:
  • Adding a device takes a few seconds without any feedback (does gives errors on not able to connect)

Github version is out of sync with the app store!
https://github.com/swttt/com.swttt.sabnzbd

«1

Comments

  • Awesome! It would be cool if we can ask homey if something is downloading.. And a flow when something gets pushed to sab
  • swtttswttt Member
    Added to my list :) Will look into it.
  • Fire69Fire69 Member
    This is really great!! :-D

    Now we can use Couchpotato app to add a movie and then check sabnzb to see if it started downloading  :#
  • swtttswttt Member
    Would love some feedback if its working Ok on your installs.
    First time i coded in nodeJS, so i expected some bugs/errors at least...
  • PhuturistPhuturist Member
    edited June 2016
    I just tried adding my SABnzbd as device but after entering the details and hitting the save button it doesnt add the device. I do see debugger notice with the device object and it settings in the developer console but it doesnt seem to actual save the SABnzbd installation.

    [EDIT]
    Eventually the wizard times out with a message that it can not connect. And the request shows a failed in the network tab of the console. I'm pretty sure the details are correct as I copied them from CouchPotato that is using SABnzbd as download client. Could it be related that I use the option to redirect traffic to a https port?
  • swtttswttt Member
    Phuturist said:
    I just tried adding my SABnzbd as device but after entering the details and hitting the save button it doesnt add the device. I do see debugger notice with the device object and it settings in the developer console but it doesnt seem to actual save the SABnzbd installation.
    I takes a while for it to add. If it can't connect it trows back an error and doesn't closes the window, so the details your entered are correct.

    Just hit save and wait 5 seconds and it "should" pop up.
  • See the edit in my previous post.
  • swtttswttt Member
    edited June 2016
    Phuturist said:
    See the edit in my previous post.
    https could be the issue, as its hard coded to connect on the standard http port.
    The entered details make a request on http://YOURHOST:YOURPORT/api?apikey=YOURAPIKEY.

    I should add an option to enable/disable https on the settings, that should make it work.

    Anyway, thanks for the feedback. Just something i didn't think of cause i don't use the https option.
    Added an issue for myself on github, and will try to fix asap.

    It did close the window where you enter your details automatically? Cause when it fails to connect to the api, it shouldnt.
  • swttt said:
    Phuturist said:
    See the edit in my previous post.
    https could be the issue, as its hard coded to connect on the standard http port.
    The entered details make a request on http://YOURHOST:YOURPORT/api?apikey=YOURAPIKEY.

    I should add an option to enable/disable https on the settings, that should make it work.

    Anyway, thanks for the feedback. Just something i didn't think of cause i don't use the https option.
    Added an issue for myself on github, and will try to fix asap.
    Yup, tried on the default HTTP port and this allowed me to add my SABnzbd installation.
  • swtttswttt Member
    Phuturist said:
    swttt said:
    Phuturist said:
    See the edit in my previous post.
    https could be the issue, as its hard coded to connect on the standard http port.
    The entered details make a request on http://YOURHOST:YOURPORT/api?apikey=YOURAPIKEY.

    I should add an option to enable/disable https on the settings, that should make it work.

    Anyway, thanks for the feedback. Just something i didn't think of cause i don't use the https option.
    Added an issue for myself on github, and will try to fix asap.
    Yup, tried on the default HTTP port and this allowed me to add my SABnzbd installation.
    But the window where you add your details did close automatically? Cause when it fails to connect, it should trow an error within the window.
  • swttt said:
    Phuturist said:
    swttt said:
    Phuturist said:
    See the edit in my previous post.
    https could be the issue, as its hard coded to connect on the standard http port.
    The entered details make a request on http://YOURHOST:YOURPORT/api?apikey=YOURAPIKEY.

    I should add an option to enable/disable https on the settings, that should make it work.

    Anyway, thanks for the feedback. Just something i didn't think of cause i don't use the https option.
    Added an issue for myself on github, and will try to fix asap.
    Yup, tried on the default HTTP port and this allowed me to add my SABnzbd installation.
    But the window where you add your details did close automatically? Cause when it fails to connect, it should trow an error within the window.
    When trying with the HTTPS port it did not close but eventually showed me an error when the request timed out. When I used the HTTP port the pop up wizard closed itself when adding the device. I also tested Insights and the two action cards and everything seems to work as intended, nice job ... :+1: 
  • swtttswttt Member
    Phuturist said:
    swttt said:
    Phuturist said:
    swttt said:
    Phuturist said:
    See the edit in my previous post.
    https could be the issue, as its hard coded to connect on the standard http port.
    The entered details make a request on http://YOURHOST:YOURPORT/api?apikey=YOURAPIKEY.

    I should add an option to enable/disable https on the settings, that should make it work.

    Anyway, thanks for the feedback. Just something i didn't think of cause i don't use the https option.
    Added an issue for myself on github, and will try to fix asap.
    Yup, tried on the default HTTP port and this allowed me to add my SABnzbd installation.
    But the window where you add your details did close automatically? Cause when it fails to connect, it should trow an error within the window.
    When trying with the HTTPS port it did not close but eventually showed me an error when the request timed out. When I used the HTTP port the pop up wizard closed itself when adding the device. I also tested Insights and the two action cards and everything seems to work as intended, nice job ... :+1: 
    Thanks, so it is working as designed :smiley: 

    Just looked over my code on github, and will be able to fix https very easy. (Probably fixed tonight)
  • swtttswttt Member
    Phuturist said:
    swttt said:
    Phuturist said:
    swttt said:
    Phuturist said:
    See the edit in my previous post.
    https could be the issue, as its hard coded to connect on the standard http port.
    The entered details make a request on http://YOURHOST:YOURPORT/api?apikey=YOURAPIKEY.

    I should add an option to enable/disable https on the settings, that should make it work.

    Anyway, thanks for the feedback. Just something i didn't think of cause i don't use the https option.
    Added an issue for myself on github, and will try to fix asap.
    Yup, tried on the default HTTP port and this allowed me to add my SABnzbd installation.
    But the window where you add your details did close automatically? Cause when it fails to connect, it should trow an error within the window.
    When trying with the HTTPS port it did not close but eventually showed me an error when the request timed out. When I used the HTTP port the pop up wizard closed itself when adding the device. I also tested Insights and the two action cards and everything seems to work as intended, nice job ... :+1: 
    Just pushed a fix to github, do you mind to do some testing if this one works for you? (would be nice if you can test http and https again)
  • PhuturistPhuturist Member
    edited June 2016
    I tried adding it with the HTTPS option enabled while using my HTTPS port but was unable to add it. I received the following error:

    "Kon geen verbinding maken met sabNZBd. Check je connectie gegevens. Error: unable to verify the first certificate"

    I'm indeed running SABnzbd on HTTPS without a valid certificate so I can explain the error. As I run SABnzbd on my LAN it's not possible to add a certificate based on the IP address so I think it should ignore that there is no valid certificate.

    Adding it without HTTPS still works fine.

    [EDIT]
    I was able to crash the app. I restarted SABnzbd to change to make SABnzbd only available through HTTPS on the default port. When I went back to Homey the app has crashed with the following log.
    TypeError: Cannot read property 'urlprefix' of undefined
    at monitor (/drivers/sabnzbd/driver.js:126:25)
    at wrapper [as _onTimeout] (timers.js:275:11)
    at Timer.listOnTimeout (timers.js:92:15)
  • swtttswttt Member
    Phuturist said:
    I tried adding it with the HTTPS option enabled while using my HTTPS port but was unable to add it. I received the following error:

    "Kon geen verbinding maken met sabNZBd. Check je connectie gegevens. Error: unable to verify the first certificate"

    I'm indeed running SABnzbd on HTTPS without a valid certificate so I can explain the error. As I run SABnzbd on my LAN it's not possible to add a certificate based on the IP address so I think it should ignore that there is no valid certificate.

    Adding it without HTTPS still works fine.

    [EDIT]
    I was able to crash the app. I restarted SABnzbd to change to make SABnzbd only available through HTTPS on the default port. When I went back to Homey the app has crashed with the following log.
    TypeError: Cannot read property 'urlprefix' of undefined
    at monitor (/drivers/sabnzbd/driver.js:126:25)
    at wrapper [as _onTimeout] (timers.js:275:11)
    at Timer.listOnTimeout (timers.js:92:15)
    Thanks for the feedback (again :smiley: )
    I should be able to add a checkbox to disable/enbale certificate checks, thats no problem. Or just disable the checks in general. (You notice the certificate when you connect to sabnzbd trough your browser.)

    Regarding the crashlog, did the same thing yesterday, and didn't crash on me. So ill try to reproduce tonight.
  • swttt said:
    Thanks for the feedback (again :smiley: )
    I should be able to add a checkbox to disable/enbale certificate checks, thats no problem. Or just disable the checks in general. (You notice the certificate when you connect to sabnzbd trough your browser.)

    Regarding the crashlog, did the same thing yesterday, and didn't crash on me. So ill try to reproduce tonight.
    Yes, I see the not valid certificate warning in the browser as well. SABnzbd comes with a self signed certificate out of the box and I have not changed it to a valid one. Disabling the checking would be nice.
  • EvertorN said:
    Awesome! It would be cool if we can ask homey if something is downloading.. And a flow when something gets pushed to sab
    I noticed the todo list in the app store did not mention a feature for announcing when a download has started. This would be the best feature for SABnzbd if you ask me. Did you leave that away on purpose?
  • swtttswttt Member
    Phuturist said:
    EvertorN said:
    Awesome! It would be cool if we can ask homey if something is downloading.. And a flow when something gets pushed to sab
    I noticed the todo list in the app store did not mention a feature for announcing when a download has started. This would be the best feature for SABnzbd if you ask me. Did you leave that away on purpose?
    Updated the readme on github, but will change on the appstore after I published the update. In other words, github is actual and the appstore is commits behind.
  • I can't test this app atm. The router at my GF's place has a broken LAN, so I can't hook up my (wired) NAS. I am moving next week, so hopefully I can setup my NAS with SabNZB at the new place and test this app :-).
  • swtttswttt Member
    EvertorN said:
    I can't test this app atm. The router at my GF's place has a broken LAN, so I can't hook up my (wired) NAS. I am moving next week, so hopefully I can setup my NAS with SabNZB at the new place and test this app :-).
    Thanks, would be great to hear your feedback.
    Currently finishing some bug fixes, added a flow card (if download gets added) and made the settings edit-able after adding the device (including the polling rate).

  • swtttswttt Member
    Version 0.1.0 is currently awaiting approval in the app store.
  • Great stuff, just tested HTTPS, the polling frequency and the new trigger card for a announcing a download has started. All are working just fine. I do have a request for some time in the future, would it be possible to add the name of the download as a tag to the download trigger card so it can say what download has started (preferably with some parsing to strip the title from the release name ... :sunglasses: )
  • swtttswttt Member
    Phuturist said:
    Great stuff, just tested HTTPS, the polling frequency and the new trigger card for a announcing a download has started. All are working just fine. I do have a request for some time in the future, would it be possible to add the name of the download as a tag to the download trigger card so it can say what download has started (preferably with some parsing to strip the title from the release name ... :sunglasses: )
    Will look at that in the future.
    Currently pushed 0.1.1 to github and awaiting approval in the appstore.
    This fixes the issue with not saving the settings right.
  • swtttswttt Member
    edited June 2016
    Looked into using label on the download added card.
    It seems possible, but for a hobby developer like me to hard to figure out what the right way would be. (libraries or should i create a function...)
    So if someone has ideas, feel free to share them cold_sweat 

    I think the way it should work is like this:
    Interval runs and gets the job array/object from the api. It saves this as a device_data object. In the next interval it compares the current(new) jobs array/object to the one saved in device_data. Now this is the hard part (at least for me). I need checks both ways. I want to know if a download is finished (What was in the old array and isn't in the new one) and check if there are any new jobs added (what is in the new array and not in the old).

    Than the next problem (not sure yet if its a real problem). What if there are 3 new jobs added? I could run the flow trigger for all 3 of them, but do the flows wait until the previous is finished or do they try to run at the same time?
    (maybe @Emile could give some info on this one)
  • Fire69Fire69 Member
    The app crashes here. No HTTPS enabled.
    Anyone else having this?

  • swtttswttt Member
    edited June 2016
    Is an issue with the interval running even without devices added. Rewrote that part and is awaiting approval in the store. 

    You could of course run the github version. Github is 1 release ahead of the app store.
  • Fire69Fire69 Member
    I'm in no rush, I'll wait for the update  :)
  • swtttswttt Member
    Fire69 said:
    I'm in no rush, I'll wait for the update  :)
    Just approved and published in the appstore. Still one commit behind on github (insights logged in real mb/s, now it says mb/s but is kb/s) 

    I'll publish the latest github version as well.
    If there are no crashes etc. There won't be much features added the coming weeks, I just became a father. So long days, and short nights
  • swttt said:
    Fire69 said:
    I'm in no rush, I'll wait for the update  :)
    Just approved and published in the appstore. Still one commit behind on github (insights logged in real mb/s, now it says mb/s but is kb/s) 

    I'll publish the latest github version as well.
    If there are no crashes etc. There won't be much features added the coming weeks, I just became a father. So long days, and short nights
    Congratulations on becoming a father. Good luck the next few weeks (I speak out of experience).
  • Fire69Fire69 Member
    swttt said:
    Fire69 said:
    I'm in no rush, I'll wait for the update  :)
    Just approved and published in the appstore. Still one commit behind on github (insights logged in real mb/s, now it says mb/s but is kb/s) 

    I'll publish the latest github version as well.
    If there are no crashes etc. There won't be much features added the coming weeks, I just became a father. So long days, and short nights
    Congratulations!  Enjoy your time with the baby, that's way more important :smile: 
Sign In or Register to comment.