Page 1 of 1

Execute script.securitycam no longer working (lua)

Posted: Tuesday 13 December 2016 12:41
by cherowley
Hi!

Since the last few betas the following command in my lua script no longer seems to work:

-- show cctv on other kodi devices
if otherdevices['Lounge (Kodi)'] ~= "Off" then commandArray['Lounge (Kodi)']='Execute script.securitycam' end
if otherdevices['Bedroom (Kodi)'] ~= "Off" then commandArray['Bedroom (Kodi)']='Execute script.securitycam' end
if otherdevices['Study (Kodi)'] ~= "Off" then commandArray['Study (Kodi)']='Execute script.securitycam' end


The script is ran but does not show any errors in the log and the kodi boxes do not popup the cctv. Nothing has changed besides the domoticz version...

Anyone else having a similar problem?

Last working Version: 3.5877

Cheers!

Re: Execute script.securitycam no longer working (lua)

Posted: Tuesday 13 December 2016 13:36
by Dnpwwo
Nothing has been changed in the plugin as far as I know.

Can you switch the device into debug mode by changing the port number to -9090 in the hardware page and post the output?

Re: Execute script.securitycam no longer working (lua)

Posted: Tuesday 13 December 2016 13:50
by cherowley
hi, thanks for the quick response :)

I changed the port to -9090 for the study kodi instance in the hardware tab and triggered the script:

2016-12-13 12:42:25.331 Kodi: (Study (Kodi)) Connect to '192.168.2.110:9090' failed: (111) Connection refused

2016-12-13 12:42:26.333 Kodi: (Study (Kodi)) Connect to '192.168.2.110:9090' failed: (111) Connection refused

2016-12-13 12:42:26.934 User: Admin initiated a switch command (298/Front Door PIR/On)

2016-12-13 12:42:26.992 LUA: Front Door PIR alert..

2016-12-13 12:42:26.992 EventSystem: Fetching url...

2016-12-13 12:42:26.992 EventSystem: Script event triggered: Front Door PIR

2016-12-13 12:42:26.935 (Virtual) Light/Switch (Front Door PIR)

2016-12-13 12:42:27.334 Kodi: (Study (Kodi)) Connect to '192.168.2.110:9090' failed: (111) Connection refused

2016-12-13 12:42:28.336 Kodi: (Study (Kodi)) Connect to '192.168.2.110:9090' failed: (111) Connection refused

2016-12-13 12:42:28.936 (Virtual) Light/Switch (Front Door PIR)

2016-12-13 12:42:30.339 Kodi: (Study (Kodi)) Connect to '192.168.2.110:9090' failed: (111) Connection refused

2016-12-13 12:42:31.341 Kodi: (Study (Kodi)) Connect to '192.168.2.110:9090' failed: (111) Connection refused

2016-12-13 12:42:32.342 Kodi: (Study (Kodi)) Connect to '192.168.2.110:9090' failed: (111) Connection refused

Re: Execute script.securitycam no longer working (lua)

Posted: Tuesday 13 December 2016 13:59
by Dnpwwo
Looks like the connection to your Kodi isn't working at all anymore (it is refusing connections)

Has the IP address changed? Have you upgraded your Kodi recently? Have you tried turning it off and on again?

Re: Execute script.securitycam no longer working (lua)

Posted: Tuesday 13 December 2016 14:08
by cherowley
Woops! Me being dumb! I forgot to reload kodi (this instance is running on windows, the others libreelec).

Sorry, here's the output with kodi actually running lol:

