2017-11-10, 01:00 AM
I know this is a bit outside the NextPVR realm, but I'm hoping some of you smart folks who are fluent in Kodi might be able to help me out.
I'm running Kodi 17.5 and found a neat little addon script which when triggered opens a small overly of a security camera and then closes it after a set period of time. The script works great, but it needs to be triggered from a JSON RPC API command to kodi from an external source. My security camera system has the capability of executing a command on motion detection and which works, but the only way I've found to trigger it is with a http command.
It works, but the drawback is it opens a browser session every time the VSR triggers it. So that led me down the path of looking for a cleaner solution which brought me to curl...
I've googled for hours and spent the better part of the last 2 evenings trying to get this to work to no avail. Here's the curl command I've come up with but it kicks an error. It's somewhere in the parameter string I think (note the id:null should be a 1). I've tried every conceivable combination of quotes, double quotes, no quotes, single quotes to no avail... for the life of me I can't figure it out.
I'm guessing it's something simple, but I'm to the point of admitting defeat. I'm way outside of my knowledge zone and I'm in desperate need of some help, anyone got any ideas? Just thinking out loud as I typing this, maybe I'm on the wrong track? I'm not married to curl, if ther's another way to reach the same goal I'm all ears!
I'm running Kodi 17.5 and found a neat little addon script which when triggered opens a small overly of a security camera and then closes it after a set period of time. The script works great, but it needs to be triggered from a JSON RPC API command to kodi from an external source. My security camera system has the capability of executing a command on motion detection and which works, but the only way I've found to trigger it is with a http command.
Code:
http://192.168.1.20:8081/jsonrpc?request={"jsonrpc":"2.0","method":"Addons.ExecuteAddon","params":{"addonid":"script.securitycam"},"id":"1"}}
It works, but the drawback is it opens a browser session every time the VSR triggers it. So that led me down the path of looking for a cleaner solution which brought me to curl...
I've googled for hours and spent the better part of the last 2 evenings trying to get this to work to no avail. Here's the curl command I've come up with but it kicks an error. It's somewhere in the parameter string I think (note the id:null should be a 1). I've tried every conceivable combination of quotes, double quotes, no quotes, single quotes to no avail... for the life of me I can't figure it out.
Code:
C:\PROGRA~1\curl\bin\curl.exe -s -H "Content-type: application/json" -d '{"jsonrpc":"2.0","method":"Addons.ExecuteAddon","params":{"addonid":"script.securitycam"},"id":1}}' http://192.168.1.20:8081/jsonrpc
Code:
{"error":{"code":-32700,"message":"Parse error."},"id":null,"jsonrpc":"2.0"}
I'm guessing it's something simple, but I'm to the point of admitting defeat. I'm way outside of my knowledge zone and I'm in desperate need of some help, anyone got any ideas? Just thinking out loud as I typing this, maybe I'm on the wrong track? I'm not married to curl, if ther's another way to reach the same goal I'm all ears!
NextPVR V6.1.5.231022 - Ubuntu 22.04 VM / 4 core / 8Gb memory
HDHR Prime X2 / HDFX-2 /Schedule Direct / 2X Pi4 + & 3X Pi3 LibreELEC Kodi clients
Server - TrueNAS/ SuperMicro MBD-X10SL7-F MB / Xeon E3-1246 / 32Gb Unbuffered ECC / 8 X 4TB RAIDZ2
HDHR Prime X2 / HDFX-2 /Schedule Direct / 2X Pi4 + & 3X Pi3 LibreELEC Kodi clients
Server - TrueNAS/ SuperMicro MBD-X10SL7-F MB / Xeon E3-1246 / 32Gb Unbuffered ECC / 8 X 4TB RAIDZ2