Switch-on threshold with rules

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Dondolo
Normal user
Posts: 77
Joined: 03 Jul 2019, 06:56
Location: Germany

Switch-on threshold with rules

#1 Post by Dondolo » 05 May 2020, 19:47

Hi,
I properly support the contact point of a relay.

I switch on a pump at 12.5 volts with a Realis.
The electricity for the pump comes from a solar system and also fluctuates.
I heard the switch-on point in Rules.

Code: Select all

on INA219#Voltage do
if  [INA219#Voltage]>12.5
GPIO,13,1  // Pump on
else
GPIO,13,0  // Pump off
endif
endon
When the sun takes care of it, the switch-on point is guided.


How can I program the switch-on threshold in rules that Realis does not hear heard coming in and going out.
Maybe with a timer?

Greetings Dirk

User avatar
Ath
Normal user
Posts: 3488
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Switch-on threshold with rules

#2 Post by Ath » 05 May 2020, 20:19

Dondolo wrote: 05 May 2020, 19:47 How can I program the switch-on threshold in rules that Realis does not hear heard coming in and going out.
Maybe with a timer?
I'm don't fully understand what you are asking. Do you want to silence the sound of the relay when it turns on or off? I wouldn't know how to have a relay make less sound when switching, other than to replace it with a solid-state relay.

Or do you need to add some hysteresis to the voltage for switching the pump on and off? (and make it less 'nervous')
Then your rule could look like this:

Code: Select all

on INA219#Voltage do  // %eventvalue% is the actual value that triggered the event
  if %eventvalue%>12.5  // Above this voltage the pump is turned on
    GPIO,13,1  // Pump on
  endif
  if %eventvalue%<11.5  // Below this voltage the pump is turned off
    GPIO,13,0  // Pump off
  endif
endon
(NB: Indenting makes the code much more readable)
/Ton (PayPal.me)

Dondolo
Normal user
Posts: 77
Joined: 03 Jul 2019, 06:56
Location: Germany

Re: Switch-on threshold with rules

#3 Post by Dondolo » 07 May 2020, 12:18

Or do you need to add some hysteresis to the voltage for switching the pump on and off? (and make it less 'nervous')
Then your rule could look like this:
Hi, thanks for your feedback.
Since I have expressed myself misleadingly, it is not about the switching noise. The battery that powers the pump is solar powered, so the value fluctuates when there is little sun.
But I'll try your rules right away.
Greetings Dirk

Post Reply

Who is online

Users browsing this forum: No registered users and 55 guests