Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

AutoRemote EG Plugin - Send variable info from EG to Phone

Questions and comments specific to a particular plugin should go here.
Post Reply
Tek420
Posts: 3
Joined: Wed Jun 25, 2014 3:46 pm

AutoRemote EG Plugin - Send variable info from EG to Phone

Post by Tek420 »

I have searched and searched but cannot find any info on what I am trying to do. Basically I want to get the song, artist, album info and album year from whatever is playing in Media Monkey and have it sent to my phone via AutoRemote as a message or notification. I have everything in place and just need to figure out how to get the info to send to my phone.

Here is what I have first. It's a Win 7 Ultimate SP1 box, Eventghost v0.4.1.r1669, AutoRemote Plugin v1.90.

1. I have a Tasker command to send "WhoIsThis" to EG and that is recognized fine and shows up in the log and goes to step two in my Song Info macro.
2. Is a MediaMonkey 'Get detailed song info'
3. A small bit of code to parse out just what I want. I tried it simple and as a function and it seems to wrk fine as it shows up in the log perfectly.

Code: Select all

str = eg.event.payload
#print str
#def songInfo():
#    global sinfo
#    sinfo = "Song -", str[0], "Artist -", str[1], "Album -", str[2], "Album Year -", str[5]
#    print sinfo
#print info
sinfo = "Song -", str[0]+'\n', "Artist -", str[1]+'\n', "Album -", str[2]+'\n', "Album Year -", str[5]
print sinfo
4. Now is where I get baffled. I setup an Action to send an AutoRemote Message or Notification and this is where it bombs. When I try to just send the variable is sends the literal then I read about putting the variable in curly braces. Still bombs. Then I kind of gleaned about prefacing the curly braces with 'X=:=' and it still bombs. I get the below error when I run it as it is above.

Code: Select all

SongInfoStr
   ('Song -', u'Song Of The Wind\n', 'Artist -', u'Santana\n', 'Album -', u'Gold Greatest Hits\n', 'Album Year -', 2003)
AutoRemote: Sending =:={sinfo} to Tek420
   Error in Action: "AutoRemote: Sending =:={sinfo} to Tek420"
   Traceback (most recent call last) (1669):
     File "C:\Program Files\EventGhost\eg\Classes\ActionBase.py", line 170, in CallWrapper
       return self(*args)
     File "C:\Program Files\EventGhost\plugins\AutoRemote\__init__.py", line 937, in __call__
       message = Message(self, key,text,ttl,password,target,files)
     File "C:\Program Files\EventGhost\plugins\AutoRemote\__init__.py", line 849, in __init__
       self.message = replacePythonCodeAndEncode(text)
     File "C:\Program Files\EventGhost\plugins\AutoRemote\__init__.py", line 647, in replacePythonCodeAndEncode
       print "Error: {" + item + '} does not evaluate to a String. Not replacing: ' + repr(e)
   NameError: global name 'item' is not defined
Maybe I am way off base here but it all seems to work right up until I try to send it to the phone. If someone could lend a hand or point out where I can read some more robust documentation on EventGhost or the AutoRemote plugin I would GREATLY appreciate it!!

Dave
Telorast
Posts: 46
Joined: Wed Feb 27, 2013 2:44 pm

Re: AutoRemote EG Plugin - Send variable info from EG to Pho

Post by Telorast »

It looks like you are trying to send an array of strings. Try sending just one string.
Post Reply