- [INDEX]
- Introduction and project description
- Sensor Node and Gateway Design
- How I use OpenHAB - audio notification and dashboards
- Design detail for wireless sensor nodes and gateway
- Uber Sensor - wireless sensor for fire, smoke, gas, barking, light, movement
- Diaper Box Sensor
- Laundry Room Sensor
The small size and energy harvesting capability means it fits in small places, like the diaper wipe box. We’re always forgetting to close the diaper wipe box and it dries out. The EnOcean reed switch sensor is great for monitoring if the top is left opened too long. And you can use OpenHAB on the Pi to remind you to close it.
OpenHAB Item Definition:
Contact itm_baby_wipe "Baby Wipe [%s]" <contact> (All) {enocean="{id=01:81:3C:A4, eep=D5:00:01, parameter=CONTACT_STATE"}
OpenHAB Sitemap - though not really needed unless you want to remotely view diaper box status
T
ext item=itm_baby_wipe
OpenHAB Rule - this is where the timer is used to determine when to alarm. Adjust timer length to whatever you want.
var Timer door_timer = null var boolean door_left_open = false var boolean door_first_time = false rule "baby wipes" when Item itm_baby_wipe changed then if (door_timer != null) door_timer.cancel() if (itm_baby_wipe.state == OPEN) { door_left_open = true door_timer = createTimer(now.plusSeconds(60)) [| say("Baby Wipe Door Left Opened") door_first_time = true ] } else { door_left_open = false door_first_time = false } end rule "Check every 2 minutes" when Time cron "0 0/2 * * * ?" then if ((door_left_open == true) && (door_first_time == true) { say("Door still left open") } end
If someone could tell me how to put the code in those nice code blocks like the other people in this competition, I'd appreciate it! Thanks Mark!
Also, thanks very much to Kimmo for helping me with my EnOcean issues earlier.