Author Topic: Gmail notifier - Using IP camera email notifications to trigger events in VC  (Read 30654 times)

0 Members and 1 Guest are viewing this topic.

Soda97

  • Contributor
  • ***
  • Posts: 69
  • Karma: 1
    • View Profile
Thanks guys.  I will check out the links. They are a lil confusing to me.

I only know Envisalink got its own web portal and able to send emails.

If I want to  try to use the gmail notifier instead, what do I do with the xml file.


Thanks.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Yeah, it would make more sense to start with the "getting started" page, the video tutorials, and the FAQ before getting into the details of events, if you are new to this kind of thing.

Links to everything you need to know about XML on the forum, the FAQ, links to video tutorials, etc. are all provided on the Support page and menu of voxcommando.com. http://voxcommando.com/home/

On the wiki, scan the left-hand margin. It links to all the important pages: XML on the forum, Plugins, Video Tutorials, etc.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
If I want to  try to use the gmail notifier instead...

This will also have a delay of 2 - 30 seconds (probably).

Soda97

  • Contributor
  • ***
  • Posts: 69
  • Karma: 1
    • View Profile
Yes, so I copied the XML code and it created a group called alarm.

Can tell me what did I do wrong. It's not checking email I think.  How can I tell is running in the background?

I went to py editor to input my id and pw.  When I execute it said ok but no result.

I restarted VC too and it exec the py file.  I tried to email myself with subject motion detected but just nothing happen.





nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
That sounds like you're off to a pretty good start.

The python file should be placed in your VC directory's PY folder. Is that where it is?

When you copied the XML to your command  tree, did you save and exit the tree? When the gmail notifier triggers an event "newMail", this event will appear in the history panel of VC. However, if you haven't saved and exited your tree, the event won't actually trigger the command. So, it may be that the event appeared, but you didn't notice it because it didn't do anything.

If it's still not doing anything after following the steps above, please repeat the exercise with VC logging enabled, and post the log for us (attach it to your post). http://voxcommando.com/mediawiki/index.php?title=Log

By this I mean, restart VC, then send your gmail account another message with "motion detected" as the subject. Then post the log so that we can see what is or isn't occurring.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
By the way, I believe that the script logic is case sensitive (I should fix that, but anyhow), so when you send your message the subject line should be exactly as it is in the script: motion detected

If you send a message with the subject Motion detected, the script will currently not trigger the event in VC.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

Soda97

  • Contributor
  • ***
  • Posts: 69
  • Karma: 1
    • View Profile
it saved to my downloads so i redirected to my downloads directory.  Only other thing i changed in the py script was the delay from 30 to 3 sec.

I already saved, exited and restarted the VC.

I dont know what else I did wrong, I attached the log file.

I just tried with exact case but still no luck :(

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
In the "launch gmail notifier python script" command in your command tree, change the file path to include the actual file name for the python script, so:

Currently you have: c:\users\soda\downloads

It should say: c:\users\soda\downloads\gmail_notifier.py

(assuming you didn't change the file name of the python script)

Then save your tree, restart VC, and try again. :)
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Sorry for the confusion, I am multitasking today and not very observant. I see that now that the file path was correct.

I'm not sure what the problem is at this point. The log is not helping. I'll get back to you.

... But can you just confirm for me that when you sent me the last log, you'd launched VC and then successfully sent an email with the subject line motion detected to your gmail account, waited for a period of time, and then posted the log?

Because in the log file you sent, the python script was loaded, and there's only another 1 and half minutes of logging in the log. It seems like it might be difficult to send yourself an email in that time.
« Last Edit: January 07, 2015, 02:38:27 PM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
In the python script.

gusr should be your user name, but should not have "@gmail.com"

If my gmail address is voxcommando@gmail.com and my password is myPassword, those lines should read:

gusr="voxcommando"
gpwd="myPassword"
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

Soda97

  • Contributor
  • ***
  • Posts: 69
  • Karma: 1
    • View Profile
yes the id and pw are correct.

i just saw this in the log, anything to do with it?

1/7/2015 1:39:54 PM   974   [plugin] Web Exception while calling JSON RPC:{"jsonrpc": "2.0", "method": "GUI.ShowNotification", "params":{"title":"Hi honey I'm home (94.1)","message":"(1 Cancel away mode) "},"id": "0"}
System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:8080
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
   at System.Net.HttpWebRequest.GetRequestStream()
   at vcPlugin.xJsonHttpCommunicator.PostRequest(String strRequest)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
That's not in the log file you posted before, is it? I don't see that.

Are you using the xml I posted above exactly as is, or have you made changes to the command?

If the latter, can you please post the xml for the command(s) you are trying to use. Also, please post the log file where you saw that error message (which looks like an XBMC-related message).

Without seeing the whole log, I can't say for sure, but my impression is that you issued the command "Hi honey I'm home".

The error message isn't relevant to the gmail notifier. It means that VC tried to send a message to XBMC but XBMC wasn't there -- whether because XBMC isn't running right now, or you don't have VC configured properly for your XBMC installation or whatever.


« Last Edit: January 07, 2015, 03:21:57 PM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

Soda97

  • Contributor
  • ***
  • Posts: 69
  • Karma: 1
    • View Profile
The only thing i changed in the xml code was the py path.  Everything else remain the same.

o i'm watching tv right now and it's trying to pick up any of the phrases.

yes i didnt setup/use xbmc and i disabled all other commands.
« Last Edit: January 07, 2015, 03:40:42 PM by Soda97 »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
I'm out of ideas. If you like, you can private message me your gmail address, leave VC running, and I can try to send you message to see if it makes a difference.

It may be that we need to screen share  to see what is happening on your computer.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
 :bonk :bonk

Why didn't anyone tell me the script in the first post wasn't working for them? Sheesh.

I have the same script in my configuration but with one subtle BUT IMPORTANT difference. All morning I've been testing with a different version of the code.

Apparently, I had uploaded the wrong version of the file back in July. I've now uploaded the fixed script in the first post.

Thanks to new user Soda for persevering. And for those of you who are trying forum scripts and not getting them to work: Please let me know!

TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)