XBMC notify

Moderator: leecollings

User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: XBMC notify

Post by sincze »

So, I got this all working now for notifications.
I guess I still need to use the script for Security Can Overlay http://forum.kodi.tv/showthread.php?tid=182540

I had hoped something like homeseer would be possible :D http://forums.homeseer.com/showthread.php?p=1213403
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.
User avatar
Dnpwwo
Posts: 820
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: XBMC notify

Post by Dnpwwo »

Exectuing addons remotely is certainly possible with Kodi from the interface the Domoticz uses but I don't have a camera so never looked at it.

I've added an 'Execute <addinid>' to the beta stream today. See if it does what you need.

Edit: Updated the wiki to reflect this addition: http://www.domoticz.com/wiki/Kodi#Event ... ifications
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
User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: XBMC notify

Post by sincze »

Just updated to v2.3857.
Checking it out will report back later.

Tnx Dnpwwo,

10:48 Update:

Created a Lua_time_kodi script.

Code: Select all

print('------------------------------------')
print('this will end up in the domoticz log')
print('------------------------------------')

commandArray = {}

commandArray['Studeerkamer Kodi']='Execute script.securitycam'
-- commandArray['SendNotification']='Send Alarm Message to everything!'
return commandArray
Produces:

Code: Select all

2015-12-20 10:47:00.223 LUA: ------------------------------------
2015-12-20 10:47:00.223 LUA: this will end up in the domoticz log
2015-12-20 10:47:00.223 LUA: ------------------------------------
However no plugin in Kodi is executed.
If I uncomment

Code: Select all

-- commandArray['SendNotification']='Send Alarm Message to everything!'
I'll receive a notification on every device including Kodi.
At the moment Kodi is playing a video and I see the following in the Domoticz log.
If I manually trigger the security.cam plugin it does show up.

Code: Select all

2015-12-20 11:11:15.623 Kodi: (Studeerkamer) Handling message: '{"id":1007,"jsonrpc":"2.0","result":{"canhibernate":true,"canshutdown":true,"cansuspend":true}}'.
2015-12-20 11:11:15.623 Kodi: (Studeerkamer) Sending data: '{"jsonrpc":"2.0","method":"Player.GetActivePlayers","id":1005}'
2015-12-20 11:11:15.624 Kodi: (Studeerkamer) Handling message: '{"id":1001,"jsonrpc":"2.0","result":"pong"}'.
2015-12-20 11:11:15.624 Kodi: (Studeerkamer) Handling message: '{"jsonrpc":"2.0","method":"Input.OnInputRequested","params":{"data":{"title":"Port","type":"number","value":"9090"},"sender":"xbmc"}}'.
2015-12-20 11:11:15.624 Kodi: (Studeerkamer) Message warning, unhandled method: 'Input.OnInputRequested'
2015-12-20 11:11:15.624 Kodi: (Studeerkamer) Handling message: '{"jsonrpc":"2.0","method":"Input.OnInputFinished","params":{"data":null,"sender":"xbmc"}}'.
2015-12-20 11:11:15.624 Kodi: (Studeerkamer) Message warning, unhandled method: 'Input.OnInputFinished'
2015-12-20 11:11:15.628 Kodi: (Studeerkamer) Handling message: '{"id":1005,"jsonrpc":"2.0","result":[{"playerid":1,"type":"video"}]}'.
2015-12-20 11:11:15.628 Kodi: (Studeerkamer) Sending data: '{"jsonrpc":"2.0","method":"Player.GetItem","id":1003,"params":{"playerid":1,"properties":["artist","album","year","channel","showtitle","season","episode","title"]}}'
2015-12-20 11:11:15.671 Kodi: (Studeerkamer) Handling message: '{"id":1003,"jsonrpc":"2.0","result":{"item":{"album":"","artist":[],"episode":1,"id":7885,"label":"The Locomotion Interruption","season":8,"showtitle":"The Big Bang Theory","title":"The Locomotion Interruption","type":"episode","year":0}}}'.
2015-12-20 11:11:15.671 Kodi: (Studeerkamer) Sending data: '{"jsonrpc":"2.0","method":"Player.GetProperties","id":1002,"params":{"playerid":1,"properties":["live","percentage","speed"]}}'
2015-12-20 11:11:15.676 Kodi: (Studeerkamer) Handling message: '{"id":1002,"jsonrpc":"2.0","result":{"live":false,"percentage":27.37359619140625,"speed":1}}'.
2015-12-20 11:11:15.681 Kodi: (Studeerkamer) Event: 'Video - The Big Bang Theory [S8E1], The Locomotion Interruption'.'
What did I miss :D

