I would like to reboot my raspberry pi by sending a email to a gmail account.
I already have the reboot task set up but can not figure out how to (or if it is possible) to have robotask
1: check a gmail account.
2: If subject = reboot1 -> run rebootpi task
3: delete emails
4: repeat...
Thanks,
Ryan
Check emal for subject line if match -> run task.
Re: Check emal for subject line if match -> run task.
See example below.
It checks INBOX in Gmail server
If it encounter the message with subject "reboot1" it shows the notification and removes the message from server.
You can put the "Start task" action instead of (or after) the notification.
Save the text of the task into a file and use menu Task->import to import ino RoboTask.
Of course you have to specify yourown login parameters in 1-st step.
This task uses IMAP protocol. You have to be ensure that IMAP is turned on on your Gmail account.
It checks INBOX in Gmail server
If it encounter the message with subject "reboot1" it shows the notification and removes the message from server.
You can put the "Start task" action instead of (or after) the notification.
Save the text of the task into a file and use menu Task->import to import ino RoboTask.
Of course you have to specify yourown login parameters in 1-st step.
This task uses IMAP protocol. You have to be ensure that IMAP is turned on on your Gmail account.
Code: Select all
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|317955339
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task372"
Hide=INTEGER|0
ID=INTEGER|1169879263
LogOnAsUser=INTEGER|1
Name=STRING|"Reboot if subject reboot1"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0
[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER
[Actions\Action1]
ActionID=STRING|"A_IMAP_OPEN"
Enabled=INTEGER|-1
Name=STRING|"IMAP Open"
Params=FOLDER
[Actions\Action1\Params]
folder=STRING|"INBOX"
host=STRING|"imap.gmail.com"
password=STRING|"2825928814293282984228557"
passwordmode=STRING|"1"
port=STRING|"993"
SSL=STRING|"1"
user=STRING|"mail.user@gmail.com"
[Actions\Action2]
ActionID=STRING|"A_IMAP_LOOP"
Enabled=INTEGER|-1
Name=STRING|"IMAP Mail loop"
Params=FOLDER
[Actions\Action2\Params]
number=STRING|"msgnum"
subj=STRING|"msgsubj"
usecc=STRING|"0"
usedate=STRING|"0"
useflags=STRING|"0"
usefrom=STRING|"0"
usesize=STRING|"0"
usesubj=STRING|"1"
useto=STRING|"0"
[Actions\Action3]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER
[Actions\Action3\Params]
case=STRING|"0"
operator=STRING|"0"
type=STRING|"0"
value1=STRING|"{msgsubj}"
value2=STRING|"reboot1"
[Actions\Action4]
ActionID=STRING|"A_ROBOTASK_ALERT"
Enabled=INTEGER|-1
Name=STRING|"Show Notification"
Params=FOLDER
[Actions\Action4\Params]
defh=STRING|"1"
defw=STRING|"1"
duration=STRING|"10"
height=STRING|"76"
icon=STRING|"1"
kind=STRING|"0"
message=STRING|"Reboot required"
position=STRING|"3"
title=STRING|"Reboot"
width=STRING|"330"
[Actions\Action5]
ActionID=STRING|"A_IMAP_SETFLAGS"
Enabled=INTEGER|-1
Name=STRING|"IMAP Set Message Flags"
Params=FOLDER
[Actions\Action5\Params]
answered=STRING|"2"
deleted=STRING|"1"
draft=STRING|"2"
flagged=STRING|"2"
msgnum=STRING|"{msgnum}"
recent=STRING|"2"
seen=STRING|"2"
[Actions\Action6]
ActionID=STRING|"A_IMAP_PURGE"
Enabled=INTEGER|-1
Name=STRING|"IMAP Delete Marked Messages"
[Actions\Action7]
ActionID=STRING|"A_LOOP_BREAK"
Enabled=INTEGER|-1
Name=STRING|"Break"
[Actions\Action8]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"
[Actions\Action9]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
Oleg Yershov
Re: Check emal for subject line if match -> run task.
Thank You So Much!
I will give this a shot tonight!
I will give this a shot tonight!
Re: Check emal for subject line if match -> run task.
I imported it But it says no events.
I just copied the text into a notepad file and saved as a .tsk

Edit: I checked my robotask and i do not have Imap options. I am running 5.2.1.681 patch #2 for 5.2 I see Imap was added in 5.8 If i update will I still be ok? I think I tried to update to 6.0 but needed to update my lisence as well?
I just copied the text into a notepad file and saved as a .tsk

Edit: I checked my robotask and i do not have Imap options. I am running 5.2.1.681 patch #2 for 5.2 I see Imap was added in 5.8 If i update will I still be ok? I think I tried to update to 6.0 but needed to update my lisence as well?
Re: Check emal for subject line if match -> run task.
You can simply attach Cyclic event with necessary period (for example 2-5 min)I imported it But it says no events.
I will write the example with POP3 actions a bit later. It should work.... i do not have Imap options ...
I'm afraid that no. I can say more exact if you tell me your license information to oleg(at)robotask.com or to private message. I can't find your license by your nickname or email.I think I tried to update to 6.0 but needed to update my lisence as well?
In any case you can purchase only "1 year of free updates" to use latest version (latest is 6.2 now) See here all payment options
Oleg Yershov
Re: Check emal for subject line if match -> run task.
You do not need to update it to POP3 I will update the software. It is the least I can do!
ryan
ryan
Re: Check emal for subject line if match -> run task.
Look at this example. Change authentication parameters to yours at 1-st step
Code: Select all
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|1
CatID=INTEGER|317955339
Comment=STRINGLIST
ContinueOnError=INTEGER|0
Events=FOLDER
ExternalName=STRING|"Task1111"
Hide=INTEGER|0
ID=INTEGER|30082062
LogOnAsUser=INTEGER|1
Name=STRING|"Reboot if subject reboot1 (POP3)"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0
[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
[Actions\Action1]
ActionID=STRING|"A_EMAIL_OPEN"
Enabled=INTEGER|-1
Name=STRING|"POP3 Open"
Params=FOLDER
[Actions\Action1\Params]
host=STRING|"pop.gmail.com"
password=STRING|"2825230356301013035729068"
passwordmode=STRING|"0"
port=STRING|"995"
SSL=STRING|"1"
user=STRING|"gmail.user@gmail.com"
[Actions\Action2]
ActionID=STRING|"A_EMAIL_LOOP"
Enabled=INTEGER|-1
Name=STRING|"POP3 Mail Loop"
Params=FOLDER
[Actions\Action2\Params]
number=STRING|"msgnum"
subj=STRING|"msgsubj"
usecc=STRING|"0"
usedate=STRING|"0"
usefrom=STRING|"0"
usesize=STRING|"0"
usesubj=STRING|"1"
useto=STRING|"0"
[Actions\Action3]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER
[Actions\Action3\Params]
case=STRING|"0"
operator=STRING|"0"
type=STRING|"0"
value1=STRING|"{msgsubj}"
value2=STRING|"reboot1"
[Actions\Action4]
ActionID=STRING|"A_EMAIL_DELETE"
Enabled=INTEGER|-1
Name=STRING|"POP3 Delete Email"
Params=FOLDER
[Actions\Action4\Params]
num=STRING|"{msgnum}"
[Actions\Action5]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""Reboot required"""
Params=FOLDER
[Actions\Action5\Params]
icon=STRING|"1"
msg0=STRING|"Reboot required"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"
[Actions\Action6]
ActionID=STRING|"A_LOOP_BREAK"
Enabled=INTEGER|-1
Name=STRING|"Break"
[Actions\Action7]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"
[Actions\Action8]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
[Events]
Event1=FOLDER
[Events\Event1]
Enabled=INTEGER|-1
EventID=STRING|"E_GENERAL_CYCLIC"
Params=FOLDER
UnigueID=INTEGER|16445953
[Events\Event1\Params]
interval=STRING|"300"
notsatrtatactivation=STRING|"0"
Oleg Yershov
Re: Check emal for subject line if match -> run task.
This worked good BUT did not delete the email. so it just keeps running and rebooting every time it runs.
Any ideas on why or how to delete the email.
Any ideas on why or how to delete the email.
Re: Check emal for subject line if match -> run task.
I tested the task on my Gmail account. It deletes the message successfully.
Maybe you need to tune Gmail settings? See screenshot below
Maybe you need to tune Gmail settings? See screenshot below
Oleg Yershov
Re: Check emal for subject line if match -> run task.
That did it!1 Thanks!!