PDA

View Full Version : Popping up a message in XBMC remotely... a little help please....


JohnWPB
2009-02-17, 06:55
I have done some research, and can not find exactly what I am looking for.

I am trying to pop up a window in XBMC remotely, with custom text passed to it. When the system is up and running, with the surround sound in the back of the house, it can be difficult to hear someone at the door at the front of the house.

I have the house automated with Home Seer, and it is capable of running scripts based on events ect. My doorbell is hooked to Home Seer, and can log when someone comes to the door, flash a light ect. I would also like to have a message pop up on XBMC when this happens.

Ideally I would like to pass "Someone is at the front door" as well as show a remote picture from the door camera in the dialog as well. (Just a still image that is captured whenever the doorbell is pressed). I can easily save the image to a network location with the same name to be used each time... something like Someoneatthedoor.jpg.

I also receive Caller ID with Home Seer, and would like to be able to pass this as a pop up as well when the phone rings.

This is the closest I could get with my research and digging through the online help documentation:

htt p://192.168.1.96:8088/xbmcCmds/xbmcHttp?command=ExecBuiltIn;Notification(Informat ion!,This is a test notification)
I based the above on what I found in the debug log after passing an event with XBMC Notifier v1.0.1:
23:33:01 T:5268 M:1916645376 DEBUG: HttpApi Start command: ExecBuiltIn paras: ExecBuiltIn; Notification(Information!,This is a test notification)

Using that program pops up a 200 x 100 or so dialog box in the lower right corner with that text.

This is of course the debug log, and does not show the correct syntax of what was sent to XBMC.

How can I have a window or dialog pop up with custom text?

rwparris2
2009-02-17, 07:06
the proper way to figure this out is to use the wiki. You'll see you need to use the http api to execute a builtin :

http://xbmc.org/wiki/?title=WebServerHTTP-API#The_Commands
http://xbmc.org/wiki/?title=List_of_Built_In_Functions

but... you're close with what you've put together, so I'll just tell you

instead of ExecBuiltIn;Notification() you want ExecBuiltIn(Notification())

JohnWPB
2009-02-17, 07:42
I looked through the Wiki, and that is where I was able to get the "ExecBuiltIn" command.

With your help, I tried your alterations, and came up with this:

http://192.168.1.96:9777/xbmcCmds/xbmcHttp?command=ExecBuiltIn(Notification(testing, testing123))Which is now working perfectly, so thank you!

I just did a test, and it passes the info, as well as a capture of the door cam. It is really tiny though to try to determine who is at the door. It could be a friend, or a vacuum salesman by looking at the thumbnail :D

I do not see a set of parameters for the X,Y positioning, nor the size of the window.... Searching through all text in the xml's also failed to turn up any XML's containing "notification"..... Is there any way to change the size and positioning of this dialog window, or is that internal to the core code?

Here is a screen cap of what I have so far, when someone approaches the door, the motion sensor sends a Signal to Home Seer, it then relays the info to XBMC. All in all, there is about a 1 second delay, which is totally acceptable.

http://img153.imageshack.us/img153/418/frontdoornotificationap1.jpg

canyonquest
2009-02-19, 16:49
Is there any way to change the size and positioning of this dialog window, or is that internal to the core code?
One of the real developers may wish to correct me if I'm mistaken, but I believe this is skin-specific. Look in the DialogKaiToast.xml file for <control type="image" id="400">

topfs2
2009-02-19, 17:15
Here is a screen cap of what I have so far, when someone approaches the door, the motion sensor sends a Signal to Home Seer, it then relays the info to XBMC. All in all, there is about a 1 second delay, which is totally acceptable.

You could try the EventClients otherwise, they are able to send Notifications. The wrappings is available in C/C++ Python and Java.

look on linuxbranch svn in tools/EventClients/examples/PROGRAMMINGLAUNGUAGE/
And there should be a example_notification in these.

They are very responsive and the gui message should popup way faster than a second on the home network.

Cheers,
Tobias

kizer
2009-02-19, 19:00
Man that is killer. I like it. Talk about getting creative with your TV.

