Constrain Numeric Values

I’d love to have the option to add a threshold to a numeric value. Like do not let it go above or below a certain value. In plain english I would like to say that my number can’t go below zero.

2 Likes

Can you elaborate in what scenario that would help? Just curious to find out if we can find another solution.

1 Like

The scenario is turning a wemo dimmer on triggered by one of five wyze motion/contact sensors, then turn it off after a five minute delay from when the most recent switch was triggered. So the numeric value is the number of all the triggers that increases with each one then decreases. Somehow it’s going below zero frequently now. Maybe because an addition or subtraction event is running correctly?

1 Like

Ok, thanks for clarification!

Concerning your use case: I think you could implement this with a single Boolean variable that is updated from every motion sensor (just “re-freshed” to true if motion is detected by any sensor). Then use the recent new Timout-Feature to switch on the light on first motion and off again 5 minutes after the last motion update:

1 Like

Thanks Philipp! I’ll give that a shot.

1 Like

That’s why they call him the :mage:

Ok i set this up tonight and seems to be working great! Thanks again. Those apilio options weren’t available when I first set this up but I didn’t realize they were added.

4 Likes

Follow Apilio on Twitter if you do not lurk often on the forums. Twitter or Reddit
I try and post on there when the Apilio team announce new tools :slight_smile:

1 Like