In my previous post Forget_me_not : My Smart Home Post#3 Week-2 Enocean Sensors and openHAB I have shared working with enocean sensors and FHEM.
In this week I am very satisfied with my progress for my project "My Smart Home"
Major Progress of this week
* Working With OpenHAB and Enocean Sensors
* Setting Up Email notifications
* Setting Up remote URL (using IP address, not using domain name)
I have used this link https://github.com/openhab/openhab/wiki as great help for this work....
* Working with OpenHAB and Enocean Sensors and Setting-up email notifications :
My working OpenHAB URL on desktop....
working openHAB url and OpenHAB android application on my cell phone
working script with email notification
notifications received on my email id
Edited this line in start.sh so enocean pi is able to communicate with openhab
-Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0
My Edited openhab.cfg file with these lines for configure email notification
######################## Mail Action configuration (ADDED) ############################ mail:hostname=smtp.gmail.com mail:port=587 mail:username=yourusernamewithout_domain_name mail:password=yourpassword mail:from=your mail ID with domain Name mail:tls=true ################ EnOcean Binding############### # # EnOcean USB adapter serial port enocean:serialPort=/dev/ttyAMA0
My demo.rules file is here..
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.* /** * This rule sends email 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 received update ON then sendMail("ravi_butani@yahoo.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 CLOSED then sendMail("ravi_butani@yahoo.com", "My Smart Home (New Mail)" , "You have new mail in your mail box...!!") end
My demo.sitemap file is here
sitemap demo label="My Smart Home" { Frame label="EnOcean" { Switch item=EnOcean_switch Text item=EnOcean_sensor valuecolor=[>25="orange",>15="green",>5="orange",<=5="blue"] Text item=EnOcean_contact } Frame label="Date" { Text item=Date } Frame label="Who is on Door... ?" { Image url="http://localhost:8080/images/ondoor.png" label="openHAB" } }
now I am able to see events on my openHAB url in Home network as well as remote network and email notifications too on my email address..
here is android application https://play.google.com/store/apps/details?id=at.bherbst.net&hl=en I am using for Portforwarding for setup remote URL As I have not wi-fi router available at Home to setup remote URL...
I have also Attached my configuration folder here..
And still I am waiting for Enocean programmer and TEK DSO to set up my electronics hardware Part, And Pi camera for taking photo of visitor on Door ...This delay will not cause any problem because I am very confident about my electronics hardware design and debug skills..
Still there is long way to go..and I am learning a lot....every next step comes with lots of Fun and Excitement ...