Switch Input - Help Please

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
namirda
Normal user
Posts: 53
Joined: 22 Jan 2016, 17:09

Switch Input - Help Please

#1 Post by namirda » 10 Feb 2016, 00:02

This must be something that is easy to answer!

I have my ESP node working nicely in OpenHAB with several sensors - DHT22, SR04 and a couple of simple magnetic contact switches. The ESP properly detects any OPEN or CLOSE event on the switches but I need to be able to read the OPEN/CLOSE status of the switches on initialization. I need to know whether my windows are open or closed without having to first generate an event on each switch!

My OpenHAB items file contains:

Number ESP01_Contact1 "Contact 1 [%d]" (ESP01) {mqtt="<[localbroker:/ESP01/Contact1/status:state:default]"}

My Settings are..

Name: Contact1
1st GPIO: GPIO-5
Pull UP: Yes
Inversed: No
Switch Type: Switch
Switch Button Type: Normal
Send Data: Yes
Value Name1 : status

The above settings detect changes in the contact status - how can I poll the ESP for a status update?

Thanks for your help.

N

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 27 guests