Question decreased from...Question decreased from

Hello, I want to make a trigger, when luminance decreased from a value make the rule.
Example, if illuminamce drop from 1000 I want to do something.

If illuminance increased from 2000 do something.

How can I do it?
If I compare < the rule is started every time change, the rule execute on 999, 998, 997... And I want only execute if previous is 1000 or more.

Thanks.

What you could do is define a global boolean variable.
Maybe call it luxabove1000
Then write a rule.
TRIGGER
lux sensor changes
ACTION
IF
lux sensor above 100
Set var luxabove1000 true
ELSE
Set var luxabove1000 false
END-IF

Then use the var state (true or false) in your rule/s.

This way only the rule that sets the var will be the only one that evaluates when lux changes.

You can then use the variable being true/false/changed as a trigger in your rule.

Hello, I thought this but.. It makes me to create many variables for other tigers... There are no way to do this directly watching previous state?.

Thanks.

I'm now not sure what you are after.

What I have done is defined Virtual switches that turn on and off depending on lux levels.


I then use these virtual switches in my rules.
Is this what you are getting at?

On webcore is too easy without creating variable, if previous state decreases from 400 then... Or increased from 399...
If on rule can't do without variable I will create it...
Lot of thanks

You can still use webCoRE on HE.
It does work OK on HE plus you will be able to import your existing pistons onto HE if you wish to.
If you do decide to use it I would load webCoRE onto HE via Hubitat Package Manager. (HPM). This will also make it easier to update should there be any changes to the main webCoRE app.

1 Like

Hello. I have webcore installed, but I try to use all I can directly on hubitat, perhaps the hub works better with itself apps, I don't know if it's true or not :slight_smile:

webcore runs directly on Hubitat.

1 Like

but.... webcore uses external conections, not?, the interface to create pistons is over internet.
Piston execution need internet?.
Its better use rule machine, because is an app included on hubitat? or not?

Thanks.

Not necessarily (see below)

Or, you can run it locally on a Raspberry Pi (or any other computer at your disposal)

Definitely not.

Yes, I would agree. It is better supported,

2 Likes

This is correct although it can be run locally on an RPi for example.

Nope. Unless you have configured a device in your piston that needs cloud access (the same with RM4.1) it will stay local to your HE bub.

EDIT: And what @aaiyar said above. :wink: :+1:

2 Likes

I didnt know I can install webcore on my own server!!!!!!! .

Thanks.

2 Likes