6-12-13 13:05:16.351 Kodi: (Study (Kodi)) Connected to '192.168.2.110:9090'.
2016-12-13 13:05:16.353 Kodi: (Study (Kodi)) Event: 'On'.
2016-12-13 13:05:16.418 Kodi: (Study (Kodi)) Sending data: '{"jsonrpc":"2.0","method":"System.GetProperties","params":{"properties":["canhibernate","cansuspend","canshutdown"]},"id":1007}'
2016-12-13 13:05:16.426 Kodi: (Study (Kodi)) Handling message: '{"id":1007,"jsonrpc":"2.0","result":{"canhibernate":true,"canshutdown":true,"cansuspend":true}}'.
2016-12-13 13:05:16.426 Kodi: (Study (Kodi)) Sending data: '{"jsonrpc":"2.0","method":"Player.GetActivePlayers","id":1005}'
2016-12-13 13:05:16.433 Kodi: (Study (Kodi)) Handling message: '{"id":1005,"jsonrpc":"2.0","result":[]}'.
2016-12-13 13:05:17.419 Kodi: (Study (Kodi)) Sending data: '{"jsonrpc":"2.0","method":"JSONRPC.Ping","id":1001}'
2016-12-13 13:05:17.420 Kodi: (Study (Kodi)) Handling message: '{"id":1001,"jsonrpc":"2.0","result":"pong"}'.
2016-12-13 13:05:27.420 Kodi: (Study (Kodi)) Sending data: '{"jsonrpc":"2.0","method":"JSONRPC.Ping","id":1001}'
2016-12-13 13:05:27.422 Kodi: (Study (Kodi)) Handling message: '{"id":1001,"jsonrpc":"2.0","result":"pong"}'.
2016-12-13 13:05:37.422 Kodi: (Study (Kodi)) Sending data: '{"jsonrpc":"2.0","method":"JSONRPC.Ping","id":1001}'
2016-12-13 13:05:37.423 Kodi: (Study (Kodi)) Handling message: '{"id":1001,"jsonrpc":"2.0","result":"pong"}'.
2016-12-13 13:05:47.423 Kodi: (Study (Kodi)) Sending data: '{"jsonrpc":"2.0","method":"JSONRPC.Ping","id":1001}'
2016-12-13 13:05:47.425 Kodi: (Study (Kodi)) Handling message: '{"id":1001,"jsonrpc":"2.0","result":"pong"}'.
2016-12-13 13:05:57.425 Kodi: (Study (Kodi)) Sending data: '{"jsonrpc":"2.0","method":"JSONRPC.Ping","id":1001}'
2016-12-13 13:05:57.428 Kodi: (Study (Kodi)) Handling message: '{"id":1001,"jsonrpc":"2.0","result":"pong"}'.
2016-12-13 13:06:00.918 User: Admin initiated a switch command (298/Front Door PIR/On)
2016-12-13 13:06:00.988 LUA: Front Door PIR alert..
2016-12-13 13:06:00.988 EventSystem: Fetching url...
2016-12-13 13:06:00.989 EventSystem: Script event triggered: Front Door PIR
2016-12-13 13:06:00.919 (Virtual) Light/Switch (Front Door PIR)
2016-12-13 13:06:02.935 (Virtual) Light/Switch (Front Door PIR)
2016-12-13 13:06:07.428 Kodi: (Study (Kodi)) Sending data: '{"jsonrpc":"2.0","method":"JSONRPC.Ping","id":1001}'
2016-12-13 13:06:07.429 Kodi: (Study (Kodi)) Handling message: '{"id":1001,"jsonrpc":"2.0","result":"pong"}'.
2016-12-13 13:06:17.429 Kodi: (Study (Kodi)) Sending data: '{"jsonrpc":"2.0","method":"JSONRPC.Ping","id":1001}'
2016-12-13 13:06:17.430 Kodi: (Study (Kodi)) Handling message: '{"id":1001,"jsonrpc":"2.0","result":"pong"}'.
2016-12-13 13:06:27.431 Kodi: (Study (Kodi)) Sending data: '{"jsonrpc":"2.0","method":"JSONRPC.Ping","id":1001}'
2016-12-13 13:06:27.432 Kodi: (Study (Kodi)) Handling message: '{"id":1001,"jsonrpc":"2.0","result":"pong"}'.

Re: Execute script.securitycam no longer working (lua)

Posted: Tuesday 13 December 2016 14:13
by Dnpwwo
Looks like the command isn't being seen by the plugin at all.

gizmocuz did some clean up that area a month or so ago. When was the last time you upgraded?

Re: Execute script.securitycam no longer working (lua)

Posted: Wednesday 14 December 2016 9:42
by cherowley
That's weird I replied yesterday but its gone!

I hadn't upgraded since the last "stable" earlier this year.

It works fine on the latest "stable". Noticed that the buttons on the kodi remote popup work ok on the beta.

Re: Execute script.securitycam no longer working (lua)

Posted: Thursday 15 December 2016 14:09
by cherowley
Is this a domoticz fault or the kodi plugin fault then?

Re: Execute script.securitycam no longer working (lua)

Posted: Friday 16 December 2016 9:10
by cherowley
Right so logged on git but told to come back here!

"Use the forum" lol :roll:

Can someone confirm this problem and then how will it get fixed if its not allowed to be logged on lol?!

Re: Execute script.securitycam no longer working (lua)

Posted: Monday 19 December 2016 10:17
by cherowley
Still can't seem to execute scripts/addons in kodi in the latest beta.

Last worked on the stable but was advised to try the beta as the stable has problems, doh!

Re: Execute script.securitycam no longer working (lua)

Posted: Monday 19 December 2016 22:21
by sincze
Ai I must admit, at the moment I am cheating a bit using https://github.com/Egregius/LUA-Pass2PHP-for-Domoticz.
Domoticz triggers the device (doorbell) -> passes it to pass2php.php -> that file kicks my .php file to start the securitycam to show up on all active kodi devices.

So unfortunately I can not answer the question if this is still working from LUA.

As a temporary fix maybe use os.execute to execute a bash file ?

Code: Select all

# IPCAM SNAPSHOT to Keuken
if [ $snapshot -eq 1 ] && ping -c 1 $keuken > /dev/null  ; then
(wget -O /dev/null "http://$keuken:$port/jsonrpc?request={%22jsonrpc%22:%222.0%22,%22method%22:%22Addons.ExecuteAddon%22,%22params%22:{%22addonid%22:%22script.securitycam%22},%22id%22:%221%22}}") &
In this case if IP Camera and keuken is on... it will trigger the plugin.

Re: Execute script.securitycam no longer working (lua)

Posted: Tuesday 20 December 2016 9:40
by cherowley
ah ok sincze, thanks for the additional info :)

If you ever find yourself with nothing to do feel free to try the following in a lua script to verify if it works for you :lol:

-- show cctv on other kodi devices
if otherdevices['Lounge (Kodi)'] ~= "Off" then commandArray['Lounge (Kodi)']='Execute script.securitycam' end


* where 'Lounge (Kodi)' is the name of the kodi instance....