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.

Challenge...

If you have a question or need help, this is the place to be.
shaggy79
Experienced User
Posts: 129
Joined: Sun Jul 13, 2014 4:57 pm

Challenge...

Post by shaggy79 »

Hi All,

Me again :roll:

Here goes :P ....
I have a small..... LED message board :P (http://www.dreamcheeky.com/led-message-board)

Is there any way I can link this to EG so :-

* When I Receive a message from 'PushBullet' It tells me I have received a message :?:
* Automatically 'Scroll' the received message :?:

Also Out of interest,
Can anyone think of other things in
EG to use this with :idea: & how :?:

Cheers Paul :shock:
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Challenge...

Post by krambriw »

Basically, you need a plugin. To do that, you first have to have an api and related documentation, you would also need a display during development and testing.

Since this forum management and all development is managed by voluntary forces, the answer to your question depends on certain common circumstances:

1) The first and major one I would say is if there is a wider interest to support a specific device. Everything new and fancy related to media playing seems to have a rather high public interest. Like new fancy remote controls, controlling popular media or music players

2) Secondly, far behind though, some automation that makes life easier

3) The rest, like your example with the LED display, I assume has a rather low common interest so the chance is very little that you find a soul-mate with the same need, willing to write the plugin.

This is my assumption and I might be wrong, you will soon find out, depending on the number of responses you get, whether this will attract the community or not.

Best R Walter
shaggy79
Experienced User
Posts: 129
Joined: Sun Jul 13, 2014 4:57 pm

Re: Challenge...

Post by shaggy79 »

Hi krambriw 8)

Still learning as I go :P Just thought it would be interesting to see what ppl came up with :idea: but by the sounds of it not going to happen :|
Oh and I'm not clued up on these things at all, So I'm sorry to say you lost me at... :oops: :P
To do that, you first have to have an api and related documentation, you would also need a display during development and testing.


Thanks for the reply though.
Paul :P
shaggy79
Experienced User
Posts: 129
Joined: Sun Jul 13, 2014 4:57 pm

Re: Challenge...

Post by shaggy79 »

Hi all,
Is there a way to Copy the highlighted text (in green below), Paste it into a Configuration settings (.ini) file and Save it :?:
PushBullet.Note.Note [u' MESSAGE TEXT ', None, u'ujBpbiH1Dj2sjAy0gRhJdc', '', '2014-08-17 22:26:45']
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Challenge...

Post by Pako »

shaggy79 wrote:Is there a way to Copy the highlighted text (in green below) ...
It is of course possible.
Check out the ConfigParser - Work with configuration files.
Note: Highlighted part you get as eg.event.payload[0] (in python script) or {eg.event.payload[0]} (in dialogue).

Pako
shaggy79
Experienced User
Posts: 129
Joined: Sun Jul 13, 2014 4:57 pm

Re: Challenge...

Post by shaggy79 »

@Pako, 8)

Thanks for the reply,
But after reading through the link you sent, I still have NO idea how to do what I need. :?: :oops:

I have NO idea how to use 'Python' Or what you mean by.. :?:
in dialogue
I have Posted a screen capture of the (.ini) file I want to PASTE & SAVE to (I don't know if that will help explain it better).

PushBullet.Note.Note [u' MESSAGE TEXT ', None, u'ujBpbiH1Dj2sjAy0gRhJdc', '', '2014-08-17 22:26:45']
Where I want to paste the HIGHLIGHTED text to
Where I want to paste the HIGHLIGHTED text to
Cheers Paul. :oops:
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Challenge...

Post by krambriw »

Shaggy, could we please start to organize ourselves a bit? Try to bring up topics in the correct threads otherwise this board will soon look like ... a paintball target

Thanks for your understanding
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Challenge...

Post by Pako »

shaggy79 wrote:I have NO idea how to use 'Python' Or what you mean by..
Write something into an ini file, it is not possible without using a script.
So if you need specific advice, you need to provide more information:
1) Attach ini file in which it is necessary to make an entry (I do not want a screenshot)
2) Specify the path to this file

Pako
shaggy79
Experienced User
Posts: 129
Joined: Sun Jul 13, 2014 4:57 pm

Re: Challenge...

Post by shaggy79 »

@ krambriw, 8)
Sorry pal, Where should of I posted it? :oops:

@Pako, 8)
Thanks for your patience :oops:
The (.ini) file is located in :-
C:\Program Files\Dream Cheeky\LED Message
And here is the (.ini) file:-
LED.ini
(7.58 KiB) Downloaded 199 times
Thanks Again,
Paul. :oops:
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Challenge...

Post by Pako »

Here is the solution.
shaggy79 - Dream Cheeky LED display.png
shaggy79 - Dream Cheeky LED display.png (4.04 KiB) Viewed 7521 times

Create a macro as shown.
The content of Python script is here:

Code: Select all

