Execute script.securitycam no longer working (lua)

Moderator: leecollings

Post Reply
cherowley
Posts: 65
Joined: Tuesday 24 February 2015 15:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Execute script.securitycam no longer working (lua)

Post 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!
User avatar
Dnpwwo
Posts: 819
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

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

Post 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?
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
cherowley
Posts: 65
Joined: Tuesday 24 February 2015 15:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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
User avatar
Dnpwwo
Posts: 819
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

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

Post 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?
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
cherowley
Posts: 65
Joined: Tuesday 24 February 2015 15:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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"}'.
User avatar
Dnpwwo
Posts: 819
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

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

Post 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?
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
cherowley
Posts: 65
Joined: Tuesday 24 February 2015 15:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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.
cherowley
Posts: 65
Joined: Tuesday 24 February 2015 15:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by cherowley »

Is this a domoticz fault or the kodi plugin fault then?
cherowley
Posts: 65
Joined: Tuesday 24 February 2015 15:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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?!
cherowley
Posts: 65
Joined: Tuesday 24 February 2015 15:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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!
User avatar
sincze
Posts: 1299
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

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

Post 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.
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
cherowley
Posts: 65
Joined: Tuesday 24 February 2015 15:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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....
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests