A penny for your thoughts

Does anyone have any thoughts or resource as to a method for interface to hacked or not, smart devices such as Sonoff or Shelly? It might require some type of hub or WiFi interface. It would be a hoot to write XOJO code to control home devices. Maybe someone is already doing it. I have no idea.

I used the available reverse engineered documents for TP-Link to write a Xojo TP-Link controller. Have you Googled to see if there’s open technology for controlling the devices you hope to?

a simple htmlviewer to your sonoff IP address and you’re good to go.

when I make my own esp8266 IOT programs, I set up a local web page to get the values I want.

  	server.on ( "/bypass-on-servo", handleBypassOnServo );

then I use a xojo tcpsocket to get the content of the web page, getting the value I need.

I’d need a little more help understanding how to accomplish this, but I’m game. I looked at Home Assistant but that’s not helping me yet. The Sonoff devices do have an LAN control option.

My main app is a control system that can be used for controlling home devices. That’s not it’s main purpose but it is a secondary purpose of the app. It’s not that difficult to write an interface to control the devices - particularly if they publish an API. Some might be simple telnet interfaces while some might be more complicated REST interfaces. Some might not have a published API. It runs the gammut. Tivo device have a very simple and well documented interface. Roku devices have a bit more complicated HTTP interface. AppleTVs have no documented control interface other than configuring an IR device for IR control (which is what I do).

Perusing around on the Sonoff website, it looks like there “could be” third party control options available but it’s hard to tell. It looks like it’s a “made in China special” type product. Still looks like they have a a support community that might be able to help. The big thing is being able to access the API.

Now, you might also be able to use something like Wireshark to sniff out the commands being sent over WiFi. That’s a little more difficult but doable possibly…

Looks like there is not an open API from a quick search in the discussion groups. Someone did reverse engineer it:

So you’d have to dig through that code and then adopt it into Xojo.

Before anything else, it is better if you understand how those devices work internally.

If you already have the hardware, you have to flash it with some custom software, either write one by your own or an open source one like:

1 Like

Thanks, everyone. You were all helpful by letting me know it could be done. It was an interesting week researching how to flash the Sonoff switch and many other automation switches with Tasmota firmware. To get there I needed to install Python and Tasmotizer and grind away for a while on learning how to flash new firmware on my devices. The API commands are available with the well documented Tasmota and can be used with a WebUI. All I needed in WOJO was a TCPSocket and wallah my home automation system just took on a new life.