element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Forget Me Not Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Forget Me Not Design Challenge
  • More
  • Cancel
Forget Me Not Design Challenge
Blog Forget_me_not : My Smart Home Post#5 Week-4 Smart Mailbox with email and tweet support
  • Blog
  • Forum
  • Documents
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: ravi_butani
  • Date Created: 28 Aug 2014 6:16 AM Date Created
  • Views 618 views
  • Likes 1 like
  • Comments 4 comments
  • forget_me_not
  • raspberry-pi-b+
  • openhab
  • tektronix
  • enocean
  • iot_homeauto
Related
Recommended

Forget_me_not : My Smart Home Post#5 Week-4 Smart Mailbox with email and tweet support

ravi_butani
ravi_butani
28 Aug 2014

Table of Contents


In my previous post Forget_me_not : My Smart Home Post#4 Week-3 Pi, Enocean Sensors, openHAB, remote URL and email notification I have shared working with enocean sensors, OpenHAB, Remote URL and Email notifications setup.

 

In this week I have designed Smart mailbox with twitter and email notifications for my project “My Smart Home”.

 

I have implemented twitter action as steps given in this link....https://github.com/openhab/openhab/wiki/Actions

 

In raspberyy-pi I cant manage to get authantication from twitter using these steps.. But I am able to get authentication from twitter using same steps on openHAB running on my windows laptop.

 

Simply I have copied openhab/etc/twitter.tokan file generated after successful twitter authentication from my windows laptop to same location on raspberry-pi.

 

Bingo...!!! every thing works great.. but suddenly I have noticed that Twitter not allows to tweet same message... so every tweet should be unique..

So finally I have decided to use time stamp with my tweet which is obviously unique and meaningful to..

 

My mailbox prototype is only for demonstration, I will be buying real mailbox and will use enocean reed contact sensor with that mail box..Also I am planning to put another enocean reed contact sensor at back of mailbox where mail collection door is located.

So for every new mail I will be getting notification with count of new mail in my mailbox and when mail collect door opens these count automatically reset to zero.

 

Here is short demonstration of Smart Mailbox with tweet and email support

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Here are some build and setup pics...

 

image

imageimageimageimageimage

As you can see in Android screen shot of email and twitter notification, twitter notification is very fast compare to email notifications, almost there is two minute difference between email and twitter notification.

 

Here is my demo.rules file

import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*
import org.openhab.binding.*
import org.openhab.action.*
import org.apache.commons.mail.*
import java.util.Date




/**
* This rule sends email and tweet to home owner when doorbell switch pressed with photo as attachment
* here execute command line is just for demo it actually takes photo from PI Camera and save this image in specified folder
* So far I am waiting for PI camera so its not implemented
*/
rule "send mail doorbell"
  when
  Item EnOcean_switch_A received update ON
  then
  var String tweet_doorbell="Doorbell:You have new visitor at home (" + new Date + ")"
  sendTweet(tweet_doorbell)
  sendMail("ravi.butani03@gmail.com", "My Smart Home (Doorbell)" , "You have a visitor...!!","http://localhost:8080/images/ondoor.png")
  executeCommandLine("/opt/openhab/a.out")
end


/**
* This rule sends email to home owner when new mail dropped in mail box
*/
rule "send mail update Mailbox "
  when
  Item EnOcean_contact received update OPEN
  then
  var String tweet_mailbox="Mailbox : You have new mail (" +new Date + ")"
     sendTweet(tweet_mailbox)
  sendMail("ravi.butani03@gmail.com", "My Smart Home (New Mail)" , "You have new mail in your mail box...!!")
  executeCommandLine("/opt/openhab/a.out")
end

 

I am using java.util.Date package to get time stamp....

 

And I have Good news, I have received Tek Scope and Enocean Programmer with few of other Parts...Now I can move ahead much faster with received parts.

<< Previous

Home

Next >>

  • Sign in to reply

Top Comments

  • mcb1
    mcb1 over 11 years ago +1
    Nice work. The budding helper is a bonus. Mark
  • DAB
    DAB over 11 years ago +1
    It is never too soon to get a kid interested in engineering. Once hooked, he can join the rest of us in a lifetime of learning. DAB
  • ravi_butani
    ravi_butani over 11 years ago in reply to DAB

    Agree...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 11 years ago

    It is never too soon to get a kid interested in engineering.

     

    Once hooked, he can join the rest of us in a lifetime of learning.

     

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • ravi_butani
    ravi_butani over 11 years ago in reply to mcb1

    Ha..Ha..Ha..image very true...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mcb1
    mcb1 over 11 years ago

    Nice work.

    The budding helper is a bonus.

     

    Mark

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube