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.
-
- Power up Shelly1 by connecting L and N to main (be careful!!)
-
- Connect to AP shelly1-xxxxxx through wifi
-
- On browser, 192.168.33.1 for Shelly web interface
-
- 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
- Select Internet & Security, WIFI MODE - CLIENT
-
- Look for shelly1-xxxxxx in router for Shelly local IP, xxxxxx is unique ID for each Shelly device
-
- On browser, connect to the new Shelly local IP
-
- Select Settings, FIRMWARE UPDATE, UPDATE FIRMWARE, YES (then wait…)
-
- Select Internet & Security, ADVANCED - DEVELOPER SETTINGS,
a. ENABLE action execution via MQTT, enter MQTT server info,
b. Save
- Select Internet & Security, ADVANCED - DEVELOPER SETTINGS,
-
- Confirm mqtt communication with your mqtt server using topic shellies/#
a. Copy the ‘relay’ and ‘command’ topics from shellies/#,
b. For my Shelly1:
shellies/shelly1-xxxxxx/relay/0,
shellies/shelly1-xxxxxx/relay/0/command
- Confirm mqtt communication with your mqtt server using topic shellies/#
-
- Set up switch in configuation.yaml as in
https://github.com/thehookup/shelly1tasmota/blob/master/ShellyFirmwareYaml.yaml but use your own topics from 9. Note the sample topics are slightly different than mine
- Set up switch in configuation.yaml as in
-
- 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
- Illustration from The Hook Up, better yet, watch the whole video
- 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. - 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.
Likes:
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.
Added:
Disclaimer: Not in anyway associated with Shelly
Resources:
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
- connect L and N
- connect to shelly1-xxxxxx through wifi
- On browser, 192.168.33.1 for web interface
- 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
- Look for shelly1-xxxxxx in router for local IP
- On browser, connect to the new local IP
- Settings, FIRMWARE UPDATE, UPDATE FIRMWARE, YES (wait)
- Internet & Security, ADVANCED - DEVELOPER SETTINGS, ENABLE action execution via MQTT, enter MQTT server info, Save
- Confirm mqtt communication with mosquitto_sub -t shellies/#
- Set up light in configuation.yaml as in https://github.com/thehookup/shelly1tasmota/blob/master/ShellyFirmwareYaml.yaml
- 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.