from ConfigParser import SafeConfigParser
iniFile = "C:\\Users\\XXXXXXXXXX\\Documents\\LED.ini"
#iniFile = "C:\\Program Files\\Dream Cheeky\\LED Message\\LED.ini"
section = "MessageInformation"
option = "TextMessageContent2"
cp = SafeConfigParser()
cp.read(iniFile)
if cp.has_option(section, option):
    #optionContent = cp.get(section, option,True)
    #print "optionContent =", optionContent
    cp.set(section, option, str(eg.event.payload[0]))
    fp = open(iniFile, 'wb') 
    cp.write(fp) 
    fp.close()    
Notes:
1) It does work, but (in my case) there is a problem with permissions to write the file. I had to move the file to the folder "Documents". I suppose that you'll have the same. I do not know if you can install the program in the Documents folder.
2) Maybe you notice that the contents of the file LED.ini looks different (lines are in a different order). This is normal and it should not matter.
3) I agree with Walter. See for yourself how many topics you have used for solving a single problem.
Pako
shaggy79
Experienced User
Posts: 129
Joined: Sun Jul 13, 2014 4:57 pm

Re: Challenge...

Post by shaggy79 »

Pako, 8) 8)

Thank you, So So much. :wink:
It works perfect :D with no permission issues my end :?: :D

Sorry about the multiple topics...... I've removed one, I think this is the only one left now.

Again many thanks.
Paul :P
shaggy79
Experienced User
Posts: 129
Joined: Sun Jul 13, 2014 4:57 pm

Re: Challenge...

Post by shaggy79 »

Pako wrote:Here is the solution.
shaggy79 - Dream Cheeky LED display.png

Create a macro as shown.
The content of Python script is here:

Code: Select all

from ConfigParser import SafeConfigParser
iniFile = "C:\\Users\\XXXXXXXXXX\\Documents\\LED.ini"
#iniFile = "C:\\Program Files\\Dream Cheeky\\LED Message\\LED.ini"
section = "MessageInformation"
option = "TextMessageContent2"
cp = SafeConfigParser()
cp.read(iniFile)
if cp.has_option(section, option):
    #optionContent = cp.get(section, option,True)
    #print "optionContent =", optionContent
    cp.set(section, option, str(eg.event.payload[0]))
    fp = open(iniFile, 'wb') 
    cp.write(fp) 
    fp.close()    
Notes:
1) It does work, but (in my case) there is a problem with permissions to write the file. I had to move the file to the folder "Documents". I suppose that you'll have the same. I do not know if you can install the program in the Documents folder.
2) Maybe you notice that the contents of the file LED.ini looks different (lines are in a different order). This is normal and it should not matter.
3) I agree with Walter. See for yourself how many topics you have used for solving a single problem.
Pako
How much of a pain would this be to modify to work with other 'types' of pushes from PushBullet :?:
like:-
* List
* Adresses

Paul :roll:
shaggy79
Experienced User
Posts: 129
Joined: Sun Jul 13, 2014 4:57 pm

Re: Challenge...

Post by shaggy79 »

Hi all,
I have searched through the forum for 2 days and can't find anything to help me?..
How can I modify this code to put the 'Event name' instead of the 'message body'.
As the event name is the 'Subject' header of the message.
At the moment the red text is what I get on the LED message board.
Now I need the subject of the message instead (green text).
PushBullet.Note.Note (Message Text)

Code: Select all

from ConfigParser import SafeConfigParser
iniFile = "C:\\Users\\XXXXXXXXXX\\Documents\\LED.ini"
#iniFile = "C:\\Program Files\\Dream Cheeky\\LED Message\\LED.ini"
section = "MessageInformation"
option = "TextMessageContent2"
cp = SafeConfigParser()
cp.read(iniFile)
if cp.has_option(section, option):
    #optionContent = cp.get(section, option,True)
    #print "optionContent =", optionContent
    cp.set(section, option, str(eg.event.payload[0]))
    fp = open(iniFile, 'wb') 
    cp.write(fp) 
    fp.close()    
Thanks,
Paul.
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Challenge...

Post by jonib »

shaggy79 wrote:As the event name is the 'Subject' header of the message.
At the moment the red text is what I get on the LED message board.
Now I need the subject of the message instead (green text).
PushBullet.Note.Note (Message Text)
Use "eg.event.string" to get the event string, if you need the last part only you need to separate it first.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
shaggy79
Experienced User
Posts: 129
Joined: Sun Jul 13, 2014 4:57 pm

Re: Challenge...

Post by shaggy79 »

Hi Jonib,
Thanks for the reply :D .
I did not write the original code (I don't know how to :oops: ). So I have no idea what or how to do it :?:

"Use "eg.event.string" to get the event string, if you need the last part only you need to separate it first."

You are correct I only need the last part (Green Text) 'PushBullet.Note.Note'.
I was hoping someone could modify the original code to what I needed :P .

Again Thanks Jonib.
Paul.
Post Reply