control bulb with push button
Moderators: grovkillen, Stuntteam, TD-er
-
- New user
- Posts: 9
- Joined: 05 Jan 2017, 22:30
control bulb with push button
Hi
I'm niewbie in domoticz and ESPEasy. I have allready made working some parts.
I have made a virtual switch in domoticz for switching the LED and the Relay.
The command i use is :
http://192.168.xxx.xxx/control?cmd=GPIO,14,1 and http://192.168.xxx.xxx/control?cmd=GPIO,14,0
In ESPEASY : Now i want to use a push button to switch the lamp on/off.
How can i tell this to domoticz?
I'm niewbie in domoticz and ESPEasy. I have allready made working some parts.
I have made a virtual switch in domoticz for switching the LED and the Relay.
The command i use is :
http://192.168.xxx.xxx/control?cmd=GPIO,14,1 and http://192.168.xxx.xxx/control?cmd=GPIO,14,0
In ESPEASY : Now i want to use a push button to switch the lamp on/off.
How can i tell this to domoticz?
You do not have the required permissions to view the files attached to this post.
-
- New user
- Posts: 9
- Joined: 05 Jan 2017, 22:30
Re: control bulb with push button
I think I found it :
In ESP Easy i made a device : Then i found that i must activate rules whit the checkbox and the TAB rules is comming on
There i made the rule:
on testsch_in#value do
if [testsch#value] = 0
GPIO,14,1
else
GPIO,14,0
endif
endon
After couple of tests, it seems to work.
Is there anyone that can me tips or so?
Thanks
In ESP Easy i made a device : Then i found that i must activate rules whit the checkbox and the TAB rules is comming on
There i made the rule:
on testsch_in#value do
if [testsch#value] = 0
GPIO,14,1
else
GPIO,14,0
endif
endon
After couple of tests, it seems to work.
Is there anyone that can me tips or so?
Thanks
You do not have the required permissions to view the files attached to this post.
-
- New user
- Posts: 9
- Joined: 05 Jan 2017, 22:30
Re: control bulb with push button
Problem
Sometimes after a couple of swithing the output is continue switching ????
What should be the problem????
Sometimes after a couple of swithing the output is continue switching ????
What should be the problem????
-
- New user
- Posts: 9
- Joined: 05 Jan 2017, 22:30
Re: control bulb with push button
Now I use gpio12 and i don't have this anymore. everything seems to work 

-
- Normal user
- Posts: 120
- Joined: 15 Dec 2015, 14:07
Re: control bulb with push button
I'm using a similar setup, but using a pull up instead of pull down.delan009 wrote:Now I use gpio12 and i don't have this anymore. everything seems to work
I'm not using rules, I let domoticz decide.
but maybe it's giving some false inputs. Did you try with a capacitor?

Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.
-
- New user
- Posts: 9
- Joined: 05 Jan 2017, 22:30
Re: control bulb with push button
Thx DeNB3rt
I see you are from Bruges. I'm from Veurne
I control the relay with my domoticzand a nodeMCU Amica V1, no problem (http://192.168.10.224/control?cmd=GPIO,12,1)
But how tell you to domoticz when the push button is pressed the relay should changed?
Your schematic is probebly for the debouncing?
You use active high in easpeasy?
And wich pins you are using?
So a lot of questions
(wich program yuo use for the schematic?)
I see you are from Bruges. I'm from Veurne

I control the relay with my domoticzand a nodeMCU Amica V1, no problem (http://192.168.10.224/control?cmd=GPIO,12,1)
But how tell you to domoticz when the push button is pressed the relay should changed?
Your schematic is probebly for the debouncing?
You use active high in easpeasy?
And wich pins you are using?
So a lot of questions

(wich program yuo use for the schematic?)
-
- New user
- Posts: 9
- Joined: 05 Jan 2017, 22:30
Re: control bulb with push button
Hi DenB3rt
Did what you say
Added virtual hardware
addede virtual device
on-off action equal as virtual switch for the relay
The only problem that i have is when i push on the relay with the switch and i switch off the relay with the virtual switch (domoticz) i must switch 2 times on the physical switch
Did what you say
Added virtual hardware
addede virtual device
on-off action equal as virtual switch for the relay
The only problem that i have is when i push on the relay with the switch and i switch off the relay with the virtual switch (domoticz) i must switch 2 times on the physical switch
-
- New user
- Posts: 4
- Joined: 09 Feb 2017, 07:49
Re: control bulb with push button
hi delan009
did you solve the problems I'm planning to control the 4 channel relay board with 4 buttons.. is it possible or not?
did you solve the problems I'm planning to control the 4 channel relay board with 4 buttons.. is it possible or not?
-
- Normal user
- Posts: 35
- Joined: 11 Nov 2015, 13:52
Re: control bulb with push button
You can use this rule to update domoticz and switch local on your esp.
In your esp create a switch with value name: Switch1
And in domoticz create a dummy switch with:
On action: http://your esp ip/control?cmd=event,switchon
Off action: http://your esp ip/control?cmd=event,switchoff
Code: Select all
On switchon do
gpio 12,1
gpio 13,0
inputswitchstate 0,1
endon
On switchoff do
gpio 12,0
gpio 13,1
inputswitchstate 0,0
endon
On Switch1#Switch do
if [Switch1#Switch]=1
event switchon
else
event switchoff
endif
endon
And in domoticz create a dummy switch with:
On action: http://your esp ip/control?cmd=event,switchon
Off action: http://your esp ip/control?cmd=event,switchoff
-
- New user
- Posts: 9
- Joined: 05 Jan 2017, 22:30
Re: control bulb with push button
THX !!
I'll try it
(was away for couple of weeks)
I'll try it
(was away for couple of weeks)
-
- Normal user
- Posts: 120
- Joined: 15 Dec 2015, 14:07
Re: control bulb with push button
Hello Delan009 (je bent van Veurne, das dichtbijdelan009 wrote: The only problem that i have is when i push on the relay with the switch and i switch off the relay with the virtual switch (domoticz) i must switch 2 times on the physical switch

I had the same 'issue' with the push button or switch button.
I have one virtual switch in domoticz for each relay.
Then I use on/off actions in domoticz that control the gpio of the ESP (ON = http://192.168.0.100/control?cmd=gpio,5,0 and OFF http://192.168.0.100/control?cmd=gpio,5,1)
The switch is connected to an gpio and is configured with the same IDX as the virtual switch in domoticz.
Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.
-
- Normal user
- Posts: 119
- Joined: 26 Feb 2017, 17:30
Re: control bulb with push button
I know this is slightly off of what you want to do but why don't you buy an itead sonoff touch. its a built in relay and esp that nicely fits into a standard wall socket
Who is online
Users browsing this forum: Anthropic Claude Bot [bot], Bing [Bot] and 23 guests