Showing posts with label Domoticz. Show all posts
Showing posts with label Domoticz. Show all posts

Saturday, January 17, 2026

Alexa Controls Domoticz via Philips Hue Emulator

If you run Domoticz and have an Amazon Echo, this is one of the simplest ways to get voice control while keeping device commands on your local network — no cloud subscriptions, no Alexa skills, no Philips account.

Last updated: January 18, 2026

Note: Alexa still uses the internet for speech recognition, but device control stays on your LAN.

Domoticz Hue Emulator architecture: Echo -> Hue Emulator -> Domoticz -> devices (local network)

Architecture overview: voice command → Echo discovers a Hue-bridge emulator → commands are translated to Domoticz API calls → devices respond (locally).

What you get

  • No Philips Hue cloud — emulates a Hue Bridge locally
  • No third-party Alexa skills — Echo's native Hue support handles discovery
  • No subscriptions — runs on any Raspberry Pi or Linux box you already own
  • Local device control — commands stay on your LAN (Echo → Emulator → Domoticz)

The problem with typical Alexa integrations

A lot of smart-home voice control flows through vendor clouds and Alexa skills: you install a skill, link accounts, and every action takes a detour through the internet. That can add latency, create privacy concerns, and introduce dependencies on services that can change, break, or become paid.

If you already run Domoticz, the question is natural: why can't Alexa talk to your system directly? The answer is: it can — if you present your devices in a way Alexa already understands.

What is Domoticz Hue Emulator?

Domoticz Hue Emulator is a lightweight Python service that emulates a Philips Hue Bridge on your local network. Amazon Echo devices have native support for Hue bridges, which means Alexa can discover and control devices without an Alexa skill.

The emulator makes Alexa believe it's talking to a Hue bridge, but behind the scenes it translates those requests into Domoticz API calls for your switches, dimmers, RGB lights, and scenes/groups.

How it fits together

Voice Command
   →
Amazon Echo
   →  (local Hue protocol)
Hue Emulator (Python)
   →
Domoticz API
   →
Switches / Dimmers / RGB Lights / Scenes

Features at a glance

  • On/Off control for switches
  • Dimming (brightness control) for dimmers and RGB lights
  • RGB color control (e.g., "set lamp to red", "warm white")
  • Scenes/Groups support for controlling multiple devices at once
  • Easy YAML configuration
  • Runs as a systemd service (auto-start)

Voice command examples

Basic on/off

  • "Alexa, turn on Living Room Light"
  • "Alexa, turn off Kitchen Light"

Dimming (dimmer/rgb types)

  • "Alexa, set Bedroom Light to 50 percent"
  • "Alexa, dim Living Room Light"
  • "Alexa, brighten Bedroom Light"

Colors (rgb type only)

  • "Alexa, set Lamp to red"
  • "Alexa, set Lamp to blue"
  • "Alexa, set Lamp to warm white"

Scenes and groups

  • "Alexa, turn on All Lights"
  • "Alexa, turn off All Lights" (groups only)

Requirements

  • Raspberry Pi or any Linux server on the same network as your Echo
  • Domoticz running with devices configured
  • Python 3.7+
  • Port 80 available (required by the Hue Bridge protocol)

Tip: if port 80 is in use by Apache, Nginx, or another service, you must stop or reconfigure it for the emulator to work.

Installation & setup

1) Clone the repository

git clone https://github.com/hackboxguy/domoticz-hue-emulator.git
cd domoticz-hue-emulator

2) Install (or test with a dry run)

# Test installation (dry run)
sudo ./install.sh --domoticz-user=YOUR_USER --domoticz-pw=YOUR_PW --dryrun

# Install
sudo ./install.sh --domoticz-user=YOUR_USER --domoticz-pw=YOUR_PW

3) Configure your devices in alexa-devices.yaml

Add your Domoticz devices by name, IDX, and type (switch, dimmer, rgb). You can find IDX values in Domoticz under Setup > Devices.

domoticz:
  url: "http://localhost:8080"
  username: "admin"
  password: "yourpassword"
devices:
  - name: "Living Room Light"
    idx: 10
    type: dimmer

  - name: "RGB Lamp"
    idx: 30
    type: rgb

4) Restart the service

sudo systemctl restart domoticz-hue-emulator

5) Discover devices

Now the fun part:

"Alexa, discover devices"

Within seconds, your Domoticz devices should appear inside Alexa as controllable lights.

