Raspberry Pi with PHP (or Arduino/ESP8266/NodeMCU) to GPIO to Relay to Gate/Garage Trigger

It’s working now! Thanks for updating!

As an FYI, I re-wrote and optimized a bunch of stuff for the ESP32. The reliability is awesome and wifi recovers. It’s super fast… and more importantly, no more HTTP repetitive polling to update the status of a sensor/switch. Everything is dependent on MQTT bridge and here’s the stuff I have working fully: 2 switches, ability to use a momentary button on each switch, 2 contact sensors and temperature/humidity from BME280 and DHT sensors. The big improvement is that the tiny OLED on the Heltec Wifi Kit32 board or the Wemos LoLin makes things much more polished. I tried to use all default simulated DTH’s available for ST. Switch from the sample DTH, momentary button had to be hacked a bit in order to work. Contact sensors were the nasty piece because ST makes those read only so have to sync status of the sensor with some hidden switches. Anyway, all works flawlessly and I’m close to being open to releasing it for a beta run. Not sure who’s interested but it’s way more powerful/responsive/immediate than my previous project above. Let me know if interested in testing…

1 Like

Here’s what it looks like in my garage with a 5v dual relay board (garage door & light). The OLED does show different screens for dual switch and dual contact states.

Heltec Wifi Kit 32
Wemos ESP32 OLED

Feel free to check out the new MQTT project with ESP32 (and ESP8266 also works).

1 Like

Hi how are you I wanted to do something similar where I have 6 buttons controlling smartthings using the sp32 board would your code work for that

@Edward_shamosh it can definitely do two buttons because that’s what I coded for. However, for 6 there is a lot of code to modify.

To be honest, at this point, I highly recommend using ESPHome with the MQTT bridge either the original or one that I forked and added a few features to. ESPHome can do so much with so little configuration. I still use my code here in my garage but I have fully migrated all of it including the OLED screen logic to ESPHome and it’s pretty solid and offers OTA updates, etc.

I want to hire someone to modify project code do you know someone?

@Edward_shamosh what are you trying to do specifically (with all important details)?

I’d go with Fiverr if I were you… probably the cheapest deal you’ll get but let me know what you’re trying to accomplish — just to see if something already exists for your purpose and easier than writing code from scratch then supporting it onward.

1 Like

Have you looked at ST_Anything? It is able to create a 6-button controller using an ESP32 very easily, without much effort. But, please explain in detail what you are trying to accomplish, as I’d hate to steer you wrong.

@ogiewon to be honest it’s hard to justify using/having so many frameworks for this stuff… ESPHome and Tasmota are way too mature compared to everything else and I’d highly recommend going with that instead of a project that the author may abandon, etc.

I am the author…

I get that… but if one day you decide to kill it or just not update it due to a thing called life, folks that implemented it are now left to their own devices. I’m a big fan of much larger frameworks with many developers working on it because those projects survive better than smaller ones.

I get that… and truth be told, my excitement for supporting ST as a platform is not extremely high based on how Samsung has been treating their customers as of late. However, ST_Anything runs on many of microcontrollers, unlike Tasmota and ESPHome. It is fully open source, so anyone can use it without fear of it disappearing some day. (Yes, I realize Tasmota and ESPHome are open as well.) ST_Anything was designed for the Arduino DIY enthusiast. It is a collection of Arduino libraries designed for the hobbyist. It is incredibly easy to extend to all sort of projects.

Since you’re a fan of Tasmota and ESPHome, I am genuinely curious if either of these have been integrated into SmartThings without any Groovy code, yet? In other words, as Direct-Connected devices? (not Hub-Connected, as that relies on Groovy still.) If not, it will all come crashing down next year when the Groovy IDE is shut down. At that point, you are correct…this developer will most likely lose all interest in the ST platform. :wink:

@ogiewon I like your loaded question :slight_smile: and completely understand your level of frustration with SmartThings. Just opened a few cases lately about the new app.

To answer your question: I have set up many of those devices but in all honesty, I can’t say it’s w/o groovy. Meaning, today I can do that for 90% of the devices out there… but that’s ONLY because I have (my modified version) MQTT bridge plugged in. So even generic/simulated switches work well with almost zero work. Obviously that makes me reliant on my MQTT service running on a Ubuntu with Home Assistant and too many other things :slight_smile: (supervised Home Assistant in Docker, mosquitto, node-red, elasticsearch & kibana, grafana, etc.)

Thanks for the response. ESPHome definitely appears (from a quick online search) to be most popular with the Home Assisstant / MQTT users. I believe the new ST API/Platform includes support for MQTT so hopefully that will help in the future.

Tasmota seems to primarily be used to flash existing, popular off-the-shelf WiFi devices like Sonoff devices and smart bulbs. It doesn’t seem to cater to the DIY’r… :thinking:

I looked at the st anything its a lot going on to set it up with the direct connect example it is much easier to set up

I want something that I can sell as a PCB kit I already have the prototype boards on the way I just need to modify the code in the example

I looked at the st anything its a lot going on to set it up with the direct connect example it is much easier to set up

I want something that I can sell as a PCB kit I already have the prototype boards on the way I just need to modify the code in the example I want to modify the existing code

@Edward_shamosh Interesting info… looks like the API for ST got a lot of enhancements.

The biggest issue I’ve had with this project (which is super old at this point) and my newer ESP32 project is the fact that the CURRENT state of a switch needs to be sent back to ST. Unfortunately, I’ve been relying on MQTT for all of that. Older logic like this project had simply used HTTP polling to obtain that current status.

@ogiewon you pretty much named it. I don’t love Tasmota and never really went to it, but it can be flashed onto a generic ESP thus could be for DYI-ers. However, ESPHome has been a dream come true.

1 Like

So how do I add at the the smarthings app

It’s more than just the smartapp — the smartapp is just to help the PARENT device sync with the child device (secondary button). That’s all the smartapp does — it cannot dynamically “create” buttons, etc. You need to change the Device Type Handler more-so than the app but the task is of huge effort and not something I can explain here.