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.
Official

[APP] Synology Surveillance Station for Homey

145791013

Comments

  • aloftaloft Member
    To add to this, if I emulate webapi authentication in my browser

    http://192.168.89.2:<port>/webapi/auth.cgi?api=SYNO.API.Auth&method=Login&version=3&account=<username>&passwd=<password>;

    I get:

    {"data":{"sid":"djfadklsf"},"success":true}
    So webapi authentication in general seems to work.

  • aloftaloft Member
    I figured it out; Synology somehow blocked the IP address of Homey. Now it works like a charm. 

    @jorden Can you add the "Enable" and "Disable" methods as action cards?   My Synology does the motion detection on the camera, but I'd like Homey to control whether it should record. This can be done by enabling or disabling the camera. See: http://dotnet.work/2016/01/automate-your-synology-surveillancestation-with-some-simple-linux-commands/

    Thanks!
  • jordenjorden Member
    Nice that you figured it out yourself... was already looking through a part of the code regarding the port but didn't see anything weird in there.

    I'll add enable/disable to my todo list!
  • jordenjorden Member
    edited July 2016
    Version 1.2.0 is added to the app store for validation, and has enable/disable cam action cards.

    Update 17:22 It is approved and published now.
  • aloftaloft Member
    @jorden

    On both disable and enable action-card I get a red cross.  The 'start recording' and 'stop recording' do work. 

    Will it help if I run it via the CLI? Will it show any extra info?


  • jordenjorden Member
    @aloft Make sure you disable polling and then try to run it via the CLI. If possible, only run the disable or enable card; that way I should get just as little information as possible, since the app really outputs a LOT.

    If you can post the log lines (please doublecheck that there are no usernames and password in it, there shouldn't be but just to make sure) or email them to info@chamidmedia.nl I will probably see what is causing it.

    PS: Does it enable / disable the camera? It could also be that it works, but that the callback is wrong. I tried it on my own Synology and it did disable/enable correctly. You can see that by opening the Surveillance Center, and then go to the IP-camera button. Behind the name of your camera it will show 'Disabled' / 'Uitgeschakeld' or something similar once disabled.
  • jorden said:
    @aloft Make sure you disable polling and then try to run it via the CLI. If possible, only run the disable or enable card; that way I should get just as little information as possible, since the app really outputs a LOT.

    If you can post the log lines (please doublecheck that there are no usernames and password in it, there shouldn't be but just to make sure) or email them to info@chamidmedia.nl I will probably see what is causing it.

    PS: Does it enable / disable the camera? It could also be that it works, but that the callback is wrong. I tried it on my own Synology and it did disable/enable correctly. You can see that by opening the Surveillance Center, and then go to the IP-camera button. Behind the name of your camera it will show 'Disabled' / 'Uitgeschakeld' or something similar once disabled.
    So its possible that the Synology username and password is output in plain text in the log?  I hope not.
  • jordenjorden Member
    I did that while testing, to make sure it is remembered at the right position everywhere, but it should not show that right now.
  • aloftaloft Member
    @jorden ;

    I've sent you the logs, but I think it includes the polling, sorry about that. I've removed the plaintext login information, it still shows ("add device" "checking device").

    Here's the log without polling; probably the sequence of 'response end' is not correct, so if I interpret it correctly, it will give an '105' error when calling disable or enable. Looking at my camera in Synology, it doesn't Disable either. 

    When starting a recording via Homey, it reports success. 

    Error 105 is "105 Insufficient user privilege" accoring to the API manual. I am logging in with the admin account, so that is rather strange. I'll also check settings again on my side.

    CMD] Login called

    RESPONSE END "{\"data\":{\"sid\":\"bnSdROySomyvgA1GAN00343\"},\"success\":true}\n"

    [CMD] Disable called

    [CMD] Logout called

    RESPONSE END "{\"success\":true}\n"

    RESPONSE END "{\"error\":{\"code\":105},\"success\":false}"

    [CMD] Logout called

    RESPONSE END "{\"success\":true}\n"

    [CMD] Login called

    RESPONSE END "{\"data\":{\"sid\":\"msrzTQchJUkWcA1GAN00343\"},\"success\":true}\n"

    [CMD] Enable called

    [CMD] Logout called

    RESPONSE END "{\"success\":true}\n"

    RESPONSE END "{\"error\":{\"code\":105},\"success\":false}"

    [CMD] Logout called

    RESPONSE END "{\"success\":true}\n"


  • aloftaloft Member
    Didn't find any issue with the 'admin' account, via the Synology GUI , it will disable/enable cameras with that account.


  • jordenjorden Member
    edited July 2016
    Yeah it doesn't send the real command, or so it seems. Will work on that next week.

    Please be adviced that the Synology Surveillance station webcams will not work on 0.9.1. Will work on that too! Temporary workaround : Download from Github and edit app.json, change:
    "capabilities": [ "" ],
    to:
    "capabilities": [],

    Save and run athom project --install
  • @aloft Have created an update that is submitted to the app store, should fix your problems with the enable/disable cards. Should be available within a few days.
  • @jorden ;
    I have a Synology NVR with Surveillance station running on it, do I understand correct that when using your app that Homey can disable and enable camera's. (I only would like my indoor cams to work when not at home,) if so that would be super, and noo need for an I/O module... 

    thanks in advance 

    Robert
  • Robebar said:
    @jorden ;
    I have a Synology NVR with Surveillance station running on it, do I understand correct that when using your app that Homey can disable and enable camera's. (I only would like my indoor cams to work when not at home,) if so that would be super, and noo need for an I/O module... 

    thanks in advance 

    Robert
    Yes you can  disable a camera, but if youre doubting your privacy use a:

    https://www.bol.com/nl/p/fibaro-wall-switch-type-f-slimme-stekker/9200000046310667/?Referrer=ADVNLGOO002042-G-24146159669-S-170632313549-9200000046310667
  • @0burner0 ;
    yes that was also an option but one cam is an Foscam R2  with pan and tilt, and on power up this cam is pointing at the ceiling and I do not find how i can change its start position, 
  • Oke, had a look for you. It's is not posible to disable a camera but stop/start recording (to your nas).

    No PTZ function for this moment in homey. Maybe later when homey give full suport to webcams.
  • @Robebar what @0burner0 says is correct, you can not actually disable/enable the camera. You can only disable/enable the camera inside Surveillance Station.

    If the camera is also hooked up on another system, that will continue working even if you disable it through this app.
  • @jorden thanks.  thats ok for me for now, I only use Serveillance Station, I will Install  the  App and see if I get it working, thanks for now and your time in developing this.. much appreciated..
  • @jorden Just installed 1.2.2 and disabling/enabling the camera (inside Surveillance Station) works as designed. Thanks! 
  • VonkenboerVonkenboer Member
    edited August 2016
    @jorden Just tried your Synology App. Looks nice!

    But one major drawback regarding the App. If I'm right, you have to add an user with admin privileges which could be a huge security hazard! When compromised it has access to all user accounts on the Synology....

    Isn't there an other way to do this? Maybe you can add an option to your app to select an 'ordinary' user account with less functionality?

    Is this possible?
  • TallguyTallguy Member
    edited August 2016

    @jorden: I noticed people were asking for other Synology apps. You mentioned downloadstation. perhaps it would be a nice idea to use Homey as an interface between downloading something (emule, newsgroups, spotweb e.g.) by the NAS?

    Like "OK Homey, search <newsgroup/Emule/Torrent> for <movie/song>"

    Homey starts searching and returns something like 'OK Jorden, <movie/song> with title <xxxxx> found. Do you want me to download it for you?"

    if 'Yes' then Homey will instruct the NAS to get it and report back when download has completed.


    The only issue I see now is that the chances of multiple hits will be difficult to filter I guess.

  • I installed the app and then I get the screen with mailsettings.
    Mailsettings are ok. Mail received.
    But: then it stops, no possibility to give the characteristics (IP a.s.o) of my Synology. What am I doing wrong?
    Several deletes of the app and restarts done.
  • Did you try to add a device in Homey and choose Synology there?
  • obeliksobeliks Member
    edited August 2016
    After a restart of my Synology, now the screen is showing up (does it stop traffic??)  s... But, now it doesn't save my settings. Is it because I use https (and thus port 5001?) In my browser, my login works and the Surveillance Station, too...
  • Usually that means one of the following things:
    - The IP, username, port, or password are entered incorrectly.
    - The username, or IP of Homey might be blocked for trying too often

    I will try to come up with a new version soon that does better error reporting in the pairing screen, but am kinda busy at the moment :(
  • @jorden Just tried your Synology App. Looks nice!

    But one major drawback regarding the App. If I'm right, you have to add an user with admin privileges which could be a huge security hazard! When compromised it has access to all user accounts on the Synology....

    Isn't there an other way to do this? Maybe you can add an option to your app to select an 'ordinary' user account with less functionality?

    Is this possible?
    @jorden Can you please respond on this?

    I'm I right with my findings?

    Thanks in advance!
  • @Vonkenboer feel free to test it... I don't believe a normal user can access the API.

    But to be honest, I have been more concentrated on the code than the minimum required permissions.
  • I tried something similar on my Fibaro and I didn't need a admin account for DSM just a mamager account on Surveillance Station. 

    It's a while ago so I don't know how precisely I did it. If I'm remember it right you have to send a command, with the login credentials from an SS user, to get a key-string.

    If I have some spare time I'll look up what commands are used and will let you know.
  • If that is all, that means it's better than having a Synology admin account. I will test that when I got the time and then update the docs accordingly.
  • djeskodjesko Member
    edited August 2016
    Anyone having problem that app crash ?   have been working good for a long time now , im on .92 FW

    Stack trace:

    Error: Cannot find module 'mailcomposer'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/node_modules/nodemailer/lib/nodemailer.js:3:20)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)




Sign In or Register to comment.