Scenes vs groups: In Domoticz, Scenes only support ON (activate), while Groups support ON and OFF. If you need voice control to turn devices both on and off, create a Domoticz group.

Scenes, groups, and routines

The emulator supports Domoticz scenes/groups so you can control multiple devices with a single command. It also pairs nicely with Alexa Routines for custom phrases like "Alexa, let's start the party" — mapped to a Domoticz scene or group.

Troubleshooting

Alexa doesn't discover devices

  • Confirm the service is running: sudo systemctl status domoticz-hue-emulator
  • Verify port 80 is available: sudo ss -tlnp | grep :80
  • Check logs for SSDP activity: sudo journalctl -u domoticz-hue-emulator -f

Device shows "not responding"

  • Verify Domoticz is reachable: curl http://localhost:8080
  • Confirm the device IDX is correct in alexa-devices.yaml
  • Review logs for API errors: sudo journalctl -u domoticz-hue-emulator -f

Port 80 already in use

Stop or reconfigure the conflicting service (often Apache, Nginx, or another bridge).

How it works (under the hood)

  1. SSDP discovery: the emulator answers Alexa's UPnP/SSDP discovery requests (UDP 1900), announcing itself as a Hue Bridge.
  2. Hue API emulation: Alexa reads Hue-compatible JSON describing your Domoticz devices as "lights".
  3. Command translation: Alexa commands are translated into Domoticz API calls (on/off, brightness, color).
  4. Local device control: commands stay on your LAN (Echo → Emulator → Domoticz). Alexa still uses the internet for speech recognition.

Friday, July 03, 2020

Vendor-Neutral Zigbee Gateway with Raspberry Pi

A one-script installer that turns a Raspberry Pi + CC2531 USB adapter into a vendor-neutral Zigbee home automation gateway running Domoticz — supporting 800+ Zigbee devices from any manufacturer.

Pimoticz hardware setup — Raspberry Pi with CC2531 USB adapter

Raspberry Pi with CC2531 USB Zigbee adapter — the complete Pimoticz hardware.

The problem

Cheap Zigbee home automation devices are everywhere, but they're locked to the manufacturer's gateway — limiting you to a small set of supported devices. With commercial off-the-shelf (COTS) hardware, you can build your own vendor-neutral gateway, but it requires setting up multiple components:

  1. Raspberry Pi
  2. CC2531 USB Zigbee adapter (with Koenkk firmware, ~$12 on Amazon)
  3. Raspberry Pi OS (32-bit)
  4. Node.js (v12 or higher)
  5. zigbee2mqtt
  6. Mosquitto MQTT broker
  7. Domoticz
  8. zigbee2mqtt plugin for Domoticz

For beginners, getting all these components working together is a challenging task. Pimoticz simplifies this with an automated installer script — in about 5 minutes you should be ready to pair your first Zigbee device.

Items needed

  • Raspberry Pi
  • Micro SD card
  • 5V power adapter
  • CC2531 USB Zigbee adapter

Important: To avoid the CC2531 programming setup, buy a pre-programmed USB adapter with Koenkk firmware (CC2531_DEFAULT_20190608.zip or higher).

Raspberry Pi OS setup

CC2531 USB adapter, keyboard, mouse, monitor, and internet connection are only needed during the initial setup.

Step 1 — Prepare the SD card using Raspberry Pi Imager and install Raspberry Pi OS 32-bit.

Step 2 — Insert the SD card, connect keyboard/mouse/monitor and internet to your Raspberry Pi, then power on.

Step 3 — On first boot, the setup wizard will guide you through:

  • Language and keyboard layout (important for correct local time — Domoticz needs it)
  • Set a new password for the pi user
  • Black border check (not important — Raspi will run headless after setup)
  • Wi-Fi setup (skip if using Ethernet)
  • Software update (optional — can skip to save time)
  • Reboot to apply settings
Pimoticz architecture diagram

Pimoticz software stack — zigbee2mqtt, Mosquitto, and Domoticz working together.

Pimoticz installation

Open a terminal on the Raspberry Pi (locally or via SSH) and run:

git clone https://github.com/hackboxguy/pimoticz.git
cd /home/pi/pimoticz
sudo ./setup.sh -h my-pimoticz    # -h hostname is optional
# wait ~5 minutes for setup to complete
sudo reboot
Pimoticz setup script running

Setup script in progress — installing all dependencies automatically.

