I bought a swing gate opener which included a SGC01 wifi smart control. I opened it up and it’s controlled by an ESP12 I believe. I managed to flash it with EspHome, but I am struggeling on controlling the relay.
I tried to do a continuity check between COM port on relay and the different pins on the ESP without luck.
Tried a couple of “random” pin configurations in EspHome, but if I choose the wrong one I have to solder back and re-flash. Any tips on how to find the correct pin for controlling the relay?
Hi, i’m using the exact the same device(sgc01 smart wifi) on my sliding gate. It controlled by a xhouse app. xhouse app has no direct integration to HA. Can someone help me if there is a way to integrate this device into HA? Or can someone share how to flash this device to esphome? I would like to expose this into HA and have control locally.
More info on connecting to the ESP board here : Physically Connecting to your Device — ESPHome Including some important notes about how to put the board in flashing/programming mode. You might have to install drivers, bridge GPIO0 and GND, and/or have to power cycle after erase and before uploading etc.
I got this device working in Home Assistant using XHouse IOT API calls. Unfortunately there is no local API. It all goes via http://47.52.111.184:9010/xhouseAppEncapsulation
so no SSL encryption either. However they do use timestamps and tokens in their HTTP Headers so it is somewhat secure.
Using XHouse IOT Device with Home Assistant via AppDaemon
Step 1: Install the AppDaemon Addon in Home Assistant
If you haven’t already, install AppDaemon through Home Assistant’s Add-on Store or as a Docker container.
Step 2: Add AppDaemon .py file
Download the xhouse.py file and put it in your AppDaemon apps directory e.g.
\addon_configs\a0d7b954_appdaemon\apps
Step 3: Update apps.yaml file
Paste in the apps.yaml configuration into your apps.yaml file. Change the email and password fields to your XHouse IOT account details.
Step 4: Restart AppDaemon
After saving both files, restart AppDaemon to load the app.
How It Works
AppDaemon logs in to your XHouse IOT account when it starts
It hopefully discovers all your devices and creates cover or switch entities in Home Assistant (it has only been tested with the SGC01 so it might not work with other devices)
It refreshes the devices state every 5 minutes (configurable)
You can control your device through Home Assistant’s UI
The entities will appear as a cover or switch with entity IDs such as cover.xhouse_800421019117424640.
Please note that using this will cause your app on your phone to log out. Ideally create a second XHouse IOT account and share the device with it. That way you can use the app and Home Assistant simultaneously.
I’ve a sliding gates and the installer is offering me to configure a SGC01 smart Wifi to control it… I don’t want to go on the trouble of going through the API on the Xhouse cloud (for security reason I’m filtering traffic) and I’m not keen to re flash the ESP module (sounds fun but don’t have time and all the equipment to do it).
Would it be easier to install a Shelly module (Shelly 1 Gen3) to control the gate ?
Actually yes the Shelly would be a great alternative to the SGC01. You would likely need to do a little bit of configuring on the Shelly to get it to work how you want it but there’s heaps of videos out there explaining wiring it up, how to use it with a dry contact sensor etc.
Just wanted to drop a thank you. I was relying on google to allow me to open/close my gate using home assistant but it frequently stopped working with google saying it was offline. I had no luck flashing my particular XH-SCG01 as mine has an ESP32c2-12 and I just couldn’t get anywhere with it. This is a great alternative solution.