esp8266 pulse swits to domoticz

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Dick60
Normal user
Posts: 244
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

esp8266 pulse swits to domoticz

#1 Post by Dick60 » 01 Mar 2018, 22:16

How can I get it work. A pulse added ti a GPIO in my 8266 and activate a virtual switch in Domoticz. What i did alredy, add a device on 8266 and make it a switch input, normal switch. created a virtual switch in domiticz and add to "on action" the switch hyperlink. Why don't I see something happening in domotics after adding the esp switc to ground?

TD-er
Core team member
Posts: 8850
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: esp8266 pulse swits to domoticz

#2 Post by TD-er » 01 Mar 2018, 22:20

You have to add a Domoticz controller (MQTT or HTTP), configure it with the proper IP-settings.
Then go to the device page of your switch (in ESPeasy) and add the idx field used in Domoticz for the switch and check the checkbox next to the controller number (preferably nr1 if using MQTT controller) you configured to use with Domoticz.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: esp8266 pulse swits to domoticz

#3 Post by grovkillen » 01 Mar 2018, 22:20

Is it a normal switch (latching) or is it a momentary (spring back) switch? Have you selected "internal pull up"?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Dick60
Normal user
Posts: 244
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: esp8266 pulse swits to domoticz

#4 Post by Dick60 » 01 Mar 2018, 22:32

thanks for the reply. that is all what I did but after giving a pulse to my gpio 0 the log in domoticz continue in giving an "Off" and will not stop. it is a latch switch and in the off setting in Domoticz 1sec is added.. On my ESp I activated the pull up Any Idea

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: esp8266 pulse swits to domoticz

#5 Post by grovkillen » 01 Mar 2018, 22:36

ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Dick60
Normal user
Posts: 244
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: esp8266 pulse swits to domoticz

#6 Post by Dick60 » 01 Mar 2018, 22:52

I changed it into gpio 12. Result in Domoticz an continue production of "OFF" logs and does not stop. I know the ESP works goo because there is also a relay connected to the esp and clicking on the button in Domoticz, the relay activates. so from Domoticz to ESP is working but the other way around not. Do I forget something?

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: esp8266 pulse swits to domoticz

#7 Post by grovkillen » 01 Mar 2018, 23:07

Ok...

If you set delay to 0, to disable it.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Dick60
Normal user
Posts: 244
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: esp8266 pulse swits to domoticz

#8 Post by Dick60 » 02 Mar 2018, 12:33

Still working on the button. So the situation is, I have an esp, on a switch device a puls is received and that pulse need to be send to Domoticz where it change the status from a domoticz switch. How can I get that working? any help is welcome. At the moment I use GPIO-15 as a normal switch and activate "Send to controller"

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: esp8266 pulse swits to domoticz

#9 Post by grovkillen » 02 Mar 2018, 12:59

Is it internally working within ESP Easy? I mean, switch state is alternated when you switch the latching button?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Dick60
Normal user
Posts: 244
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: esp8266 pulse swits to domoticz

#10 Post by Dick60 » 02 Mar 2018, 13:23

Yes I see the "value" switching from 0 to 1 after puching the button

Dick60
Normal user
Posts: 244
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: esp8266 pulse swits to domoticz

#11 Post by Dick60 » 02 Mar 2018, 13:33

what I found just now, after pushing "submit" on my ESP, I am able to send a change of the switch to domoticz a few times and after 2-3 times changing the status of the switch, it does not work anymore. After "submit "it works again for a few times

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: esp8266 pulse swits to domoticz

#12 Post by grovkillen » 02 Mar 2018, 14:48

On advanced page, set the message delay from 1000 to 100 and test if the same happens.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Dick60
Normal user
Posts: 244
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: esp8266 pulse swits to domoticz

#13 Post by Dick60 » 02 Mar 2018, 18:00

I have a working switch, lowering the MS from 1000 ti 100 worked out very well. Thank you for the support and now I try to finish my project. Have a nice evening.

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: esp8266 pulse swits to domoticz

#14 Post by toffel969 » 02 Mar 2018, 19:11

grovkillen wrote: 02 Mar 2018, 14:48 On advanced page, set the message delay from 1000 to 100 and test if the same happens.
So many people have problems with this. Would it not be a good idea to lower the default msg delay to 100 msec in src, what do you think?
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: esp8266 pulse swits to domoticz

#15 Post by grovkillen » 02 Mar 2018, 19:34

Yeah, at least if a switch plugin is enabled...?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: esp8266 pulse swits to domoticz

#16 Post by toffel969 » 02 Mar 2018, 20:07

grovkillen wrote: 02 Mar 2018, 19:34 Yeah, at least if a switch plugin is enabled...?
What's the advantage of the longer delay?
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: esp8266 pulse swits to domoticz

#17 Post by grovkillen » 02 Mar 2018, 21:10

I don't know the details but I think it's to let the loop carry on with no interrupt in the 1 second loop.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 0 guests