JohnWPB
2009-02-19, 21:36
One of the real developers may wish to correct me if I'm mistaken, but I believe this is skin-specific. Look in the DialogKaiToast.xml file for <control type="image" id="400">

You my friend are NOT mistaken! Thank you, thank you thank you!!! I would have never figured out where to look for that! I would not begin to think that the image description would have been named "avatar".

It is working perfectly now! The below screen capture is what it now actually looks like. I didn't run outside to trip the motion sensor, I just fired the command manually :) At night, the motion sensor also trips a light above the door, so whoever is there will still be visible.

http://img16.imageshack.us/img16/5282/frontdoordonejc3.jpg

In case anyone else stumbling across this post wants to know how it is done, here are the changes to the DialogKaiToast.XML:



<control type="group">
<control type="image">
<posx>-20</posx>
<posy>-100</posy>
<width>440</width>
<height>160</height>
<colordiffuse>DDFFFFFF</colordiffuse>
<texture>black-back.png</texture>
<bordertexture border="3">NoCover_1.png</bordertexture>
<bordersize>4</bordersize>
</control>
<control type="image" id="400">
<description>avatar</description>
<posx>-20</posx>
<posy>-90</posy>
<width>220</width>
<height>140</height>
<aspectratio>keep</aspectratio>
<texture>DefaultFileBig.png</texture>
</control>
<control type="label" id="401">
<description>Line 1 Label</description>
<posx>230</posx>
<posy>-40</posy>
<width>330</width>
<height>18</height>
<font>font22</font>
<textcolor>green</textcolor>
<align>left</align>
<aligny>center</aligny>
</control>
<control type="label" id="402">
<description>Line 2 Label</description>
<posx>215</posx>
<posy>-20</posy>
<width>330</width>
<height>20</height>
<font>font10</font>
<align>left</align>
<aligny>center</aligny>
</control>
</control>

NineT9mustang
2009-02-19, 23:02
genius, pure genius... great idea, sorry for not adding anything relivant to your thread, just wanted to say kudos!

JohnWPB
2009-02-20, 02:31
Hehehe thanks for the kudos... Yea, with the remote messaging to XBMC, some really cool stuff can be done for sure!

salnajjar
2009-02-26, 13:48
What's the correct parameter for setting an image in the notification dialogue?

