Can I test if a timer is still running

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Patou
Normal user
Posts: 106
Joined: 21 May 2018, 10:33

Can I test if a timer is still running

#1 Post by Patou » 16 Jun 2023, 19:19

Hello,
I have following case.
If temp value is lower than setpoint activate a relay.
Set min on time for the relay = 10 min (600sec).
If temp value is higher than setpoint and the 10 min are not elapsed keep relay activated
If temp value is higher than setpoint and the 10 min are elapsed : relay off
On Boiler#T Do
If [Boiler#T] < [MQTT#Set_Temp]
GPIO,26,1 // R_Boiler
TimerSet,1,600
endif
If [Boiler#T] > [MQTT#Set_Temp] And "Timer elapsed"
GPIO,26,0 // R_Compresseur
endif
Endon
Is there a trick to make this working ?
As an alternative I can save the time when switching on the relay, add 10 min and check if actual time is over the 10 min but it is less elegant.
Patou

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

Re: Can I test if a timer is still running

#2 Post by Ath » 16 Jun 2023, 21:04

Patou wrote: 16 Jun 2023, 19:19 If temp value is higher than setpoint and the 10 min are not elapsed keep relay activated
If temp value is higher than setpoint and the 10 min are elapsed : relay off
Use an extra variable to keep the state, that's reset when the timer expires.
/Ton (PayPal.me)

Patou
Normal user
Posts: 106
Joined: 21 May 2018, 10:33

Re: Can I test if a timer is still running

#3 Post by Patou » 16 Jun 2023, 22:25

Nice proposal and solving the request
Thanks
Patou

Post Reply

Who is online

Users browsing this forum: No registered users and 39 guests