Relay

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Ro_64
Normal user
Posts: 4
Joined: 02 Nov 2018, 23:45

Relay

#1 Post by Ro_64 » 26 Mar 2019, 18:56

I have this setting but it does not work with the water level sensor. here's the example:

On relay#rele do
if [hum#hum]>=750 and [bo#bo]=0
GPIO,5,1
else
GPIO,5,0
endif
endon

http://imgur.com/gallery/MFIrt5s

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

Re: Relay

#2 Post by grovkillen » 26 Mar 2019, 19:02

You have the event which is infact the GPIO 5. So what is the input, not the relay by itself I suspect.
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:

Ro_64
Normal user
Posts: 4
Joined: 02 Nov 2018, 23:45

Re: Relay

#3 Post by Ro_64 » 26 Mar 2019, 19:34


kimot
Normal user
Posts: 170
Joined: 12 Oct 2017, 20:46

Re: Relay

#4 Post by kimot » 26 Mar 2019, 19:58

Nice, but still -what is relay#rele ?

I can see only rele#rele in your last picture.

And on new firmwares, checking relay status by defining input on the same pin is problematic.

I am using it, but on older versions _dev13 and v2.0


And you are using event:
When toggle relay (change its status - but how?? ) measure humidity and according its value switch on or off the same relay

Ro_64
Normal user
Posts: 4
Joined: 02 Nov 2018, 23:45

Re: Relay

#5 Post by Ro_64 » 26 Mar 2019, 20:19

ç
Last edited by Ro_64 on 27 Mar 2019, 22:07, edited 1 time in total.

Ro_64
Normal user
Posts: 4
Joined: 02 Nov 2018, 23:45

Re: Relay

#6 Post by Ro_64 » 26 Mar 2019, 22:30

kimot wrote:
26 Mar 2019, 19:58
Nice, but still -what is relay#rele ?

I can see only rele#rele in your last picture.

And on new firmwares, checking relay status by defining input on the same pin is problematic.

I am using it, but on older versions _dev13 and v2.0


And you are using event:
When toggle relay (change its status - but how?? ) measure humidity and according its value switch on or off the same relay
82/5000

Hello, I installed the version Release v2.0.0-dev13 just like yours.
now how can i do the select input.

User avatar
ThomasB
Normal user
Posts: 447
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Relay

#7 Post by ThomasB » 26 Mar 2019, 22:46

can you help me about this. appreciate
As Kimot stated, reading the relay pin with a Switch device is problematic. It used to be tolerated (and there are many examples of doing it in the wiki), but I do not believe it is supported anymore. To avoid surprises the solution is to use dummy variables to report the state of a relay to a rule.
Hello, I installed the version Release v2.0.0-dev13 just like yours.
now how can i do the select input.
I seem to recall that any release before Dec 2018 will support reading the relay control pin as an input if the I/O pin is defined in a Switch device.

But even if you use a release that supports reading a relay pin with the Switch device, I think there may be a logic issue in the rules. The rules will attempt to change the state of the relay whenever the relay's state has changed. But the rules also change the state of the relay. So perhaps this creates an endless loop.

- Thomas

kimot
Normal user
Posts: 170
Joined: 12 Oct 2017, 20:46

Re: Relay

#8 Post by kimot » 28 Mar 2019, 09:54

Do you realize that the event relay#rele is only executed when the relay status changes? How do you do that? In some other part of the program? If not, this event will never happen and cannot work.

User avatar
schnurzel59
Normal user
Posts: 32
Joined: 18 Feb 2019, 12:41
Location: Germany
Contact:

Re: Relay

#9 Post by schnurzel59 » 01 Apr 2019, 23:41

Hi Ro_64
It would be easier to help if you had an idea of what you want to do. What is bo # bo? A switch? When is the condition = "0" given?
hum # hum is the water level. OK.What does your relay do? A little more detail would be helpful.
Your switch rele is labeled wrong. On the one picture it has the name "rele#rele" on the other picture it is "relay#rele". What should it be?
It would be better to set the pictures right here without the weird gallery pictures. Then you would see that immediately.
Switch and relay together is also very unfavorable. For status storage take a dummy device. An event "rele#rele" only occurs if
an interval > 0 is entered in the switch device. A few more detailed information from you and it will be easier to help.
Greetings Martin

Oh God, my English is horrible.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 11 guests