Homematic sensors with Securityspy

roads
edited November 2016 in SecuritySpy
Hi,

is it possible to use the Homematic sensors together with Securityspy? For example only activate the cam if the Homematic motion detector finds something. This would eliminate most false notifications.

Thanks

Comments

  • It may be possible to do that in a work-around way - if Homematic can be set to run scripts, that script could then change Security Spy to put Actions to active so it would start sending alerts.
    (Have Security Spy set to have Motion active to record any movement, but the Actions that sends email only turned on when triggered by the motion sensor - to explain it another way)

    My German reading (even with Google translate) isn't good enough to quickly find it if HomeMatic supports this kind of function - it may require going through another system to take a trigger from HomeMatic to then activate the applescript to change the setting in Security Spy.

    It is an interesting idea I hadn't considered before... I may need to add a setup like this to my outdoor cameras next year so I don't get snow/rain/fog false alarm emails.
  • Yeah in my case it's cars reflector lights and once a spider that made its net around the Dahua. As it is right now is impossible to eliminate false triggers.
    Homematic can script on the CCU2. It has a mail plug-in. The range the system has its brutal. Two stories down and even outside and not a problem communicating over RF. The app you want to try is pocket control on iphone and ipad. They do a cloud thing cloudmatic but it costs and I'd like to keep it inside like I do with securityspy.
    What you need is the CCU2 and a IR sensor, that's all.
  • I read a bit into this and it is possible. The CCU1 had dropbear an ssh daemon that could start a script on amac directly. With the CCU2 the latest Homematic brain you need a raspberry that will do that. The Homematic activates the raspi and the raspi runs the script on the mac where Securityspy is installed.
    Here is the tutorial. I cant do it myself, will try to find someone who sets up the CCU2 annd the raspy. It does work, people do start stuff on their machines.
    So activating all cameras for 5-10 minutes by applescript if there is motion detected around the house should eliminate all false motion detections.
  • roads
    edited November 2016
    I have connection from the CCU2 to the Mac! I can run files via SSH without the ac asking for a password after generating a RSA key and known host!

    1.) Aktiviere SSH in Homematic CCU2 - Systemsteuerung - Sicherheit
    2.) Einloggen per ssh root@homematic-ccu2; Passwort aus Schritt 1
    3.) mount -o remount,rw /
    4.) ssh-keygen -t rsa (Pfad belassen, Kein Passwort angeben)
    5.) ssh macuser@mac mkdir -p .ssh
    6.) Enter macusers password
    7.) cat .ssh/id_rsa.pub | ssh macuser@mac 'cat >> .ssh/authorized_keys'
    8.) Enter macusers password
    9.) Ab jetzt kann man sich mit ssh macuser@mac ohne Angabe eines Passworts einloggen
    10.) mount -o remount,ro /
    11.) Befehle zB als ssh macuser@mac 'ls -l'
    12.) Per CUxD:
    dom.GetObject("CUxD.CUX2801001:1.CMD_QUERY_RET").State(1);
    dom.GetObject("CUxD.CUX2801001:1.CMD_SETS").State("ssh macuser@mac 'ls -l'");
    var v = dom.GetObject("CUxD.CUX2801001:1.CMD_RETS").State();
    WriteLine(v);

    on CCU2 ssh User@192.168.xx.xx 'open test.txt' opens the file on the Mac!

    Script on CCU2
    dom.GetObject("CUxD.CUX2801001:1.CMD_QUERY_RET").State(1);
    dom.GetObject("CUxD.CUX2801001:1.CMD_SETS").State("ssh User@192.168.x.xx 'open test.txt'");
    var v = dom.GetObject("CUxD.CUX2801001:1.CMD_RETS").State();
    WriteLine(v);

    So now I need help with an applescript. Needs to do some clever things with securityspy status and record some footage.
  • Checked the scripts for Securityspy and it would be best to immediatedly make a picture with the cam that is near the Homematic motion sensor and activate motion detection for 5 minutes on all cameras. What would a script like that look like?
  • Probably what you want is a simple AppleScript that triggers motion-detection recording in a particular camera or cameras. This script is simply the following:

    tell app "SecuritySpy"
    set motion camera number 0
    end tell

    Save this as a script file and use the following Terminal command to invoke it:

    osascript path/to/script.scpt

    You can obtain the camera number from the Camera Info window by adding this column (click on the column header to add/remove columns).

    You could modify the script to trigger more cameras (add more "set motion" lines), or trigger cameras for longer (add delay commands and more "set motion" lines).
  • I have it set up now and it works like a charm. I have 5 cameras outside and I had not a single false email tonight. Before I had 20-50 depending on the weather.