FAQ
TL;DR: Update to wiringPi 2.52; it "works as it should". To fix physical+remote light control, use a monostable "bell" with ESP8266/ESPEasy or export GPIO inputs in Domoticz and link them to relays. [Elektroda, zbzu, post #18464653]
Why it matters: You keep wall switches usable without your phone while adding reliable smart control for lights.
Quick Facts
- Raspberry Pi 4 B needs wiringPi 2.52 for GPIO with Domoticz; older versions can throw GPIO init errors. [Elektroda, zbzu, post #18464653]
- Export GPIO as input and set interrupt edge (e.g., 27): gpio export 27 in; gpio edge 27 both; add as Contact in Domoticz. [Elektroda, credens, post #17747050]
- ESP8266 (Wemos D1 mini/Sonoff) + ESPEasy supports local button+relay control and Domoticz via MQTT; use a monostable "Bell" switch. [Elektroda, Slawek K., #17659524]
- On Sonoff Mini with ESPEasy, mapping BUTTON to GPIO4 restored the physical switch in one setup. [Elektroda, peete1978, post #18770011]
- CH340 USB–serial adapters are fine and do not affect Domoticz operation. [Elektroda, Slawek K., #17667477]
How do I add a doorbell-style switch so I can toggle lights locally and via Domoticz?
Use a monostable "bell" pushbutton with an ESP8266 module and a relay (e.g., Wemos D1 mini). Flash ESPEasy. Configure one GPIO as a button input and another for the relay. A button press toggles the relay locally, and Domoticz can also command it. This gives consistent local and remote control on the same circuit. [Elektroda, Slawek K., #17659524]
How do I configure a Raspberry Pi GPIO as a Domoticz input?
- Edit /etc/init.d/domoticz.sh and add: /usr/bin/gpio export 27 in and /usr/bin/gpio edge 27 both.
- Restart Domoticz.
- In Domoticz, add a new switch as "Contact" and select GPIO 27 from the list. This exposes the pin as an input device you can use in automations or rules. [Elektroda, credens, post #17747050]
Why do I see "GPIO INIT ERROR" on Raspberry Pi 4?
Your GPIO layer is outdated. Raspberry Pi 4 B requires wiringPi 2.52 for Domoticz GPIO to initialize. Update wiringPi to 2.52, restart Domoticz, and the GPIO list appears. After the update, GPIO-based devices operate normally. "It works as it should" after applying the newer wiring. [Elektroda, zbzu, post #18464653]
My Sonoff Mini works from Domoticz, but the wall switch does nothing—what should I check?
Verify the BUTTON pin mapping in ESPEasy. Assign the BUTTON device to the correct GPIO. In one confirmed setup, mapping the BUTTON to GPIO4 fixed the physical switch. After that, both the wall switch and Domoticz controlled the relay correctly. [Elektroda, peete1978, post #18770011]
ESPEasy button changes don’t update Domoticz—how do I fix that?
Open the BUTTON device in ESPEasy. Set its IDX to your Domoticz switch ID and enable "Send to Controller". If it still fails, create a Domoticz Dummy switch and use that IDX. Use a monostable "bell" pushbutton to avoid state mismatches from bistable toggles. [Elektroda, starob, post #18762405]
Should I use a monostable "bell" or a regular bistable wall switch?
Use a monostable "bell" pushbutton. Each press sends a pulse, which cleanly toggles the relay and stays in sync with Domoticz. "The physical button should be 'bell'." Bistable switches can require double presses to resynchronize states after remote control. [Elektroda, starob, post #18762405]
Is distributing control to ESP8266 modules better than wiring everything to the Raspberry Pi?
Yes, many users prefer this. Put ESP8266-based nodes in switch boxes to handle the local button and relay. Keep Domoticz on the Raspberry Pi as the central controller. This reduces wiring complexity and scales well using Wi‑Fi and MQTT across rooms. [Elektroda, Arek1984, post #17659042]
Can I test a Raspberry Pi input by connecting it to 5 V?
No. The Raspberry Pi uses 3.3 V logic on its 40‑pin header. Driving a GPIO with 5 V can damage the SoC. Use 3.3 V levels and internal pull‑ups, or wire the switch to pull the pin to ground safely. Protect lines with series resistors if needed. [GPIO — Raspberry Pi Documentation]
How do I mirror a GPIO input to a relay in Domoticz?
Add the input as a "Contact" device using its GPIO. Control your light with a standard Domoticz switch. Then create a simple event to toggle the relay when the contact changes. This links the physical press to the relay while preserving app control. [Elektroda, credens, post #17747050]
Is a slight delay normal when I press the physical button?
Yes. The Domoticz UI can update with a slight delay after GPIO changes. This can arise from event handling or MQTT propagation. The input still triggers reliably, but the on‑screen indicator may lag briefly. [Elektroda, credens, post #17747050]
Do CH340-based Arduino boards cause issues with Domoticz?
No. The CH340 is a reliable USB‑to‑serial converter like other chips. It does not affect Domoticz operation. You can use CH340-based boards for serial bridges or integrations without concern. [Elektroda, Slawek K., #17667477]
Why doesn’t my wall switch’s LED/neon backlight work with a Sonoff Mini input?
The Sonoff’s button input is a low‑voltage, isolated contact. Your backlight is a 230 V indicator, so it no longer gets power on that input. Options: replace the switch with a non‑lit pushbutton, add a separate mains indicator across the load, or rely on the app for status. [Elektroda, peete1978, post #18775001]