Hi folks,
Iām not a beginner in Home Automation, but Iām a newbie in EnOcean.
My house is 95% KNX equipped, and I wanted to extend the last lights which are not managed through KNX.
At the beginning I wanted to use ZWave, but the proof of concepts didnāt work and I had to give up this technology because of the mesh (not enough equipped)
I saw that EnOcean could fulfil my expectations, but at the moment I cannot control my smart plug
Configuration:
- Raspberry PI 2 with a Raspbian distribution
- EnOcean Gateway USB 310 (This is the same than the USB 300, but with a SMA port (amazon link)
- Smart Plug EnOcean nodOn Type E ASP-2-1-00 (amazon link)
I installed my gateway following the EnOcean Setup Procedure (EnOcean link)
I checked in FHEM and Iām able to see my gateway and to āinteractā with it (get functions)
At this moment, I tried to link my Smart Plug with my Gateway as follows:
First tests
- My environment is clean (no interferences)
- Gateway is plugged in Raspberry PI2
- NodOn Smart Plug is not so far away from the gateway (around 3 meters / 10 feet) without any wall between them (I tried at other distances between 1m/3feet and 6m/20feet, but the result is the same)
- Raspberry reboot and FHEM is automatically launched
- When Raspberry was stable (all services launched), I pressed the ON/OFF button during around 2sec, it was red blinking.
- After around 30 secondes, it went back to green.
- In FHEM, the Smart Plug wasnāt recognized.
- In the logs : NOTHING, except some messages saying the gateway disappeared and reappeared just when I pressed the button on the NodOn Smart Plug.
Communication Sniffing using EnOcean Tools
- I did a factory reset on the Smart Plug to have a clean configuration
- I used EnOcean Dolphin View (Basic et Advanced) under Windows 7 with the gateway plugged on the computer
- When I shortly pressed on the Smart Plug Button, I can see bytes in the logsā¦ That was great ! Because now I know that the communication exists at least from the smart plug to the gateway
- I tried to send a message from Dolphin View to the Smart Plug, but without any success. Iām not saying it doesnāt work, I just think I wasnāt able to correctly use the application (didnāt understand everything)
Communication Sniffing through Raspberry
- Then, I went back on the Raspberry PI2 hosting Raspbian with the gateway physically plugged on it
- I stopped OpenHAB and FHEM and I checked that the gateway was recognized and mounted as /dev/ttyUSB0.
- I executed the āls -l /dev/ttyUSB0ā command, it gave me the following result:
crw-rw---- 1 root dialout 188, 0 dƩc. 2 00:21 /dev/ttyUSB0
and the āidā command gave me:
uid=1001(openhab) gid=1001(openhab) groupes=1001(openhab),5(tty),20(dialout)
so my user belongs to ādialoutā and āttyā groups
I then tried to execute the following commands:
sudo stty -F /dev/ttyUSB0 57600
sudo hexdump -C < /dev/ttyUSB0
And then, I tried to interact with the Smart Plug. I could see bytes sent each time I shortly pressed the ON/OFF button
Again, it means that the communication exists at least from the smart plug to the gateway
And now, Iām trying to reach the ultimate goal : Make it work through OpenHAB2
My item object (I got the Smart Plug Id through Dolphin View) :
Switch E1_Cxx_yy "Living Room Switch" (E1_LIGHTS) {enocean="{id=01:8B:37:26, eep=D2:01:0A}"}
My sitemap object :
...
Text label="Living Room" icon="sofa" {
Frame {
// items
switch item=E1_Cxx_yy
}
}
...
my log file (just concerning EnOcean) :
$ grep -i cean /var/log/openhab2/openhab.log
2016-12-02 16:26:04.822 [DEBUG] [org.openhab.binding.enocean ] - BundleEvent
STARTING - org.openhab.binding.enocean
2016-12-02 16:26:04.829 [DEBUG] [ng.enocean.internal.EnoceanActivator] -
enocean binding has been started.
2016-12-02 16:26:04.952 [DEBUG] [org.openhab.binding.enocean ] - ServiceEvent
REGISTERED - {org.openhab.model.item.binding.BindingConfigReader,
org.openhab.binding.enocean.EnoceanBindingProvider}={component.name=org.openhab.binding.enocean.genericbindingprovider,
component.id=141, service.id=258,
service.bundleid=176, service.scope=bundle} - org.openhab.binding.enocean
2016-12-02 16:26:09.224 [DEBUG] [org.openhab.binding.enocean ] - ServiceEvent
REGISTERED - {org.osgi.service.event.EventHandler,
org.osgi.service.cm.ManagedService}={event.topics=openhab/command/*,
service.pid=org.openhab.enocean, component.name=org.openhab.binding.enocean.binding,
component.id=140, service.id=260,
service.bundleid=176, service.scope=bundle} - org.openhab.binding.enocean
2016-12-02 16:26:09.226 [INFO ] [.enocean.internal.bus.EnoceanBinding] -
Connecting to Enocean [serialPort='/dev/ttyUSB0' ].
2016-12-02 16:26:09.230 [INFO ] [g.apache.aries.spifly.dynamic.bundle] - Bundle
Considered for SPI providers: org.openhab.binding.enocean
2016-12-02 16:26:09.233 [INFO ] [g.apache.aries.spifly.dynamic.bundle] - No
'SPI-Provider' Manifest header. Skipping bundle: org.openhab.binding.enocean
2016-12-02 16:26:09.236 [DEBUG] [org.openhab.binding.enocean ] - BundleEvent
STARTED - org.openhab.binding.enocean
2016-12-02 16:26:09.505 [DEBUG] [.enocean.internal.bus.EnoceanBinding] -
Updating item state for items [E1_Cxx_yy]
2016-12-02 16:26:09.520 [INFO ] [org.opencean.core.ESP3Host ] - starting
receiveRadio..
2016-12-02 16:37:48.237 [DEBUG] [.enocean.internal.bus.EnoceanBinding] -
Checking provider with names [E1_Cxx_yy]
2016-12-02 16:37:57.659 [DEBUG] [.enocean.internal.bus.EnoceanBinding] -
Checking provider with names [E1_Cxx_yy]
Conclusion / Questions
Some questions :
- I understand it is not necessary to associate/link the smart plug with the gateway, as it seems to be automatically done. Is that true ?
- How can I test that the communication from the gateway to the plug correctly works ? Do you have any linux commands to send ?
- I guess there is a problem with the EEP profile (D2-01-A0), I feel that itās like if OpenHab was unable to translate received bytes. Any idea ?
- hexdump behaviour is weirdā¦ sometimes, when I execute the command, it gave me directly the prompt, so no traceā¦ Sometimes it worksā¦ donāt understand the reason
- In conclusion, I donāt understand where is (are) my mistake(s)ā¦ Could you help me please.