-
Notifications
You must be signed in to change notification settings - Fork 197
Domoticz
arendst edited this page Dec 29, 2016
·
9 revisions
Sonoff supports Domoticz MQTT 'out of the box'. Find below the procedure to start using it.
The following servers should be made available:
- You have installed/access to a MQTT server and made contact with your sonoff
- You have installed Domoticz
Configure MQTT and Virtual Sensor hardware
- On the hardware page add Type
MQTT Client Gateway with LAN interface
- Give it a name
- Configure the interface with access to your MQTT server (
Remote Address
,Port
,Username
andPassword
) - Choose a
Public Topic
what might be the default as set toout
- On the hardware page add Type
Dummy (used for virtual switches)
- Give it a name
- Make a new virtual switch to be used with Sonoff by clicking
Create Virtual Sensors
- Give it a name
- Select
Sensor Type Switch
- On the Devices page find the new switch by it's name
- Remember it's Idx number
- Make updates to the Domoticz section of
user_config.h
but remember that these changes are only propagated if you also change the CFG_HOLDER define. This is NOT my preferred way of configuring.- Set
DOMOTICZ_OUT_TOPIC
todomoticz/
added with thePublic Topic
as defined in step 1.3 - Configure
DOMOTICZ_RELAY_IDX1
to the value read in step 4.1
- Set
- Use the webinterface and select
Configuration - Configure Domoticz
- Set
Out topic
todomoticz/
added with thePublic Topic
as defined in step 1.3 - Configure
Idx 1
to the value read in step 4.1
- Set
- Use MQTT and execute commands
-
cmnd/sonoff/DomoticzOutTopic
with payloaddomoticz/
added with thePublic Topic
as defined in step 1.3 -
cmnd/sonoff/DomoticzIdx1
with payload value read in step 4.1
-
- Use the serial interface and execute commands
-
DomoticzOutTopic
withdomoticz/
added with thePublic Topic
as defined in step 1.3 -
DomoticzIdx1
with the value read in step 4.1
-
That's it! You can now switch Sonoff from the Domoticz user interface.
- On the Switches page scroll down and find your Switch as configured in step 3
- Toggle the light bulb; Sonoff should respond