Opening a Kodi Addon Through JSON Interface

For my home security system I wanted to be able to use my digital photo frame, running Kodi, to display a video feed of my front door whenever movement was detected.  To do this I needed my security system, Blue Iris, to send a JSON command to Kodi which would open a script to display the front door feed.

Displaying The Camera Feed

To display the camera feed I found a Kodi addon called Security Cam Overlay. This allowed me to put in my camera’s IP address and password and it would display the camera’s feed, in the corner of the Kodi window.

Getting Kodi To Open The Addon When Motion Is Detected

After some research, I found that Kodi could be asked to open addons via its JSON interface. The code to open the addon went as follows:

http://username:password@IP-address/jsonrpc?request={“jsonrpc”:”2.0″,”id”:1,”method”:”Addons.ExecuteAddon”,”params”:{“addonid”:”name-of-addon”}}

When this was sent to the Kodi box, the addon opened and displayed the camera feed.

The second part was to get the security system, powered by Blue Iris, to send the JSON command when motion was detected. Luckily Blue Iris has an option to request from a web server when motion is detected. I placed the JSON command above into the web server address and the whole process became automated. Blue Iris would detect motion and request from the web server. This executed the JSON command to open the camera overlay addon in kodi, which in turn would display a camera feed of the front door.

I selected the option to request from a web service when the camera was triggered.
I selected the option to request from a web service when the camera was triggered.
I then entered the JSON request as the server address and everything worked.

A Small Problem

After the system had been working for a few hours a problem started to emerge. To ensure that the front door camera captures all movement, it is quite sensitive to motion. This led to the camera stream being displayed on the photo frame every time a car came down the street. Ideally I would only like the camera stream to be displayed when there is actually someone at the front door. I intend to create some sort of Raspberry Pi powered doorbell to address this problem in the future.