Page 6 of 12

Re: Spotify

Posted: Fri Aug 10, 2012 1:46 am
by werdna219
Hey so once you get the "Get Track" and " Get Artist" information how do you send that to a broadcast event? I would like to broadcast this to my phone. Is there a python code?

Re: Spotify

Posted: Sat Aug 11, 2012 6:28 am
by krambriw
Currently this is given as a simple print statement in the log if you just execute the macro but you can easily use the action result in a python script code.

You have so many options, almost unlimited. To send information to a phone, I am personally using Growl for Windows and "Prowl" on my iPhone ("Notify my Android" for those devices).

First thing I would do is to make a little macro with a script for each info I am interested in. This is a sample for "Get Current Song Title" using Growl :

Code: Select all

theTrack = eg.plugins.MySpotify.GetCurrentTrack()
eg.plugins.Growl.Notify(u'EventGhost', u'Spotify', theTrack, u'', True, 0, None, False)
When I run it, it sends the track name to my phone. That's it, very simple.

Best reg Walter

Re: Spotify

Posted: Sat Aug 11, 2012 12:26 pm
by werdna219
Thats almost what Im looking for, but is there a way to do this with python. I tried modifing your code to no avail. Thank you for the response, Im so close to the answer!

Re: Spotify

Posted: Sat Aug 11, 2012 6:16 pm
by krambriw
If you could be more precise, we could give you some hints but we are not interested in guessing games.
Specify your target (phone type, os, phone app etc etc).

Re: Spotify

Posted: Mon Aug 13, 2012 2:52 am
by werdna219
Im sorry...ill try to explain better. Im linking an Android phone (Atrix) with the event ghost app and the amazing TerREmote. They talk to the eventghost broadcaster event, or even better the Android Plugin for EventGhost. I have recently downloaded the Spotify Plugin and love the simplicity. When I include "Get Track" in a macro, I notice that in the "Viewer" window i can see the correct track. What I would like help with is the code to take that "i" (information) that is received by running "Get Track" and broadcast that to my Android Phone. The code written before seemed very close but you used the plugin notify, which confused me.

I hope this helps, and sorry for being vague, but i do appreciate the time!

Re: Spotify

Posted: Mon Aug 13, 2012 5:35 am
by krambriw
OK, I see now, you have an Android phone. This python script uses the Android plugin for EG. Try this in a macro:

Code: Select all

theTrack = eg.plugins.MySpotify.GetCurrentTrack()
eg.plugins.Android.plugin.Send(theTrack)
The script above will assume that Spotify is running and playing something. To handle situations when this is not the case, the script could be extended with various checks. But it should work to start from...

BR

Re: Spotify

Posted: Fri Aug 24, 2012 9:18 pm
by brotbuexe
If Spotify is started when evenghost is running it does not work for me.
I have to exit and restart eventghost.

Is there a way to make shure the plugin works when spotify is started later?
a timer that does the start thing every x minutes.
Or a action I can trigger by pressing a button.

Re: Spotify

Posted: Sat Aug 25, 2012 8:37 am
by krambriw
If Spotify is started when evenghost is running it does not work for me
That is strange, when I test it, it works without problem if Spotify is started before or not. Try the macros "Terminate Spotify" and "Start Spotify" if they works. Here they works fine. (I'm running the test with Vista)

Best regards, Walter

Re: Spotify

Posted: Tue Sep 04, 2012 4:17 am
by brotbuexe
Looks like its only not working after I put my system in standby.

Now when its not working I try to disable the spotify plugin:

Spotify plugin stopped
Spotify monitor thread has stopped

When I then enable it, nothing happens and it still does not work.
I can restart spotify, it still does not work.

When I then restart Eventghost it works.

Spotify found
Spotify object created

Now if I can just do some reload action, I could run this action when the system comes from standby.

Re: Spotify

Posted: Sun Sep 09, 2012 3:16 pm
by husa550
Hi!

This is my first post in this forum.

As my maincontrol i use CommandFusion + iTach IP2IR + http.
Have just found Eventghost, excellent software!
My problem is that i want to use Spotify plugin to control Spotify at the same pc as as i have Eventghost and control spotify works fine.
In the spotify plugin there is funktions to get song title, artist and here i get trouble.
I want eventghost to send song title as feedback to CommandFusion (iViewer 4).
Is that posible without python script/command?
If so, how???
If python script/command i a must, how should that look like?

Thank's

Latest Eventghost
Win7

Re: Spotify

Posted: Sun Sep 09, 2012 4:49 pm
by krambriw
Hi husa550,
It is not possible without work, most likely python scripts are needed. I have showed some examples of the same but then sending to an android phone. It all depends how Command Fusion can receive information. Maybe the author of Command Fusion will care to help you out.

Best regards, Walter

Re: Spotify

Posted: Sun Sep 09, 2012 8:46 pm
by husa550
Does someone have an idea how i could send the info after "Spotify Get current status" to commandfusion?
Skärmavbild 2012-09-09 kl. 22.25.45.png

Re: Spotify

Posted: Sun Sep 09, 2012 9:20 pm
by husa550
krambriw wrote:Hi husa550,
It is not possible without work, most likely python scripts are needed. I have showed some examples of the same but then sending to an android phone. It all depends how Command Fusion can receive information. Maybe the author of Command Fusion will care to help you out.

Best regards, Walter
I want to put the text from !info to get in commandfusion plugin: Serial Change
After that it's easy.
Or if there are some way of sending !info text by UDP

Re: Spotify

Posted: Mon Sep 10, 2012 6:51 am
by krambriw
Hi, just looked at it quickly. The action in my Spotify plugin is returning a value as response. This simple python script sends the current track title using SerialChange. You can try if it works.

Best regards, Walter

Code: Select all

theTrack = str(eg.plugins.MySpotify.GetCurrentTrack())
eg.plugins.CommandFusion.SerialChange(1, theTrack)

Re: Spotify

Posted: Mon Sep 10, 2012 3:55 pm
by husa550
krambriw wrote:Hi, just looked at it quickly. The action in my Spotify plugin is returning a value as response. This simple python script sends the current track title using SerialChange. You can try if it works.

Best regards, Walter

Code: Select all

theTrack = str(eg.plugins.MySpotify.GetCurrentTrack())
eg.plugins.CommandFusion.SerialChange(1, theTrack)
Sweet!
It works :mrgreen:
Big thank you!!!
If i want to send the result from "Get Current Status", how will the script look like?
I tried to change Track to Status in the script but that did not work, what am i missing?

Edit: I worked it out :D

This is how it look's now.
Would be nice with fanart, perhaps in the future for this plugin!? :D
SpotifyRemote.gif