~/nodetwelve.com$
33 notes · 6 topics
updated 2026-05-10

Designing a smart home lighting system

· 9 min read

Switches, motion detection, and voice control

This project is a working proof of concept for dimmable GU10 LED lighting controlled in four ways: momentary wall switches, local automations in Home Assistant OS over Wi-Fi, motion sensing via a Philips Hue sensor (without a Philips Hue bridge) using a ConBee II Zigbee gateway and ZHA, and voice commands through Google Assistant.

System architecture and wiring

Overview and wiring diagram

The diagram below shows how two momentary wall switches wire into the Shelly Dimmer 2, alongside the Wi-Fi and Zigbee communication paths back to Home Assistant OS.

Home Assistant OS lighting diagram connecting Shelly Wi-Fi and Zigbee

One big advantage of combining momentary light switches with Shelly modules is that you can wire as many switches in parallel as you need. There is no need for special intermediate switches: just run a live feed to each switch and connect the return back to SW1 or SW2.

Wire multiple momentary switches in parallel

Because momentary (retractive) switches only send a pulse when pressed, wiring multiple switches to control the same light is simply a matter of connecting them in parallel to the same terminals.

Wiring multiple momentary light switches in parallel to a Shelly Dimmer 2

Hardware components

GU10 LED lamps

Philips CorePro 5 W GU10 dimmable LED lamps

Different rooms will have different numbers of fixtures, so for the test bench I loaded the dimmer with up to 9 LED lamps.

Caution

Using compatible dimmable LED bulbs is essential with the Shelly Dimmer 2; incompatible drivers can trigger overheating shutdowns (covered in the troubleshooting section below).

I settled on Philips CorePro 5 W LED GU10 PAR16 Cool White Dimmable lamps:

Momentary switches

RetroTouch momentary retractive light switches

Momentary (retractive) switches look like regular wall switches but are spring-loaded, returning to rest after each press. That lets a single switch send short presses, double presses, or holds:

I chose UK-made RetroTouch switches for build quality and quick delivery. Their customer support also understands smart-home dimmer setups well if you have wiring questions.

Shelly Dimmer 2

Shelly Dimmer 2 Wi-Fi smart dimmer module

Shelly modules are RoHS-compliant, connect over Wi-Fi, and work out of the box with Home Assistant (or over MQTT with a broker like Mosquitto). They also support installations both with and without a neutral wire (using a bypass when no neutral is present).

The Shelly Dimmer 2 responds directly to the wall switches on SW1/SW2 and also accepts network commands for automations, such as:

Warning

Buy Shelly modules directly from Shelly or an authorised store. Counterfeit or defective units sold through third-party resellers can run dangerously hot or lose their configuration after a power cut.

Philips Hue motion sensor

Philips Hue motion sensor paired via Zigbee without a bridge

For motion-triggered lighting, I used the Philips Hue motion sensor. It is compact, well built, and responds almost instantly when paired directly over Zigbee via the ConBee II dongle — no Philips Hue bridge needed. As a bonus, it also exposes ambient temperature readings.

ConBee II Zigbee gateway

ConBee II USB Zigbee gateway

The ConBee II is a reliable, affordable USB Zigbee coordinator. Moving sensors onto Zigbee keeps extra traffic off your Wi-Fi access points, and pairing devices through it in Home Assistant is straightforward.

Home Assistant OS on Proxmox

Proxmox virtual machine running Home Assistant OS 7.0

Home Assistant OS is a minimal operating system tailored to running Home Assistant, complete with the Supervisor for managing Core updates and add-ons. If you already run a hypervisor like Proxmox, you can spin up a Home Assistant OS VM quickly using the community install script:

Integrations and add-ons

Zigbee Home Automation (ZHA)

After testing several Zigbee options, I picked the built-in ZHA integration to keep ongoing maintenance low. It pairs directly with the ConBee II USB stick and supports a wide range of Zigbee radios and sensors.

Shelly integration

The official Shelly integration auto-discovers modules on the network and responds quickly. Initial setup follows the standard Shelly workflow: power up the unit, join its temporary Wi-Fi access point, and enter your home Wi-Fi details through its web portal.

Google Assistant

Adding Google Assistant lets you control the lights by voice or through the Google Home app on top of the local switches, motion sensors, and Home Assistant automations.

Test bench prototype

Smart home lighting test bench prototype with Shelly, switches, and Hue sensor

I built a bench prototype using all of the parts above. It is not pretty, but it makes rewiring and testing easy. Both retractive switches toggle and dim the lamps, the Philips Hue sensor triggers them on motion, and everything responds to Google Assistant voice commands.

Issues encountered

During testing I ran into a couple of hardware problems worth documenting. Using Wago lever connectors on the test bench saved a lot of time while swapping bulbs and modules:

