This is how i show a pop-up of my camera on Kodi:
Step 1
Install the Surveillance Room add-on from here by downloading the zip.
There are also instructions on this page on how to set it up. (it also shows remote commands you can use and it gives an example on how to bind the camera view to one of your remote’s buttons.
Step 2
This is what i did to be able to call a live preview from Home Assistant.
Make sure you have the webserver in Kodi enabled.
On my rpi 2 which is running Home Assitant i installed xbmc-eventclients with:
sudo apt-get install xbmc-eventclients-xbmc-send
Now you should be able by using the command line to show a preview of your camera on Kodi with this command:
ssh kodi_username@kodi_ip_address 'xbmc-send -a "XBMC.RunPlugin(plugin://plugin.video.surveillanceroom?action=show_preview&camera_number=1)"'
When you used the right username and ip adress as set in the Kodi webserver part you should see your camera being displayed for a few seconds. Or if you have setup an password on Kodi it wil asks for your password before sending the command. I have a password setup so i did have to do step 3.
Step 3
There might be easier ways to send the command to kodi then by ssh into Kodi but i didn’t managed to get it to work.
So to go around the password prompt i logged in to the venv where my home assistant installation is and i did run the following commands which makes home assitant doesn’t need a password when sending the command:
ssh-keygen
ssh-copy-id [email protected]
In the command above i entered the username and ipaddress of the Kodi installation.
Step 4
When using the command below in the shell_command it gives me a yaml error. I think because of all the ‘’’’
So i created a text file with the command in it and called that from the shell_command in Home Assistant.
ssh kodi_username@kodi_ip_address 'xbmc-send -a "XBMC.RunPlugin(plugin://plugin.video.surveillanceroom?action=show_preview&camera_number=1)"'
config.yaml:
shell_command:
show_cam: 'sh /home/pi/textcommands/cam.txt'
So now you can trigger this command on motion or your doorbell or whatever you want .
When i the command one it won’t always trigger so i send the command two times with one sec delay so it is always triggered.
For Foscam camera’s is more support built in, but i don’t have one so i couldn’t test any of these features.