Page 1 of 1

Request: Possible Extension of Blockly functions?

Posted: Sunday 03 March 2019 12:10
by Ricard1
Hi!

I wonder if Blockly could be extended with more functions?
For example, I would like to introduce a delay before evaluating two states in a "Freeze warning function" on my Hot-tub circulation/filter pump system... (pump turns on if below freezing temp to avoid freeze damages).
I am monitoring my Fibaro Wall Plug power switch, controlling the circulating Pump, "On" state and the "power consumption" should be above 280W to indicate normal condition. (Pump consumes about 340W)
Alarm condition is If switch is "On" and power consumption is less 250W, however due to a second or two delay before power consumption is updated the alarm goes off as soon power switch on.
I tried to introduce a delay to wait for states to stabilize before checking, however that seems not straight forward possible with the current Blockly functions.

Any comments on this?

Thanks!
Ricard

Re: Request: Possible Extension of Blockly functions?

Posted: Thursday 18 April 2019 9:28
by whawhe
Think you can solve it using a combination of dummyswitch and user variable:

IF switch = On AND power < 250 AND uservariable = 0
{
dummy = On for 1 min
uservariable =1
}
ELSE IF switch = On AND power < 250 AND uservariable = 1 AND dummy = Off
{
Send your alarm message
uservariable = 0
}