Difference between revisions of "EasyNotifications"

From Let's Control It
Jump to navigation Jump to search
Line 44: Line 44:
  
 
The capacitor will make sure it doesnt stay in reset-mode if the switch closed for a longer time.
 
The capacitor will make sure it doesnt stay in reset-mode if the switch closed for a longer time.
 +
 +
=== ESPEasy settings ===
 +
 +
* Enable deep sleep with a sleep time of 0 seconds. (this way it only wakes up manually by the switch)
 +
* Enable '''Sleep on connection failure'''
 +
* Set message delay to 0.
 +
* Add an email notification.
 +
* Enable rules.
 +
* Create a rule that mails you on system boot, like this:
 +
on System#Boot do
 +
  notify 1
 +
endon
 +
* Consider compiling ESPEasy with FEATURE_ADC_VCC. (enable it in ESPEasy.ino) This way you can add a sysinfo task that sends the battery level to your homecontroller, every time it wakes up.

Revision as of 23:20, 4 June 2017

ESPEasy notifications

ESPEasy notifications are to be used in combination with rules.

For example, to send a message on system boot use a rule like this:

on System#Boot do 
   notify 1,system is started
endon

Creating a paper-mail to email gateway

I used notifications in combination with Deep Sleep to create a system that notifies me when I have new paper mail in my actual mailbox:

Espmailbox.jpg

Espmailbox2.jpg


Hardware

  • Core: A bare esp-12-f. Not a development board, so it has voltage regulator and usb-to-serial interface that draws current while sleeping.
  • Casing: Google for Waterproof Clear Cover Plastic Electronic Box Project
  • Magnetic microswitch: Google for something like 10pcs/lot Wired Door Window Magnetic Sensor Switch

For power I used an old powerbank, those you use to charge your phone. Most power-banks use lithium cells that are a perfect 3.3 volts. And they are easy to charge as well. :)

Wiring

  • You need to connect some extra pins to VCC or GND if you use a bare ESP-12-f, google for this. :)
  • Connect D0 to vcc, to ensure the device goes into deep sleep. (connect to GND to disable deep sleep)
  • Connect the magnetic switch:
    • Connect one side of the magnetic switch to GND.
    • Connect the other side of switch it to the - side of a capacitor (4u7), with a 1 meg. resistor in parallel.
    • Connect those the the RST pin.

This will wake up the ESPEasy from deep sleep when the magnetic switch is closed.

An awesome "schematic" of the switch-part:

[ GND ] --- [ magnetic switch ] -----+- [ 4u7 capicitor ] --+-- [ ESP8266 RST pin ] 
                                     |                      |
                                     ---[ 1M resistor   ] ---

The capacitor will make sure it doesnt stay in reset-mode if the switch closed for a longer time.

ESPEasy settings

  • Enable deep sleep with a sleep time of 0 seconds. (this way it only wakes up manually by the switch)
  • Enable Sleep on connection failure
  • Set message delay to 0.
  • Add an email notification.
  • Enable rules.
  • Create a rule that mails you on system boot, like this:
on System#Boot do 
 notify 1
endon
  • Consider compiling ESPEasy with FEATURE_ADC_VCC. (enable it in ESPEasy.ino) This way you can add a sysinfo task that sends the battery level to your homecontroller, every time it wakes up.