Should be something simple as:

Code: Select all

commandArray['Studeerkamer Kodi']='Pause'
Also does not pause an active playing video. :D

The remote withing Domoticz can Pause my Kodi.

Code: Select all

2015-12-20 11:14:52.765 Kodi: (Studeerkamer) Sending data: '{"jsonrpc":"2.0","method":"Input.ExecuteAction","params":{"action":"playpause"},"id":1006}'
2015-12-20 11:14:52.765 Kodi: (Studeerkamer) Sent command: 'Input.ExecuteAction playpause'.
2015-12-20 11:14:52.766 Kodi: (Studeerkamer) Handling message: '{"id":1006,"jsonrpc":"2.0","result":"OK"}'.

My Kodi Settings. Strange thing is... Only 'Woonkamer shows up in Blockly,
My Kodi Settings
My Kodi Settings
Kodi-Settings.png (48.05 KiB) Viewed 3664 times
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.
User avatar
Brutus
Posts: 249
Joined: Friday 26 September 2014 9:33
Target OS: Windows
Domoticz version:
Location: Netherlands
Contact:

Re: XBMC notify

Post by Brutus »

Brutus wrote:
Dnpwwo wrote:I uploaded a new version that has a change to the multicast to force messages to loopback and be visible to the machine that sends them. That should help people who run Kodi and Domoitcz on the same server.

Also added some logic to push the correct device icon with the message. Custom icons will be in the next version.
It still will not work as I install Domoticz as a service... :roll:
Any possibility we can track this problem? Its still a problem...

Greetings Brutus.
1x Intel NUC8i5BEK (Windows 10 x64) Domoticz on Virtualbox with DietPi.
1x Aeon Labs USB Z-Stick S2
1x P1 Smart Meter USB
28x Fibaro Modules
SMA Solar System
Daikin Airco / Heating
Denon DHT-S716H & DSW-1H
User avatar
Dnpwwo
Posts: 820
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: XBMC notify

Post by Dnpwwo »

@sincze, firstly thanks for putting together a really good post. Trouble shooting is so much easier when people take the time to post the detail of their issue. :D

I re-tested the addon functionality this morning on my 'real' Domoticz (built directly off the github source) and it worked. I also checked github to make sure that I had included everything in the update and it looks fine.

I used:

Code: Select all

commandArray = {}
commandArray['Lounge']='Execute weather.ozweather'
return commandArray
and got these log entries:

Code: Select all

2015-12-22 07:09:00.799 Kodi: (Lounge) Sent command: 'Execute Addon weather.ozweather'.
2015-12-22 07:09:00.802 Kodi: (Lounge) Executed Addon OK.
My first thought is that in the hardware page your device is called 'Studeerkamer' but in your Lua you have called it 'Studeerkamer Kodi'. Can you change that and retry?

I will have a look at the Pause in the next day or so.

@Brutus, I need details to help you.

Can you post the Kodi notification config and the Windows Firewall config for Domoticz.
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
User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: XBMC notify

Post by sincze »

