ESP8266 Switch and Control

Hi,
I need your help with a idea that running at my head all the time.

I have an ESP8266 that control relay.

master IP of the ESP8266 is : http://192.168.1.2/
if you send to the IP (example IP/gpio/on) it is turn on the relay.
if you send to the IP (example IP/gpio/on) it is turn off the relay.
if you send to the IP (example IP/gpio/check) it is gives you and replay (web) if the relay is on/off.

the value of the IP change from one device to the other.
Can some one help me with definition of device type or smartapp definition.

Thanks!

Roi.

1 Like

HI @roizano, yes, just I need more info, is product like ion woods switch? or is your own develop inside the ESP8266?
I can make an device type to tun on an off and check the status every x time, but its better if the device trigger the status to the hub to avoid monitor each x time, have you more info?

1 Like

Hi @ule ,
This is own develop ESP8266 unit and and it working like a charm when pushing it the commands that i wrote above.
Can you help with a device type as you wrote (including X time checking status)?
for example I have 10 lights switch and i want check it every 5 seconds. is it possible?
Thanks for your help.
Roi.

1 Like

A bit late but worthwhile to bump this thread.

I’m working with some ESP8266 devices for home projects and would LOVE the ability to push a button in the SmartThings App and trigger a WEB URL request on the local LAN to unlock a door/trigger something.

Would be great if there was a sort of open device type whereby we can put in our own URL’s thus saving SmartThings from having to worry about any of that. Is this possible?

1 Like

Just another Bump. Would be great to have a generic device type that we can program with our own URL’s for each button press. That way I can use the local IP such as http://192.168.1.2/push/button1/on or use MQTT

1 Like

Yes, same idea here. I have a ESP8266 (huzzah from adafruit) and I am thinking about easy way to make it trigger an event on SmarTthings so to open a door lock. Some generic device type that accepts URL requests would be one piece of the the solution indeed

1 Like

@hakem

There is another thread here - ESP8266 Switch and Control

But it involves many moving pieces, including a web service/JSON that i’m not sure is required. I’d prefer to use thingspeak or the like but I have no idea where to start

Thank you ! This link leads me to this thread :slight_smile:

To summarise, there are two requirements in this thread :

1-) From ST ==> ESP8266 : ST to control via wifi ESP8266, which relays some “Thing”. This would be pretty useful in many applications (certainly excellent possiblities but maybe not power efficient since it means that ESP8266 need to listen at all times, draws power. But really worth it for its low cost if it can be powered with a source) ;

2-) From ESP8266 ==> ST : ESP8266 to be able to trigger on ST via WIFI .

This second possibility opens a whole whole world to low cost possibilities ( since most z-wave devices start at minimum 20 USD /thing). The famous Amazon dash button ( which is 4 USD can be easily adapted to turn into a switch button for your SmartThings. Dimmers I am sure can, and the start would be 4 USD / piece instead of minimum 20 USD item presently with Z-wave. Energy will not be a problem in this case, since ESP8266 will be ins leep mode most of time untill it wakes up further to a push button or so.

The question that remains unclear to me is whether there is a ST device type , which can listen on local TCP port on specific URL to trigger some event. That’s all we would need to make option 2 work.

Any lights on this ?

Why is local mandatory?

If you can route to the Internet, setting up a Web Services SmartApp URL(s) is trivial (that’s the way SmartTiles currently works).

Local is more limited at this time as particular protocols are required; but look up LAN Device Type Handlers in the Developer Documentation for a start. These don’t run locally anyhow, as custom device types are not included in Hub V2 firmware.

Dear tguachat,
Thank you for info. I thought of local listening because it was to control a door lock ( needs 99.99% availability), in which case ,I wanted to avoid a point of failure, which is “Internet connectivity”.

Getting it to work with Cloud is already an achievement still for this idea

1 Like

For reference:

Not possible. All custom device handlers run in the cloud only. So it does not matter whether your device sends data through the hub or directly to the smart app (REST endpoint), it will need an Internet connection anyway.

1 Like