Difference between revisions of "Tutorial Domoticz Switch"

From Let's Control It
Jump to navigation Jump to search
m (Added "another tutorial" at the bottom ~~~~)
 
(13 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
This tutorial will guide you to connect your first ESP Easy switch to Domoticz. We expect that you have a working Domoticz setup and have loaded the ESP Easy firmware onto your ESP.
 
This tutorial will guide you to connect your first ESP Easy switch to Domoticz. We expect that you have a working Domoticz setup and have loaded the ESP Easy firmware onto your ESP.
  
Domoticz Menu -> Setup -> Hardware
+
In this tutorial, we use a simple switch demonstration so you don't need a real sensor attached to your ESP. A barebone ESP-01 should be sufficient for this tutorial. It will mainly demonstrate the basis steps to connect ESP to Domoticz by using the ESP Easy firmware.
 +
 
 +
= Add virtual hardware =
 +
To be able to communicate with devices like the ESP, we have to add virtual hardware to Domoticz. This step has to be done only once in your setup.
 +
 
 +
From the main Domoticz Menu, Select Setup -> Hardware
  
 
[[File:Tutorial_Domoticz_Menu.png]]
 
[[File:Tutorial_Domoticz_Menu.png]]
 +
  
 
And add following hardware to you system:
 
And add following hardware to you system:
Line 9: Line 15:
 
[[File:Tutorial_Domoticz_Add_Hardware.png]]
 
[[File:Tutorial_Domoticz_Add_Hardware.png]]
  
 +
 +
= Create a virtual sensor =
 
The new hardware should be in the list and there should be a button "Create Virtual Sensors"
 
The new hardware should be in the list and there should be a button "Create Virtual Sensors"
  
 
[[File:Tutorial_Domoticz_Create_Sensor.png]]
 
[[File:Tutorial_Domoticz_Create_Sensor.png]]
 +
  
 
Click this button and choose Sensor Type "Switch"
 
Click this button and choose Sensor Type "Switch"
Line 17: Line 26:
 
[[File:Tutorial_Domoticz_Add_Sensor.png]]
 
[[File:Tutorial_Domoticz_Add_Sensor.png]]
  
Domoticz Menu -> Setup -> Devices
+
 
 +
= Add device to your system =
 +
Now we have to add the device in Domoticz to become active.
 +
 
 +
From the main Domoticz Menu, Select Setup -> Devices
  
 
[[File:Tutorial_Domoticz_Menu.png]]
 
[[File:Tutorial_Domoticz_Menu.png]]
  
Your new temperature device should be listed here
+
 
 +
Your new switch device should be listed here
  
 
[[File:Tutorial_Domoticz_Device_List.png]]
 
[[File:Tutorial_Domoticz_Device_List.png]]
 +
 +
Please note the number below "IDX". This is the unique reference to this device and we need it later on to configure the ESP Easy module. In this case the IDX number is 250.
  
 
Click the little green button with the arrow pointing in the right direction to add this device
 
Click the little green button with the arrow pointing in the right direction to add this device
  
 
[[File:Tutorial_Domoticz_Device_Add.png]]
 
[[File:Tutorial_Domoticz_Device_Add.png]]
 +
  
 
Name this device "Demo" and click add device.
 
Name this device "Demo" and click add device.
Line 35: Line 52:
 
[[File:Tutorial_Domoticz_Device.png]]
 
[[File:Tutorial_Domoticz_Device.png]]
  
 
+
= Connect the ESP Easy to your network =
 
If you have your ESP board loaded with ESP Easy firmware, powerup the unit and an Access point named "ESP_0" should appear. Connect to this access point and browse to http://192.168.4.1. If all went well, the following screen should be shown:
 
If you have your ESP board loaded with ESP Easy firmware, powerup the unit and an Access point named "ESP_0" should appear. Connect to this access point and browse to http://192.168.4.1. If all went well, the following screen should be shown:
  
 
[[File:Easy_Main.png]]
 
[[File:Easy_Main.png]]
 +
  
 
Click the "Config" button
 
Click the "Config" button
Line 44: Line 62:
 
[[File:Tutorial_Easy_Config.png]]
 
[[File:Tutorial_Easy_Config.png]]
  
Enter your SSID and WPA key and click the "Submit" button
+
 
 +
Configure at least the following settings to get you started:
 +
 
 +
SSID
 +
WPA
 +
Protocol Domoticz HTTP
 +
Controller IP = your Domoticz server IP
 +
Controller Port = your Domoticz server port, default should be 8080
 +
 
 +
Click the "Submit" button
 +
 
  
 
Click the "Tools" button and Click "Connect"
 
Click the "Tools" button and Click "Connect"
  
 
[[File:Tutorial_Easy_Tools.png]]
 
[[File:Tutorial_Easy_Tools.png]]
 +
  
 
Go back to "Main" and chech the status. It should have an IP address:
 
Go back to "Main" and chech the status. It should have an IP address:
  
 
[[File:Tutorial_Easy_Connected.png]]
 
[[File:Tutorial_Easy_Connected.png]]
 +
 +
 +
From here on, you should start using http://192.168.0.232 to connect to your ESP device.
 +
 +
= Configure the ESP Easy Devices =
 +
Click the "Devices" button
 +
 +
[[File:Tutorial_Easy_Devices.png]]
 +
 +
 +
Click the "Edit" button on the first row
 +
 +
[[File:Tutorial_Easy_DevicesConfig1.png]]
 +
 +
 +
Select "Switch Input" and enter the IDX found earlier in Domoticz. In our demo it was 250.
 +
 +
click "Submit" to get additional settings for this device
 +
 +
[[File:Tutorial_Easy_DevicesConfig2.png]]
 +
 +
 +
This should be the final result:
 +
 +
[[File:Tutorial_Easy_DevicesConfig3.png]]
 +
 +
 +
= Testing =
 +
Now toggle GPIO-0 pin high and low and the light bulb in Domoticz should turn on/off accordingly!
 +
 +
(if you're using a NodeMCU board, you just have to toggle the "flash" button)
 +
 +
= Another way to set up Domoticz to control an ESP Easy =
 +
[[Tutorial - Domoticz to control an ESP as a light switch]]

Latest revision as of 10:43, 9 October 2017

This tutorial will guide you to connect your first ESP Easy switch to Domoticz. We expect that you have a working Domoticz setup and have loaded the ESP Easy firmware onto your ESP.

In this tutorial, we use a simple switch demonstration so you don't need a real sensor attached to your ESP. A barebone ESP-01 should be sufficient for this tutorial. It will mainly demonstrate the basis steps to connect ESP to Domoticz by using the ESP Easy firmware.

Add virtual hardware

To be able to communicate with devices like the ESP, we have to add virtual hardware to Domoticz. This step has to be done only once in your setup.

From the main Domoticz Menu, Select Setup -> Hardware

Tutorial Domoticz Menu.png


And add following hardware to you system:

Tutorial Domoticz Add Hardware.png


Create a virtual sensor

The new hardware should be in the list and there should be a button "Create Virtual Sensors"

Tutorial Domoticz Create Sensor.png


Click this button and choose Sensor Type "Switch"

Tutorial Domoticz Add Sensor.png


Add device to your system

Now we have to add the device in Domoticz to become active.

From the main Domoticz Menu, Select Setup -> Devices

Tutorial Domoticz Menu.png


Your new switch device should be listed here

Tutorial Domoticz Device List.png

Please note the number below "IDX". This is the unique reference to this device and we need it later on to configure the ESP Easy module. In this case the IDX number is 250.

Click the little green button with the arrow pointing in the right direction to add this device

Tutorial Domoticz Device Add.png


Name this device "Demo" and click add device.

Navigate to menu "Switches" and your device should be listed:

Tutorial Domoticz Device.png

Connect the ESP Easy to your network

If you have your ESP board loaded with ESP Easy firmware, powerup the unit and an Access point named "ESP_0" should appear. Connect to this access point and browse to http://192.168.4.1. If all went well, the following screen should be shown:

Easy Main.png


Click the "Config" button

Tutorial Easy Config.png


Configure at least the following settings to get you started:

SSID
WPA
Protocol Domoticz HTTP
Controller IP = your Domoticz server IP
Controller Port = your Domoticz server port, default should be 8080

Click the "Submit" button


Click the "Tools" button and Click "Connect"

Tutorial Easy Tools.png


Go back to "Main" and chech the status. It should have an IP address:

Tutorial Easy Connected.png


From here on, you should start using http://192.168.0.232 to connect to your ESP device.

Configure the ESP Easy Devices

Click the "Devices" button

Tutorial Easy Devices.png


Click the "Edit" button on the first row

Tutorial Easy DevicesConfig1.png


Select "Switch Input" and enter the IDX found earlier in Domoticz. In our demo it was 250.

click "Submit" to get additional settings for this device

Tutorial Easy DevicesConfig2.png


This should be the final result:

Tutorial Easy DevicesConfig3.png


Testing

Now toggle GPIO-0 pin high and low and the light bulb in Domoticz should turn on/off accordingly!

(if you're using a NodeMCU board, you just have to toggle the "flash" button)

Another way to set up Domoticz to control an ESP Easy

Tutorial - Domoticz to control an ESP as a light switch