Dnpwwo wrote:@sincze, firstly thanks for putting together a really good post. Trouble shooting is so much easier when people take the time to post the detail of their issue. :D
:D tnx, I read your post regarding what to send :)
Just updated to v2.3867, sorry for extensive log. Hope we can find the problem.
I seem to have 2:

- After restart of PC Domoticz and Kodi machines don't seem to like each other that much.
- Plugin will not start.

I use the following script:

Code: Select all

commandArray = {}
   commandArray['Studeerkamer']='Execute script.securitycam'
   commandArray['Studeerkamer']='Execute weather.ozweather'
return commandArray
A maybe I was mistaken by the screenshots mentioned here in the wiki: https://www.domoticz.com/wiki/Kodi
it say "Lounge" in the setup screenshot and in the end it says "Lounge Kodi" :D

The -9090 now says:

Code: Select all

2015-12-21 21:58:05.447 Kodi: (Studeerkamer) Connected to '*.*.*.*:9090'.
2015-12-21 21:58:05.450 Kodi: (Studeerkamer) Event: 'On'.
2015-12-21 21:58:05.579 Kodi: (Studeerkamer) Sending data: '{"jsonrpc":"2.0","method":"System.GetProperties","params":{"properties":["canhibernate","cansuspend","canshutdown"]},"id":1007}'
2015-12-21 21:58:05.778 Kodi: (Keuken) Connected to '*.*.*.*:9090'.
2015-12-21 21:58:05.781 Kodi: (Keuken) Event: 'On'.
2015-12-21 21:58:06.579 Kodi: (Studeerkamer) Sending data: '{"jsonrpc":"2.0","method":"JSONRPC.Ping","id":1001}'
....
....
2015-12-21 22:00:29.366 Kodi: Restarting I/O service thread.
Also the script is being executed however no action :(

Code: Select all

2015-12-21 22:01:00.382 EventSystem: Script event triggered: /home/linaro/domoticz/scripts/lua/script_time_kodi.lua
It seems I have a problem with Kodi when starting up (problem one seems to count for all my kodi machines running on windows 7 or 10.

If I do the following:
System -> Settings -> Services -> Web Server, I have username & password empty as described and port 9090.
If I disable the Allow remote control via HTTP en re-enable it and type 9090 again. The domoticz log changes instantly.

Code: Select all

2015-12-21 22:02:35.086 Kodi: (Studeerkamer) Event: 'Off'.
2015-12-21 22:02:35.215 Kodi: (Studeerkamer) Disonnected.
2015-12-21 22:02:35.266 Kodi: (Studeerkamer) Connected to '*.*.*.*:9090'.
2015-12-21 22:02:35.268 Kodi: (Studeerkamer) Event: 'On'.
2015-12-21 22:02:35.391 Kodi: (Studeerkamer) Sending data: '{"jsonrpc":"2.0","method":"System.GetProperties","params":{"properties":["canhibernate","cansuspend","canshutdown"]},"id":1007}'
2015-12-21 22:02:35.399 Kodi: (Studeerkamer) Handling message: '{"id":1007,"jsonrpc":"2.0","result":{"canhibernate":true,"canshutdown":true,"cansuspend":true}}'.
2015-12-21 22:02:35.399 Kodi: (Studeerkamer) Sending data: '{"jsonrpc":"2.0","method":"Player.GetActivePlayers","id":1005}'
2015-12-21 22:02:35.401 Kodi: (Studeerkamer) Handling message: '{"id":1005,"jsonrpc":"2.0","result":[{"playerid":1,"type":"video"}]}'.
2015-12-21 22:02:35.401 Kodi: (Studeerkamer) Sending data: '{"jsonrpc":"2.0","method":"Player.GetItem","id":1003,"params":{"playerid":1,"properties":["artist","album","year","channel","showtitle","season","episode","title"]}}'
2015-12-21 22:02:35.531 Kodi: (Studeerkamer) Handling message: '{"id":1003,"jsonrpc":"2.0","result":{"item":{"album":"","artist":[],"episode":9,"id":7893,"label":"The Septum Deviation","season":8,"showtitle":"The Big Bang Theory","title":"The Septum Deviation","type":"episode","year":0}}}'.
2015-12-21 22:02:35.531 Kodi: (Studeerkamer) Sending data: '{"jsonrpc":"2.0","method":"Player.GetProperties","id":1002,"params":{"playerid":1,"properties":["live","percentage","speed"]}}'
2015-12-21 22:02:35.534 Kodi: (Studeerkamer) Handling message: '{"id":1002,"jsonrpc":"2.0","result":{"live":false,"percentage":53.261528015136719,"speed":1}}'.
2015-12-21 22:02:35.537 Kodi: (Studeerkamer) Event: 'Video - The Big Bang Theory [S8E9], The Septum Deviation'.
2015-12-21 22:02:36.392 Kodi: (Studeerkamer) Sending data: '{"jsonrpc":"2.0","method":"Player.GetProperties","id":1002,"params":{"playerid":1,"properties":["live","percentage","speed"]}}'
2015-12-21 22:02:36.393 Kodi: (Studeerkamer) Handling message: '{"id":1002,"jsonrpc":"2.0","result":{"live":false,"percentage":53.342601776123047,"speed":1}}'.
2015-12-21 22:02:37.312 Kodi: (Studeerkamer) Handling message: '{"jsonrpc":"2.0","method":"Input.OnInputRequested","params":{"data":{"title":"Port","type":"number","value":"9090"},"sender":"xbmc"}}'.
2015-12-21 22:02:37.312 Kodi: (Studeerkamer) Message warning, unhandled method: 'Input.OnInputRequested'
..
..
2015-12-21 22:02:40.773 Kodi: (Studeerkamer) Handling message: '{"jsonrpc":"2.0","method":"Input.OnInputFinished","params":{"data":null,"sender":"xbmc"}}'.
2015-12-21 22:02:40.773 Kodi: (Studeerkamer) Message warning, unhandled method: 'Input.OnInputFinished'
..
..
2015-12-21 22:03:00.409 EventSystem: Script event triggered: /home/linaro/domoticz/scripts/lua/script_time_kodi.lua
2015-12-21 22:03:00.970 Kodi: (Studeerkamer) Sending data: '{"jsonrpc":"2.0","method":"Addons.ExecuteAddon","params":{"addonid":"weather.ozweather"},"id":1010}'
2015-12-21 22:03:00.970 Kodi: (Studeerkamer) Sent command: 'Execute Addon weather.ozweather'.
2015-12-21 22:03:00.975 Kodi: (Studeerkamer) Handling message: '{"error":{"code":-32602,"message":"Invalid params."},"id":1010,"jsonrpc":"2.0"}'.
2015-12-21 22:03:00.975 Error: Kodi: (Studeerkamer) Code -32602 Text 'Invalid params.' ID '1010' Request '{"jsonrpc":"2.0","method":"Addons.ExecuteAddon","params":{"addonid":"weather.ozweather"},"id":1010}'
That is maybe because I don't have ozweather installed, however it should also start the securitycam plugin, but it doesn't. (problem 2)
How can I determine the exact name of securitycam ?
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.
User avatar
Brutus
Posts: 249
Joined: Friday 26 September 2014 9:33
Target OS: Windows
Domoticz version:
Location: Netherlands
Contact:

Re: XBMC notify

Post by Brutus »

Dnpwwo wrote:
@Brutus, I need details to help you.

Can you post the Kodi notification config and the Windows Firewall config for Domoticz.
The problem is when you install Domoticz as a service in Windows the notifications don't reach the Kodi Media player. When you install Domoticz as a program they work.

Firewall Rules:
Port 8080 open (Domoticz webport)
Port 9090 open (Remote control)
Port 8085 open (Hardware monitor)
Port 9777 open (Notification port Kodi)
All Ports UDP and TCP for Kodi.exe

I have tried to push the messages to the local host address (127.0.0.1), IP adress of kodi player (192.168.1.5) and the broadcast address (224.0.0.1). Non of them work.

The Kodi player is installed on the same Windows 10 Machine as Domoticz.

Were can I find the Kodi Notification config file? As you can see I did not edit it for any reason ;)

Thnx for picking this up.
1x Intel NUC8i5BEK (Windows 10 x64) Domoticz on Virtualbox with DietPi.
1x Aeon Labs USB Z-Stick S2
1x P1 Smart Meter USB
28x Fibaro Modules
SMA Solar System
Daikin Airco / Heating
Denon DHT-S716H & DSW-1H
User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: XBMC notify

Post by sincze »

Brutus wrote:
Firewall Rules:
Port 8080 open (Domoticz webport)
Port 9090 open (Remote control)
Port 8085 open (Hardware monitor)
Port 9777 open (Notification port Kodi)
All Ports UDP and TCP for Kodi.exe
Let's see if I can solve my first problem (Kodi remote) if I open the above ports combined with the links below:

http://www.redeneobux.com/en/tutorial-a ... e-control/
https://www.digitalreins.com/install-ko ... ws-device/
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.
User avatar
Dnpwwo
Posts: 820
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: XBMC notify

Post by Dnpwwo »

@sincze, one problem I can help you with, one not really.

I've updated the wiki page to only have one device name, didn't realise people would read it that way.

The Good news:
Kodi is pretty unfriendly when it comes to addon execution, if the specified addon does not exist it reports a generic 'Invalid params' message as shown in your log.

I'm no scripting expert but if you do this in Lua:

Code: Select all

commandArray = {}
   commandArray['Studeerkamer']='Execute script.securitycam'
   commandArray['Studeerkamer']='Execute weather.ozweather'
return commandArray
I think that the 2nd commandArray['Studeerkamer'] assignment statement over writes the 1st. This means that the 'Execute script.securitycam' is ignored in your script. Just remove the 'commandArray['Studeerkamer']='Execute weather.ozweather'' and it will work.

Code: Select all

commandArray = {}
   commandArray['Studeerkamer']='Execute script.securitycam'
return commandArray
The Bad news:
Although I develop on Windows I don't really use it and I have no idea why you would need to fiddle with the settings post reboot. What I do know is that the Kodi Web Server settings and http have nothing to do the Kodi interface that Domoticz uses. I only use Kodi on RPi.


@Brutus, the Windows firewall settings on Domoticz (the source) are the important ones, not the Kodi (the destination). What are the firewall settings for domoticz.exe?
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
User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: XBMC notify

Post by sincze »

Dnpwwo wrote: The Bad news:
Although I develop on Windows I don't really use it and I have no idea why you would need to fiddle with the settings post reboot. What I do know is that the Kodi Web Server settings and http have nothing to do the Kodi interface that Domoticz uses. I only use Kodi on RPi.
Muchas gracias Dnpwwo.
Sometimes it takes time to figure out the solution. :D

What I can do is check your proposed solution :D (No need to check my windows firewall rules??)
To help testing I can install KODI on my spare raspberry 2
if that would help?? :D :D

I also tried telnet to obtain the 'pong' from the windows KODI.... however that is not working.
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.
User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: XBMC notify

Post by sincze »

Well. The situation
Windows 10 machine with KODI (15.2)

Resumed from sleep.

Code: Select all

Kodi: (Studeerkamer) Sending data: '{"jsonrpc":"2.0","method":"Input.ExecuteAction","params":{"action":"pause"},"id":1006}'
Kodi: (Studeerkamer) Sent command: 'Input.ExecuteAction pause'.
Kodi: (Studeerkamer) Sending data: '{"jsonrpc":"2.0","method":"Addons.ExecuteAddon","params":{"addonid":"script.securitycam"},"id":1010}'
Kodi: (Studeerkamer) Sent command: 'Execute Addon script.securitycam'.
However nothing happens.

If I do the following:
System -> Settings -> Services -> Web Server,
- disable the Allow remote control via HTTP

The domoticz log does indeed changes instantly.

Code: Select all


2015-12-22 18:25:48.631 Kodi: (Studeerkamer) Event: 'Off'.
2015-12-22 18:25:49.127 Kodi: (Studeerkamer) Sending data: '{"jsonrpc":"2.0","method":"System.GetProperties","params":{"properties":["canhibernate","cansuspend","canshutdown"]},"id":1007}'
2015-12-22 18:25:49.130 Kodi: (Studeerkamer) Handling message: '{"id":1007,"jsonrpc":"2.0","result":{"canhibernate":true,"canshutdown":true,"cansuspend":true}}'.
2015-12-22 18:25:49.130 Kodi: (Studeerkamer) Sending data: '{"jsonrpc":"2.0","method":"Player.GetActivePlayers","id":1005}'
2015-12-22 18:25:49.132 Kodi: (Studeerkamer) Handling message: '{"id":1005,"jsonrpc":"2.0","result":[{"playerid":1,"type":"video"}]}'.
2015-12-22 18:25:49.132 Kodi: (Studeerkamer) Sending data: '{"jsonrpc":"2.0","method":"Player.GetItem","id":1003,"params":{"playerid":1,"properties":["artist","album","year","channel","showtitle","season","episode","title"]}}'
2015-12-22 18:25:49.204 Kodi: (Studeerkamer) Handling message: '{"id":1003,"jsonrpc":"2.0","result":{"item":{"album":"","artist":[],"episode":3,"id":7728,"label":"The Fuzzy Boots Corollary","season":1,"showtitle":"The Big Bang Theory","title":"The Fuzzy Boots Corollary","type":"episode","year":0}}}'.
2015-12-22 18:25:49.204 Kodi: (Studeerkamer) Sending data: '{"jsonrpc":"2.0","method":"Player.GetProperties","id":1002,"params":{"playerid":1,"properties":["live","percentage","speed"]}}'
2015-12-22 18:25:49.205 Kodi: (Studeerkamer) Handling message: '{"id":1002,"jsonrpc":"2.0","result":{"live":false,"percentage":65.3211669921875,"speed":1}}'.
2015-12-22 18:25:49.212 Kodi: (Studeerkamer) Event: 'Video - The Big Bang Theory [S1E3], The Fuzzy Boots Corollary'.
2015-12-22 18:25:50.128 Kodi: (Studeerkamer) Sending data: '{"jsonrpc":"2.0","method":"Player.GetProperties","id":1002,"params":{"playerid":1,"properties":["live","percentage","speed"]}}'
2015-12-22 18:25:50.129 Kodi: (Studeerkamer) Handling message: '{"id":1002,"jsonrpc":"2.0","result":{"live":false,"percentage":65.398414611816406,"speed":1}}'.
And the commands

Code: Select all

commandArray['Studeerkamer']='Pause'
or
commandArray['Studeerkamer']='Execute script.securitycam'


are working! :D
And..... If KODI is restarted with a disabled webserver

Code: Select all

System -> Settings -> Services -> Web Server, 
- disable the Allow remote control via HTTP when it was switched of disabling HTTP 9090
The code still works and shows my camera!

So we can say great job, Dnpwwo! It is working. :D :D :D
However in my specific situation I still have to find a solution if I want to remote control my KODI...... :shock:

Anyone any ideas??
Attachments
All is working, even the Domoticz remote.
All is working, even the Domoticz remote.
Kodi-Remote Control disabled-2.png (300.81 KiB) Viewed 3596 times
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.
User avatar
Brutus
Posts: 249
Joined: Friday 26 September 2014 9:33
Target OS: Windows
Domoticz version:
Location: Netherlands
Contact:

Re: XBMC notify

Post by Brutus »

[quote="Dnpwwo@Brutus, the Windows firewall settings on Domoticz (the source) are the important ones, not the Kodi (the destination). What are the firewall settings for domoticz.exe?[/quote]

Thnx Dnpwwo for your reaction.

Both Source and destination are on the same Windows computer.
Domoticz has no firewall rules preconfigured.

When I allow "Domoticz.exe" In and Out in the Windows Firewall nothing Changes. Even when I add the "nssm.exe" (Domoticz Service Executable).

I have a Hyper-V session with Windows 7 and Domoticz as program installed (for testing). Here I send 10 times a notification with the test button in the settings page and 3 times they appear on Kodi.

Strange don't you think?
1x Intel NUC8i5BEK (Windows 10 x64) Domoticz on Virtualbox with DietPi.
1x Aeon Labs USB Z-Stick S2
1x P1 Smart Meter USB
28x Fibaro Modules
SMA Solar System
Daikin Airco / Heating
Denon DHT-S716H & DSW-1H
User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: XBMC notify

Post by sincze »

@Dnpwwo, well again I made some progress.

On the windows machine I issued

Code: Select all

C:\>netstat -an |find /i "listening"
to see what ports are open.

The result (KODI is started with enabled webserver on 9090)

Code: Select all

....
  TCP    0.0.0.0:9090           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:9090           0.0.0.0:0              LISTENING
....
  TCP    [::]:9090              [::]:0                 LISTENING
  TCP    [::]:9090              [::]:0                 LISTENING

Double entries for same port... Strange... Result your work is not working.

Now I disable the webserver port 9090 within Kodi

Code: Select all

....
  TCP    0.0.0.0:9090           0.0.0.0:0              LISTENING
....
  TCP    [::]:9090              [::]:0                 LISTENING				
....
Now only one service is listening on 9090 and your work is working :D .

Seems more like an issue with Kodi. I've to look into it.
However keeping it disabled allows me to use Domoticz & Kodi. :D :D


Update: 23:24
I think I found it.
Changed Allow remote control via HTTP Port to 8080 (no uid+pwd)
I issued

Code: Select all

C:\>netstat -an |find /i "listening"
As a result now not a double 9090 but 2 ports open.

Code: Select all

...
TCP    0.0.0.0:8080
TCP    0.0.0.0:9090
...
TCP    [::]:8080
TCP    [::]:9090
....
And everything is working just fine. :D :D
Attachments
Webserver Kodi at port 8080
Webserver Kodi at port 8080
Kodi Webserver Port 8080.JPG (52.65 KiB) Viewed 3571 times
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.
User avatar
Dnpwwo
Posts: 820
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: XBMC notify

Post by Dnpwwo »

@sincze, glad that you have it all sorted.

Any chance you could post a screen shot with the camera addon working and some instructions so I could add it to the wiki?

@Brutus, I can only suggest running a tool like WireShark (https://www.wireshark.org/) to see if you can work out where the other 70% of the messages are going or where in your network they are being dropped.

You should be able to clearly see the message leave Domoticz pretty easily.
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
User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: XBMC notify

Post by sincze »

@Dnpwwo, please find attached the screenshot if your code is being triggered :D

Do you need the (if doorbell pressed) script as well??

It needs some tweaking as the 433 mhz CoCo doorbell sender sends multiple 'Chime' packets resulting in multiple triggers in the code.
Attachments
20151219_191327-2.jpg
20151219_191327-2.jpg (44.19 KiB) Viewed 3554 times
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.
User avatar
Dnpwwo
Posts: 820
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: XBMC notify

Post by Dnpwwo »

Yes, post the script once you get it working properly so I can make a 'how to' section.
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
User avatar
MarcelMAH
Posts: 53
Joined: Friday 04 December 2015 23:35
Target OS: Linux
Domoticz version: v3.8025
Location: Goes, Netherlands
Contact:

Re: XBMC notify

Post by MarcelMAH »

I am running Kodi and Domoticz on Windows 8.1 x64 and also have the problem that Kodi does not respond on my notifications when I start Domoticz as a service.
When I stop the service and start Domoticz manually the notifications work. The log says they always work (even when started as a service, they just don't show). In all cases the broadcast does NOT work. I enter my Kodi IP.

Any thoughts?
Running Domoticz on Ubuntu 16.04 on VMware with RFXCOM - RFXtrx433 and Aeotec Z-Stick Gen5
User avatar
Brutus
Posts: 249
Joined: Friday 26 September 2014 9:33
Target OS: Windows
Domoticz version:
Location: Netherlands
Contact:

Re: XBMC notify

Post by Brutus »

MarcelMAH wrote:I am running Kodi and Domoticz on Windows 8.1 x64 and also have the problem that Kodi does not respond on my notifications when I start Domoticz as a service.
When I stop the service and start Domoticz manually the notifications work. The log says they always work (even when started as a service, they just don't show). In all cases the broadcast does NOT work. I enter my Kodi IP.

Any thoughts?
I'm glad to hear someone else has the same problem as me. The problem itself is not of course. ;)
So I think as mentioned before it's related to the "service" part of Domoticz.
1x Intel NUC8i5BEK (Windows 10 x64) Domoticz on Virtualbox with DietPi.
1x Aeon Labs USB Z-Stick S2
1x P1 Smart Meter USB
28x Fibaro Modules
SMA Solar System
Daikin Airco / Heating
Denon DHT-S716H & DSW-1H
User avatar
MarcelMAH
Posts: 53
Joined: Friday 04 December 2015 23:35
Target OS: Linux
Domoticz version: v3.8025
Location: Goes, Netherlands
Contact:

Re: XBMC notify

Post by MarcelMAH »

Brutus wrote:
MarcelMAH wrote:I am running Kodi and Domoticz on Windows 8.1 x64 and also have the problem that Kodi does not respond on my notifications when I start Domoticz as a service.
When I stop the service and start Domoticz manually the notifications work. The log says they always work (even when started as a service, they just don't show). In all cases the broadcast does NOT work. I enter my Kodi IP.

Any thoughts?
I'm glad to hear someone else has the same problem as me. The problem itself is not of course. ;)
So I think as mentioned before it's related to the "service" part of Domoticz.
Always better not to be the only one :)
Now we just need to work to a solution, no idea where to begin, I think a dev would need to guide us in troubleshooting further.
Running Domoticz on Ubuntu 16.04 on VMware with RFXCOM - RFXtrx433 and Aeotec Z-Stick Gen5
gerritv
Posts: 6
Joined: Sunday 13 March 2016 12:45
Target OS: Windows
Domoticz version:
Location: St Catharines, ON
Contact:

Re: XBMC notify

Post by gerritv »

I am facing the same issue on my recent Windows 10 install of Domaticz. I added some code to CPacket::Send in xbmcclient.h to show the error returned from the sendto(). It returns WSAEHOSTUNREACH (10065)= No route to host.A socket operation was attempted to an unreachable host. See WSAENETUNREACH.

I will dig into that further. For me it doesn't make any difference if I run as a service or not.

A bit more gleaned from the www:
Some more useful info: 224.0.0.1 is the multicast address to send to all hosts on a subnet so the Default is the correct address to use. Using e.g. 192.168.x.x means that the Notification is not sent using UDP. Not sure if this is correct as the other end (Kodi) is listening for UDP I think.
There is a tool called iperf which can be used to test multicast, but it also runs into the No Route to Host error.
Hobbies
Domoticz on Windows Server 2012 R2 on Acer H341, MySensors on Nano/ESP8266, testing on Windows 10
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest