I’ve made a plugin that toggles the state of a sensor based on whether emails are matched in your Gmail account according to a defined pair of labels.
Here is an example use case for location based events from an iPhone. I initially tried the Latitude plugin but found it used too much memory on my Vera Lite. I didn’t want to use the FindMyPhone plugin as I did not want to enter my iCloud password into Vera.
Create a dedicated Gmail account for home automation alerts
Setup notifications in the FindFriends app on your iOS device for when you leave and arrive at a location (e.g. Home). Set the Gmail email address as the recipient. Remember to create repeating alerts.
Leave the location and return to trigger the notifications, or manually trigger from the app (hard to do for the Away notification if you are at home!)
Log in to the Gmail account and create Filters that match the home and away notifications. You need to configure the filters to attach a Label, e.g. “home”, “away” automatically. Choose to apply the Filter to the current message inbox and check that the Labels are populated.
Download the package from github and upload all files except the README to Vera, using Apps/Develop Apps/Luup files
Create an instance of the plugin using the Apps/Develop Apps/Create Device option. The device type is “urn:chrisbirkinshaw-me-uk:device:GMailSensor:1” and the device file name is “D_GMailSensor1.xml”
Reload vera, wait until it has completed, then refresh the page in your browser
Edit the parameters in the Advanced tab of the new device: Username, Password, OnLabel, OffLabel. The Labels need to match the ones you created before in Gmail.
Well it uses the Apple Find Friends app to generate the email notifications that serve as the trigger. I have been running this app since I got my phone, as I send my girlfriend alerts when I get home or pass close to her place of work. I’m not really sure how this impacts the battery.
The main reason I went this route was security. At one point I used IFTTT, but I didn’t like having my Vera password stored there.
If you ever want to spin off another, or just share the code to do this, but I’ve been looking for AGRs for something that could monitor a gmail account for new mail; and the then using the Say command on a Sonos tell “you have new mail, from xxxxxxxx@xxx.com with the subject line xxxxxxxxx”
Thanks. can anyone point me in the right direction to mod it so i can use it with standard vera scenes? i don’t use PLEG (at least not yet). Any help would be much appreciated.
Thanks, Chris for creating this plug-in! Exactly what I was looking for!
I’m just hacking away at it, but using UI7 to be able to use this in a Scene as a trigger, I just simply replaced the full contents of the D_GMailSensor1.json with the contents of the D_MotionSensor1.json file. (Apps->Develop Apps->download the D_MotionSensor1.json file)
That did it. Now I could use it flawlessly in a scene without the need for PLEG.
Next up… if anyone want to try it… want to get the Google API with Oauth working so that the GMail account security settings don’t need to be off to make this work.
If you are having trouble using the plug-in, it’s because you need to Turn ON access to “less secure scripts” here https://www.google.com/settings/security/lesssecureapps
I’d rather avoid that, so if anyone knows how to modify this app to use Oauth, please shout out!
Best Home Automation shopping experience. Shop at Ezlo!