LED lamp compatibility and overheating

Although the Shelly Dimmer 2 works with most dimmable LEDs, it did not get along with Aurora Enlite 4 W LED GU10 PAR16 Cool White Dimmable (EN-DGU004/40) lamps. They look great and work well on standard dimmers, but with the Shelly Dimmer 2 they ran fine for 15–20 minutes and then tripped the module's built-in over-temperature cutoff.

To track down what was happening, I wrote a small Python script to poll the Shelly's /status JSON endpoint and plot module temperature against brightness in real time:

### Shelly Dimmer 2 Plotter
### Temperature / Brightness over Time
### SpawnTerror 2021

import datetime as dt
import matplotlib.pyplot as plt
import matplotlib.animation as animation


from urllib.request import urlopen
from datetime import datetime
import json
import time

# Create figure for plotting / variables
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
xs = []
ys = []
ys2 = []

# Shelly IP / update interval
update_interval = 10000
url = "http://192.168.1.230/status"

# Gui info
fig.text(0.5, 0.92, "Shelly Dimmer 2 Plotter", ha="center", va="bottom", size="medium", color="black")
fig.text(0.40, 0.89, "Temperature", ha="center", va="bottom", size="medium", color="red")
fig.text(0.5, 0.89, " & ", ha="center", va="bottom", size="medium")
fig.text(0.60, 0.89, "Brightness", ha="center", va="bottom", size="medium", color="blue")
fig.text(0.13, 0.15, 'URL: ' + url + '.', ha="left", va="bottom", size="medium", color="black")
fig.text(0.13, 0.12, 'Start time: ' + dt.datetime.now().strftime('%H:%M:%S') + '.', ha="left", va="bottom", size="medium", color="black")
fig.text(0.13, 0.09, 'Update interval: ' + str(update_interval)[0:2] + 's.', ha="left", va="bottom", size="medium", color="black")


# Animate function
def animate(i, xs, ys):

    # Read temperature (Celsius) from TMP102
    response = urlopen(url)
    data = json.loads(response.read())
    tempe_values = data['tmp']
    temperature = tempe_values['tC']
    light_values = data['lights']
    light_read = light_values[0]
    brightness = light_read['brightness']
    plt.pause(0.001)

    # Add x and y to lists
    xs.append(dt.datetime.now().strftime('%M:%S'))
    ys.append(temperature)
    ys2.append(brightness)

    # Draw x and y lists
    ax.plot(xs, ys, color='red')
    ax.plot(xs, ys2, color='blue')

    # Format plot
    plt.xticks(rotation=45, ha='right')
    plt.subplots_adjust(bottom=0.30)
    plt.ylabel('Temperature (C)')

# Set up plot to call animate() function periodically
runtime = animation.FuncAnimation(fig, animate, fargs=(xs, ys), interval=update_interval)
plt.show()

The script is also on GitHub: shelly-dimmer-2-temperature-monitor.

With the Aurora bulbs, the dimmer started at 65°C even at 100% brightness, and dimming down to 80% pushed the module past 100°C within about 20 minutes. Trying leading-edge, trailing-edge, and repeated auto-calibrations made no difference, and power draw looked normal right up until thermal shutdown.

After checking the Shelly Support Group and speaking with Shelly CEO Dimitar Dimitrov, he confirmed that Aurora bulbs are known to cause issues with the Dimmer 2. Switching to Philips CorePro LEDs dropped the operating temperature below 40°C across all brightness levels.

In the plot below, the blue line shows brightness and the red line shows temperature read from IP/status:

Shelly Dimmer 2 temperature and brightness graph with Philips CorePro bulbs

Out of 16 Dimmer 2 units I tested, 15 came directly from Shelly UK and ran cool with the Philips bulbs. The single unit bought from an Amazon reseller sat at a constant 90°C on both Aurora and Philips lamps, suggesting it was faulty or counterfeit.

Power loss and reconnection behaviour

That same third-party Amazon module also failed power-loss tests. After cutting and restoring power, it dropped back into setup AP mode and wiped all of its settings. None of the 15 genuine units from Shelly UK showed this behaviour; every single one reconnected cleanly with its configuration intact.

Demonstration and performance

The prototype has been running well beyond expectations. ZHA over the ConBee II has millisecond-level latency, and the Hue motion sensor triggers reliably even from upstairs behind closed doors and walls.

Because the wall switches wire directly to the Shelly module, the lights still work normally even if Wi-Fi or Home Assistant goes offline. Everything runs locally aside from the optional Google Assistant voice layer.

In summary, the lights can be controlled by:

After more than six months on the test bench and over ten simulated power cuts, the genuine Shelly Dimmer 2 modules have come back online cleanly every time without a single hiccup.