In the previous post we installed ESPEASY over NODEMCU.

This post is on controlling an LED connected to GPIO 12 of NODEMCU from DOMOTICZ Service.

 

LED_NODE

 

My Raspberry PI and PC both are on same Local Area Network , i.e connected to same WIFI Router .

Domoticz is installed on RPI

 

rpi1

 

 

Image 21

The IP address of RPI connected to the Router over WIfI is 192.168.0.150 & the DOMOTICZ dashboard is accessed by URL

192.168.0.150:8080

 

rpi7

 

On Domoticz dashboard click on Setup –> Hardware

 

Image 28

 

Create a Type  “Dummy “ (select from the drop down list) and provide a name as LED.

Image 29

 

Click on ADD

 

Image 30

Now click on  “ Create Virtual Sensors “

Image 31

Select a Sensor type as SWITCH and provide a name.

 

Image 32

 

The Virtual Switch is visible under SWITCHES tab.

Image 33

Click on EDIT

Against On Action , type in this HTTP command

http ://192.168.0.110/control?cmd=gpio,12,1

192.168.0.110  is the IP address of ESPEASY NODEMCU.

LED is at gpio12 & 1 for switching ON , 0  for Switching Off.

Image 34

Now go to the dashboard of ESPEASY by typing in 192.168.0.110 in the browser.

Under Controllers select a Protocol Domoticz HTTP

Provide the IP address of DOMOTICZ and the port no. as 8080

Click on Enabled & Submit.

Image 35

Under Devices select from the drop down Switch Input –Switch

Provide a Name and click Enabled.

Select the GPIO as GPIO 12.

Image 36

Click on SUBMIT.

Now you can switch On / Off the LED by clicking bulb icon on Domoticz.

 

Image 3

VIDEO:

 

blog_image