Shelly1, local MQTT with HA, 3-way light switch

Just replaced one of my flaky sonoff basic with Shelly1 in 3-way light switch.
I chose local mqtt control for my Shelly1 but api control is also possible.

Here is my steps and experience (applicable to single or multi-way switch):
To have local mqtt only, no need to install shelly-cloud app.

    1. Power up Shelly1 by connecting L and N to main (be careful!!)
    1. Connect to AP shelly1-xxxxxx through wifi
    1. On browser, for Shelly web interface
    1. Select Internet & Security, WIFI MODE - CLIENT
      a. select Connect the Shelly device to an existing WiFi Network, enter Wifi info
      b. select Set sttic IP address (optional), click Connect
    1. Look for shelly1-xxxxxx in router for Shelly local IP, xxxxxx is unique ID for each Shelly device
    1. On browser, connect to the new Shelly local IP
    1. Select Settings, FIRMWARE UPDATE, UPDATE FIRMWARE, YES (then wait…)
    1. Select Internet & Security, ADVANCED - DEVELOPER SETTINGS,
      a. ENABLE action execution via MQTT, enter MQTT server info,
      b. Save
    1. Confirm mqtt communication with your mqtt server using topic shellies/#
      a. Copy the ‘relay’ and ‘command’ topics from shellies/#,
      b. For my Shelly1:
    1. Set up switch in configuation.yaml as in but use your own topics from 9. Note the sample topics are slightly different than mine
    1. Reboot HA

If everything ran well, you should be able to toggle Shelly1 on/off from HA or Shelly web interface and see status changes (Shelly web update is a little slower). Had to trigger 3-way switch multiple times to turn on light sometimes with Settings, BUTTON TYPE, Toggle Switch, seems to have solved it with Edge Switch.
Also confirmed with my PiHole, Shelly1 in this setup does not ‘call home’ to anywhere.

Wiring Shelly1 to 3-way switch

  1. Illustration from The Hook Up, better yet, watch the whole video :+1:
  2. Connection summary:
    a. extra L wire to L and 1 on Shelly1,
    b. extra N wire to N,
    c. SW to existing switch,
    d. load (light) wire to 0.
  3. My wiring steps (again, be careful!!):
    a. I used a short bridging wire between just L and 1
    b. connect an extra wire to SW
    c. pull extra L wire and connect to L
    d. pull extra N wire and connect to N
    e. disconnect load wire from 3-way switch and connect to 0
    f. connect wire from SW to 3-way switch (load)

That’s it.

No soldering, flashing at all
Local MQTT only, no cloud, no app
Easier implementation with Sonoff basic for multiple-way switch
Compact size and manageable wires
Compatible with Amazon Echo and Google Home out-of-box

If you just need basic on/off function with MQTT, give this a try.

Disclaimer: Not in anyway associated with Shelly :slight_smile:
Shelly product list
Official Shelly MQTT/API documentation
Tasmota Github - Shelly 1 and 2
The Hook Up videos on Shelly:
Is the Shelly 1 better than the Sonoff Basic?
Shelly native MQTT support, Tasmota on the Shelly2, & Setting Up a 3-Way switch

My shelly app setup note and light.yaml (xxxxxx is your shelly1 unique key):
shelly 1 install

Local MQTT setup

  1. connect L and N
  2. connect to shelly1-xxxxxx through wifi
  3. On browser, for web interface
  4. Internet & Security, WIFI MODE - CLIENT, select Connect the Shelly device to an existing WiFi Network, enter Wifi Name/passward, select Set sttic IP address (optional), click Connect
  5. Look for shelly1-xxxxxx in router for local IP
  6. On browser, connect to the new local IP
  8. Internet & Security, ADVANCED - DEVELOPER SETTINGS, ENABLE action execution via MQTT, enter MQTT server info, Save
  9. Confirm mqtt communication with mosquitto_sub -t shellies/#
  10. Set up light in configuation.yaml as in
  11. Copy ‘relay’ and ‘command’ topics from shellies/#, example, shellies/shelly1-32C47A/relay/0, shellies/shelly1-32C47A/relay/0/command

In configuation.yaml:

  - platform: mqtt
    name: "Kitchen Light"
    state_topic: "shellies/shelly1-xxxxxx/relay/0"
    command_topic: "shellies/shelly1-xxxxxx/relay/0/command"
    payload_on: "on"
    payload_off: "off"
    retain: false

In case you wonder, would this 3-way wiring still work if we flash tasmota onto the shelly1? The answer is yes, I did it so I can have the Shelly1 in TasmoAdmin. Tasmota Supported Shelly1.
If you decide to flash tasmota to begin with, just flash and follow the wiring, then go through the usual tasmota setup instead.


Thanks for the share, made me discover some products I didn’t know from that company Shelly :wink:
Would you have checked inside the device if it’s not based on ESP chipset ? as it could be then reflashed with a nice firmware like Tasmosta or other !

I confirm that Tasmota runs perfect on a Shelly1. All my Shelly1’s are running Tasmota.

1 Like

Thanks, great news :wink: Hopefully it’s also ESP on other devices, will investigate on that !

Yes, here is the Tasmota flash video

1 Like

What advantages does the Tasmota software have over the native software?

Why is it worth the effort of flashing?


Depends on your use case, Tasmota has more options and controls, i.e. multiple clicks, familiar interface, etc… I had Tasmota on all my Sonoff’s.
But like I said, if you just want a basic light switch, factory firmware works well enough without any flashing.

1 Like

Thanks for the share :wink: Have you been able to investigate if the other devices of that manufacturer use too ESP inside ?

According to Tasmota github, at least Shelly 1 and 2 are officially supported and are ESP.

1 Like


I confirm that Shelly works like out if the box.setup in 5 minutes per device . No need to flash it. Like this it’s still possible to control the relay if homeassistant goes down :sunglasses: very good devices will add them to all my sockets in the house :joy::rofl:

I used the original firmware and setup MQTT. I used Alexa-local in Node Red to enable Alexa commands, but am now wondering if I could’ve just used Emulated Hue instead. Anybody know?

Its an on/off switch. Why change firmware on a perfectly working device? It is already working with HA and wilö never be able to do more than switch on/off, whatever firmware

I’ve used Shelly 1 in several applications and no longer flash them with Tasmota. I find with the factory firmware they stay connected. No dropouts or laggy web interface.

I have been using four of Allterco Robotics’ Shelly 1 devices for a couple of weeks now. The most recent original firmware version 1.3.5 (last time I have checked) supports MQTT. The switches sell for 10 € in Germany. Since the GPIO pins are accessible without disassembling the device one could flash something different, but why?

There is only one slightly annoying fact about the switches. Even if you activate the retain flag for MQTT status updates, they will spam the MQTT broker with their (unchanged) state every 20 seconds or so.

1 Like

At least to shelly 2 there is a 1.4 fw. Contact the support about the spamming


With the right firmware, the shelly will be able to run its own automations, import sensor / state info from HA, trigger events to HA using double / triple / custom clicks of the switch.

Perhaps you are right, I never use it for something else than it is meant for. I can switch itvon off with an automation and that is enough. If I need something else I buy a device for that

Do you have a simple working configuration of Shelly1 for lights?
If yes, will you please share ?

I updated OP with my shelly1 light configuration using original firmware.
Hope that helps.