I am using Enocean Pi to sense if a door has been opened or closed. I decided to use the Raspberry Pi B and Raspbian as the operating system. I also installed FHEM for testing. Changes to Jessie seems to have altered the serial port for the Raspberry Pi. The serial port /dev/ttyAMA0 is missing in the update.
This is the third component to my project. The actuator is a reed or contact sensor. No batteries required or wiring for Enocean sensors.
Installation of FHEM:
sudo apt-get install perl libdevice-serialport-perl libio-socket-ssl-perl libwww-perl
sudo apt-get install -f
wget http://fhem.de/fhem-5.7.deb
sudo dpkg –i fhem-5.7.deb
http://<RaspberryIP>:8083/fhem
I clicked on the learning button on the contact sensor and now have a room called Enocean. The contact sensor is given a unique ID. When I bring the magnet close to the contact sensor and then move it away that state will change.
The idea is to provide an inexpensive way of providing alerts if a door or window has been opened. Looks like every thing is configured correctly so I install Node Red.
wget http://node-arm.herokuapp.com/node_latest_armhf.deb
sudo dpkg -i node_latest_armhf.deb
sudo apt-get install build-essential python-rpi.gpio
hash -r
If you are using Raspbian then an additional step must be taken:
sudo apt-get install gcc-4.8 g++-4.8
Next:
sudo npm cache clean
sudo npm install -g --unsafe-perm node-red
I had experimented with TheThingBox and liked their Enocean node . So I installed the node and had some unexpected results.
Install Node:
npm install ttb-enocean
But the Enocean nodes that did displayed worked !
The configuration of the Enocean Node looks like this:
The payload was not what I expected. But I can work with this. I added Freeboard node to the flow:
cd ~/.node-red
npm install node-red-contrib-freeboard
Now that I have a rather unexpected result in the payload . I was expecting this:// 1BS sensor telegram msg.ID // EnOcean device/chip ID
msg.state // 8 open or 0
// 9 close or 1
Next: Set Up Dashboard for Enocean Reed Sensor
I had to set up a Dweet Thing for the contact sensor.
Now back to Freeboard:
I added an Indicator Light to the dashboard to warn if the door is open.
Now install Dweetio Node:
cd ~/.node-red
npm install node-red-node-dweetio
I noticed that the datasource for the Enocean Pi was not updating in real time. As I moved the magnet close to the sensor nothing happened. Once I started to send the msg.payload to my Dweet then it worked. The Open State means the magnet is away from the sensor so the Door is open. The Closed State means the magnet is close to the sensor so the Door is closed. Here's a short video of testing the sensor:
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.