I've tried using:
command=ExecBuiltIn(Notification(title,message,600 00,c:/image.jpg))
command=ExecBuiltIn(Notification(title,message,600 00,c:\image.jpg))
command=ExecBuiltIn(Notification(title,message,600 00,(c:\image.jpg)))
command=ExecBuiltIn(Notification(title,message,600 00,http://imageurl/image.jpg))

I can't find any information regarding this, if anyone can enlighten me... (I'm using the MediaStream skin).

Thanks

Seri

smcnally75
2009-02-26, 14:25
I'm having a strange issue and I was hoping someone could point out something I'm missing. I'm sending commands from a control processor directly to the xbox with a "GET" command. All my other http commands seem to work this way but this doesn't. the string I'm sending is

GET /xbmcCmds/xbmcHttp?command=ExecBuiltIn(XBMC.Notification(Ale rt!,Water Leak in Basement,[,20,]))

but it doesn't work. If I send

192.168.1.201/xbmcCmds/xbmcHttp?command=ExecBuiltIn(XBMC.Notification(Ale rt!,Water Leak in Basement,[,20,]))

from a web browser it works fine, but for some reason a direct connection from my control processor doesn't. Any ideas?

JohnWPB
2009-02-26, 16:12
What's the correct parameter for setting an image in the notification dialogue?

This is the line I am using:
http://192.168.1.96:9777/xbmcCmds/xbmcHttp?command=ExecBuiltIn(Notification(ATTENTIO N,Someone is at the front door,6000,C:\FrontDoor.jpg))
I'm sending commands from a control processor directly to the xbox with a "GET" command. All my other http commands seem to work this way but this doesn't.

I have no idea how the get command works, but it could be doing just that "getting" the page, and not actually loading it?

salnajjar
2009-02-26, 17:55
JohnWPB, it might be a matter of escaping it, plus, I noticed your syntax seems a little off.

I just used wget from my remote linux server to my windows XBMC box, with the precise command:
wget http://192.168.1.105/xbmcCmds/xbmcHttp?command=ExecBuiltIn\(Notification\(Alert\ !,Water\ Leak\ in\ Basement,20000\)\)
This worked fine and was most definately a 'get' request.

smcnally75
2009-02-26, 19:50
This is the line I am using:
http://192.168.1.96:9777/xbmcCmds/xbmcHttp?command=ExecBuiltIn(Notification(ATTENTIO N,Someone is at the front door,6000,C:\FrontDoor.jpg))


I have no idea how the get command works, but it could be doing just that "getting" the page, and not actually loading it?

The GET command is basically a way to retrieve a webpage by way of command line. It does work for all of the other HTTP commands I've used so far so I'm confused as to why this one isn't working. I did just notice that you have no brackets in your command though so I will try that.

smcnally75
2009-02-27, 03:04
JohnWPB, it might be a matter of escaping it, plus, I noticed your syntax seems a little off.

I just used wget from my remote linux server to my windows XBMC box, with the precise command:
wget http://192.168.1.105/xbmcCmds/xbmcHttp?command=ExecBuiltIn\(Notification\(Alert\ !,Water\ Leak\ in\ Basement,20000\)\)
This worked fine and was most definately a 'get' request.

That's interesting. What's the reason for all the back slashes? I'll try it tonight.

smcnally75
2009-02-27, 04:10
I figured it out...I needed to use URL encoding for some characters. This worked:

GET /xbmcCmds/xbmcHttp?command=ExecBuiltIn(Notification(ALERT!%2 CWater%20In%20Basement!%2C6000%2CE:%5Calert.jpg))

ouija
2009-04-01, 03:05
I finally got messages stating as sent "OK!" from the browser, but this was by enabling the Webserver and not the Events server (and of course using the correct port, ect)

However, even though the event appears as "OK!" within the browser, nothing appears in my XBMC setup -- why is this?

znelbok
2009-04-15, 10:10
This is a great use of xbmc with home automation systems

I use CQC and am looking at doing the same thing. I especially like the fact that I can send a notification to my daughter when it is dinner time without having to yell at her and then turn it off automatically after a set time if she does not get to the table as requested.

Mick

andre_pl
2009-08-05, 18:10
I had a similar problem and it turns out that the parser is just VERY picky.
for example this works just fine:
ExecBuiltIn(Notification(New Mail,3000,/home/andre/envelope.png))

but this doesn't
ExecBuiltIn(Notification(New Mail, 3000, /home/andre/envelope.png))

the only difference is the spaces following the commas. if they are there, xbmc wont show the image, but it will still pop up the dialog. its quite frustrating.

I've also noticed that the EventClient is unable to show anything on the screen at all. xbmc shows a notification that the client connected, but then the log just shows that the connection timed out.

andre_pl
2009-08-05, 18:15
to the OP, have you been able to get this working without the other popup dialog's icons to also be enlarged? it seems the xml change just increases the default image size for popups, so all XBMC notifications will ahve oversized icons now... as I understand it, its possible to create a custom dialog box that might be more suitable for something like this, but haven't had any success finding any information on how to do it. I'm not entirely sure its possible through the HTTP API.

JohnWPB
2009-08-05, 23:36
Sorry, I have not idea how to do that one... The automated things are the only things I am sending now, so I use the same size icons for all of them.

Hopefully someone else can help with that one.....

mason
2009-08-13, 18:28
thanks for that post, i was able to add it to my capisuite answering machine i run on a debian server ... so xbmc notifies me when i get a call and displays the callerid :) pretty nice hehe :)

LittleBear1981
2009-10-17, 10:43
I'll post details if anyone wants them.. however i got the program motion to work with this command.. it's awesome.

sudo wget http://username:pasword@localhost:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn\(Notification\(Attent ion\!,There\ Is\ Someone\ Approching,6000,%f\)\)

i am not sure that i need to use sudo, also motion takes alot of pictures even a 1fps, i am talking about hundreds here... also anyone know of a way to get a uvc webcam to work as a live stream in xbmc linux?