Privacy Tools Guide

Cloud-dependent smart switches send your device data, usage patterns, and network information to third-party servers. For privacy-conscious developers and power users, this represents an unacceptable trade-off. This guide walks through the process of replacing cloud-dependent smart switches with local Zigbee alternatives that operate entirely within your network.

Understanding the Problem

Most commercial smart switches rely on cloud infrastructure for basic functionality. When you tap that button in an app, the signal travels to the manufacturer’s server, gets processed, and then sends a command back to your device. This architecture creates several problems:

Zigbee operates on a mesh network protocol that devices use to communicate directly. With a local hub, you eliminate the cloud entirely while gaining reliable, low-latency control.

Choosing Your Hardware

For a local Zigbee setup, you need two components: a Zigbee hub and Zigbee-compatible switches or dimmers.

Zigbee Hubs

The hub bridges Zigbee devices to your local network. Several options work well for privacy-focused setups:

For maximum control, Zigbee2MQTT running on a local server paired with an USB dongle provides the most flexibility and transparency.

Smart Switches and Dimmers

Look for devices with explicit Zigbee support. Some popular options include:

Check the device’s product database on Zigbee2MQTT.io to confirm compatibility before purchasing.

Setting Up Your Local Hub

This example uses Zigbee2MQTT on a Raspberry Pi or Linux server.

Prerequisites

# Install required packages on Debian/Ubuntu
sudo apt-get install -y git make g++ gcc mosquitto mosquitto-clients

Installing Zigbee2MQTT

# Clone the repository
git clone https://github.com/Koenkk/zigbee2mqtt.git
cd zigbee2mqtt

# Install Node.js dependencies
npm install

# Copy the configuration template
cp configuration.example.yaml configuration.yaml

Configure your MQTT broker and serial adapter in configuration.yaml:

mqtt:
  base_topic: zigbee2mqtt
  server: 'mqtt://localhost'

serial:
  port: /dev/ttyUSB0

frontend:
  port: 8080

Start the service:

npm start

The frontend will be available at http://localhost:8080 where you can pair devices.

Pairing Your Switches

With Zigbee2MQTT running, put your switch into pairing mode. This usually involves pressing and holding a button for 5-10 seconds until the LED flashes. The device will appear in the Zigbee2MQTT interface.

Once paired, you’ll see the device in the frontend with its entities. A typical switch exposes these attributes:

{
  "state": "OFF",
  "linkquality": 78,
  "last_seen": "2026-03-16T10:30:00+00:00"
}

Integrating with Home Automation

Now comes the powerful part: controlling your switches locally through automation.

Basic MQTT Control

Publish directly to MQTT topics to control switches:

# Turn switch on
mosquitto_pub -t zigbee2mqtt/<device_id>/set -m '{"state": "ON"}'

# Turn switch off
mosquitto_pub -t zigbee2mqtt/<device_id>/set -m '{"state": "OFF"}'

Home Assistant Integration

Add this to your configuration.yaml:

mqtt:
  switch:
    - name: "Living Room Light"
      state_topic: "zigbee2mqtt/<device_id>/state"
      command_topic: "zigbee2mqtt/<device_id>/set"
      payload_on: '{"state": "ON"}'
      payload_off: '{"state": "OFF"}'
      value_template: "{{ value_json.state }}"

Node-RED for Advanced Logic

For complex automations, Node-RED provides a visual programming interface. This flow creates a motion-activated light with timeout:

// Inject node triggers every motion detected
// Switch node checks if motion is detected
// Change node sets payload to ON/OFF
// Delay node waits 5 minutes then turns off
// MQTT out node sends command to zigbee2mqtt

Practical Migration Strategy

Moving from cloud switches to local Zigbee requires a phased approach:

  1. Audit current devices: List all cloud-dependent switches and their functions
  2. Purchase one test device: Verify compatibility before buying in bulk
  3. Set up the hub: Install Zigbee2MQTT or your preferred software
  4. Migrate room by room: Replace devices in one area, test thoroughly
  5. Eliminate cloud accounts: Delete manufacturer accounts once migration completes

This approach minimizes disruption while allowing you to validate the new system.

Handling Edge Cases

No Neutral Wire

Many older homes lack neutral wire at switch locations. In these cases, consider:

Range Issues

Zigbee mesh networks improve range as you add more devices. If you have coverage gaps:

Firmware Updates

Zigbee devices occasionally need firmware updates. Zigbee2MQTT supports OTA updates for many devices. Check the documentation for your specific device to see if OTA updates are available.

Verification and Monitoring

After migration, verify your setup is truly local:

# Check MQTT messages are local only
tcpdump -i lo -n port 1883

# Monitor network traffic from your hub
sudo ngrep -d eth0 '' host <hub_ip>

You should see MQTT traffic only on your local network, with no external connections to manufacturer servers.

Built by theluckystrike — More at zovo.one