After reboot, open a browser and navigate to http://127.0.0.1:8080 or http://my-pimoticz:8080 — Domoticz will show the detected CC2531 Zigbee coordinator.

Domoticz dashboard showing CC2531 coordinator

Domoticz running on Pimoticz — CC2531 Zigbee coordinator detected and ready to pair devices.

Your Pimoticz gateway is ready. You can now pair Zigbee devices from any manufacturer — Xiaomi, IKEA, Philips Hue, Sonoff, and 800+ more.

SOURCE CODE

github.com/hackboxguy/pimoticz — installer script and documentation

Tuesday, January 01, 2019

$20 Pocket Router as Domoticz Smart Home Gateway

A custom OpenWrt firmware (autom8box) that packs router + Domoticz server + MQTT broker into an all-in-one home automation gateway running on a ~$20 off-the-shelf GL-MT300N-V2 pocket router.

Domoticz home automation gateway setup diagram

System overview: GL-MT300N-V2 running autom8box firmware as Wi-Fi AP, MQTT broker, and Domoticz server.

The problem

Wi-Fi based home automation products are cheaper than Zigbee or Z-Wave, but they typically require internet connectivity. Letting cloud servers control your home devices is not ideal — internet should be optional, not mandatory.

Thanks to the open-source community (Tasmota, ESPurna, etc.) for helping jailbreak devices like Sonoff, Blitzwolf, and Teckin. But jailbreaking solves only part of the problem — you still need a home automation gateway: Wi-Fi access point + MQTT broker + automation server (Domoticz, OpenHAB, etc.).

What autom8box provides

  • Wi-Fi access point — dedicated network for your IoT devices
  • DHCP and DNS server — automatic network configuration
  • MQTT broker (Mosquitto) — message bus for IoT devices
  • Domoticz — home automation dashboard and rules engine
GL-MT300N-V2 pocket router

GL-MT300N-V2 (~$20) — compact pocket router running the autom8box firmware.

Limitations: Limited Wi-Fi range and a reduced set of Domoticz plugins due to the 16 MB flash limit. But it's a good starting point for low-budget home automation.

Flashing steps

Step 1Download autom8box-mt300nv2.bin.

Step 2 — Power on the GL-MT300N-V2 and wait for its SSID to appear (shown as GL-MT300N-V2-xxx).

GL-MT300N-V2 SSID visible in Wi-Fi list

OEM SSID appearing in the Wi-Fi list.

Step 3 — Connect to the SSID. When prompted for a password, enter goodlife (printed on the device's back sticker).

Wi-Fi password prompt

Enter the default Wi-Fi password.

Step 4 — Once connected, you should see the confirmation message:

Wi-Fi connected confirmation

Successfully connected to the router.

Step 5 — Open a browser and navigate to:
http://192.168.8.1/cgi-bin/luci/admin/system/flashops

LuCI login page

LuCI login — leave the password box empty and click "Login".

Step 6 — In the firmware update section, uncheck "Keep settings", choose autom8box-mt300nv2.bin, then click "Flash Image".

Firmware upload page

Firmware upload — uncheck "Keep settings" and select the autom8box binary.

File selected for flashing

File selected — ready to flash.

Step 7 — Click "Proceed" to confirm:

Flash confirmation dialog

Confirm flashing — click "Proceed".

Step 8 — Wait about 2 minutes for the flash to complete:

Flashing in progress

Firmware flashing in progress — wait for the device to reboot.

Step 9 — After reboot, a new SSID autom8box will appear. Connect with password goodlife.

autom8box SSID in Wi-Fi list

The new autom8box SSID is now visible.

Step 10 — Open http://192.168.8.1:8080 in your browser — Domoticz is ready:

Domoticz dashboard running on autom8box

Domoticz home automation dashboard — running entirely on the pocket router.

Post-setup security

SSH credentials: user root, password goodlife

Change root password:

passwd root

Change Wi-Fi password:

uci set wireless.default_radio0.key=my-new-password
uci commit wireless
wifi

Change SSID:

uci set wireless.default_radio0.ssid=my-new-ssid
uci commit wireless
wifi

Important: autom8box does not auto-save the Domoticz database. After configuring your devices, SSH in and run reboot — during reboot the database is saved from RAM to the persistent partition. A hard power cut without rebooting may lose your configuration.

SOURCE CODE

github.com/hackboxguy/lede-a5v11 — build instructions and sources

autom8box-mt300nv2.bin — pre-built firmware image