Shelly Device Control via External URLs - Success Story!

Hey everyone, I wanted to share my recent success with controlling Shelly devices externally using URLs. I’ve been exploring the Shelly ecosystem and ran into an interesting challenge that I thought might be worth documenting for others who might be tackling something similar.

Initially, I was trying to set up a scenario where a Shelly device in one network could be controlled by another Shelly device outside of that network. The goal was to create a smart system where pressing a button in one area (like at the front door) would trigger an action in another area (like opening a garage door). While everything worked seamlessly within the same network, controlling devices across different networks was proving tricky.

After some research and trial and error, I discovered that Shelly devices support external URL commands. This meant I could send HTTP requests to a Shelly device’s public IP address to trigger actions like turning lights on or off, adjusting settings, and more. The key was ensuring the devices were properly configured with static IPs and that port forwarding was set up on the respective routers.

Here’s a quick breakdown of what I did:

  1. Static IP Configuration: I assigned static IPs to both Shelly devices to ensure they could be reliably accessed over the internet.
  2. Port Forwarding: On each router, I set up port forwarding to direct incoming traffic on specific ports to the Shelly devices.
  3. External URL Commands: Using the Shelly API documentation, I crafted HTTP GET requests that could be sent to the devices’ public IPs. For example, http://[public-ip]:[port]/relay/0?turn=on would turn on a connected relay.
  4. Testing and Automation: I tested various scenarios to ensure commands were being processed correctly. Once everything was working smoothly, I integrated these commands into my home automation system using IFTTT and Node-RED for more complex automations.

One of the most satisfying parts of this project was seeing how versatile Shelly devices are. They truly live up to their reputation for being user-friendly yet powerful. I was especially impressed with how responsive the community is—when I hit a snag, a quick search revealed that others had tackled similar issues, and their solutions were readily adaptable to my setup.

If anyone else is looking to expand their Shelly setup beyond a single network, I’d highly recommend exploring external URL commands. It’s a bit of a learning curve, but the payoff in terms of flexibility and control is well worth it!

Happy tinkering! :rocket: