rudders / homebridge-http

HTTP Plugin for Homebridge
Apache License 2.0
178 stars 110 forks source link

can i use for motion sensor? #30

Closed toshibochan closed 7 years ago

toshibochan commented 8 years ago

i have foscam ip cameras and i can send motion ON and OFF on the web. how i can use your homebridge-http? this is the ON and OFF command. ON http://IPADDRESS:PORT/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig&isEnable=1&linkage=7&snapInterval=2&sensitivity=0&triggerInterval=0&schedule0=281474976710655&schedule1=281474976710655&schedule2=281474976710655&schedule3=281474976710655&schedule4=281474976710655&schedule5=281474976710655&schedule6=281474976710655&area0=2047&area1=2047&area2=2047&area3=2047&area4=2047&area5=2047&area6=2047&area7=2047&area7=2047&area8=2047&area9=2047&usr=USER&pwd=PASSWOARD

OFF http://IPADDRESS:PORT/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig&isEnable=0&linkage=7&snapInterval=2&sensitivity=0&triggerInterval=0&schedule0=281474976710655&schedule1=281474976710655&schedule2=281474976710655&schedule3=281474976710655&schedule4=281474976710655&schedule5=281474976710655&schedule6=281474976710655&area0=2047&area1=2047&area2=2047&area3=2047&area4=2047&area5=2047&area6=2047&area7=2047&area7=2047&area8=2047&area9=2047&usr=USER&pwd=PASSWOARD

thanks

NovaGL commented 8 years ago

Well you can't turn motion on and off for a motion service but you can have a switch which can do it, but it won't display as a motion sensor just a switch.

    "accessories": [ {
            "accessory": "Http",
                "name": "Motion Sensor",
                "http_method": "GET",
                                "service": "Switch",
                "on_url":      "http://IPADDRESS:PORT/cgi-bin/CGIProxy.fcgi",
                "off_url":     "http://IPADDRESS:PORT/cgi-bin/CGIProxy.fcgi"        

} 
toshibochan commented 8 years ago

i add to config.json and now homebridge not working. i need to install anything to http work on raspberry pi?

NovaGL commented 8 years ago

I had an error, there was meant to be a comma after the on_url fixed it. It's a bit of trial and error I suggest trying other http commands and look through the logs

toshibochan commented 8 years ago

you know any other homebridge use http plugin?

NovaGL commented 8 years ago

They all operate the same, so switching to another won't help

cybertza commented 7 years ago

the latest code with on body, and off body may cater for this. have you been able to get this to work as you wanted @toshibochan ?