Recently I tried to connect some ESP-01 modules to connect to my Openhab 1.80.
OpenHab is running fine with some (software) bindings like weather etc.
Now it was time to connect some hardware and choose the ESP-01 with ESPEasy to control some stuff around the house.
After some struggling (installing broker (mosquitto) and programming the ESP-01), I was able to control a led via Openhab on the ESP-01.
So far so good but I also want to monitor some pir (motion) sensors using the 'switch' functionality in ESPEasy and that's where the problems begins.
I tried almost everything in OpenHab and ESPEasy but cannot get the thing to work, I searched the internet but cannot find a good (working) example on how to do this.
Is there anyone who can help me setting up a motion sensor using ESPEAsy (R78) and OpenHab (1.80) ?
OS = Windows 7 ENG
In .sitemap I have :
Code: Select all
Frame label="MQTT Test"{
Switch item=MQTTLED
Text item=MotionBackyard
}
Code: Select all
Switch MQTTLED {mqtt=">[mybroker:/device180/gpio/2:command:ON:1],>[mybroker:/device180/gpio/2:command:OFF:0]"}
Contact MotionBackyard "Motion Backyard [%d]" {mqtt="<[mybroker:/device180/gpio/0/state:state:default]"}
This is the startup code from ESPEasy :
Code: Select all
>reboot
ets Jan 8 2013,rst cause:1, boot mode:(3,7)
load 0x4010f000, len 1264, room 16
tail 0
chksum 0x42
csum 0x42
~ld
ªU
INIT : Booting Build nr:76
mode : sta(18:fe:34:9c:c8:06) + softAP(1a:fe:34:9c:c8:06)
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100
bcn 0
del if1
mode : sta(18:fe:34:9c:c8:06)
IP : Static IP :192.168.2.xxx
WIFI : Connecting... 1
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 1
pm open phy_2,type:2 0 0
cnt
connected with xxxxxxxxxxxxx, channel 12
ip:192.168.2.xxx,mask:255.255.255.0,gw:192.168.2.xxx
WIFI : Connected!
MQTT : Connected to broker
Subscribed to: /device180/#
INIT : Boot OK
INIT : Normal boot
MQTT : Topic: /device180/gpio/2
MQTT : Payload: 1
SW : State 1
MQTT : Topic: /device180//Switch
MQTT : Payload: 1.00
SW : State 0
MQTT : Topic: /device180//Switch
MQTT : Payload: 0.00
WD : Uptime 0 ConnectFailures 0 FreeMem 26456
The LED is connected to GPIO-2 and the PIR sensor to GPIO-0.
Anyone any idea what could be wrong ? Any help greatly appreciated !
-ben