2013-01-29, 10:45
(2013-01-29, 10:10)storstenson Wrote:(2013-01-29, 09:30)Tomkun Wrote:(2013-01-29, 07:37)giftie Wrote: I do have this working.. It will be part of the next release(still more things to go before that happens....)
but in the mean time...
after the following:
addCode:import xbmc, xbmcaddon
Code:import socket
add the following before def activate_on( trigger == "None" ):
Code:def broadcastUDP( data, port = 8278 ): # XBMC's former HTTP API output port is 8278
IPADDR = '255.255.255.255'
PORTNUM = port
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0)
s.connect((IPADDR, PORTNUM))
s.send(data)
s.close()
change your script from this:
Code:xbmc.executehttpapi( "Broadcast(<b>CE_Automate<li>script_start</b>)" )
to this:
Code:broadcastUPD( "<b>CE_Automate<li>script_start</b>" )
if you need to have a different port number just add it like so:
orCode:broadcastUPD( "<b>CE_Automate<li>script_start</b>", port = 8900 )
Code:broadcastUPD( "<b>CE_Automate<li>script_start</b>", 8900 ) # the port = is optional
or just download this file -> http://www.mediafire.com/file/l834hqkb8o...tion(3).py
be sure to rename it to 'home_automation.py' and save it in the userdata/addon_data/script.cinema.experience/ha_scripts folder
This should allow you to use the XBMC Event Receiver plug-in in EventGhost like it was before(pertaining to the script that is) so you shouldn't have to make any changes to EventGhost, just make sure that XBMC Broadcast IP is set to 255.255.255.255
Thanks! I'll try it soon!
Thank you so much! It works great
Just two small errors.
1. On resume and pause, there is no trigger sendt. (it is checked for in the HA options within CE settings)
2. Eventghost pops up with this error as soon as se CE scripts starts (with or without your extra code)
JSON unrecogniced event type:
Raw event: {u'params': {u'data': {u'playlistid': 1}, u'sender': u'xbmc'}, u'jsonrpc': u'2.0', u'method': u'Playlist.OnClear'}
It works just fine here; the only quibble is that some events seem to take a few seconds to fire, but I don't think that is a problem with the script.
Thanks Giftie!