Help with my rules

I had a previous rule that was similar to below, but if you opened the inner door it would still fire twice (would repeat) so ive edited it, will this work right ?

No you need to move the end repeat to before your else and add a end if in its place.

Also what are your trying to do? I can't work it out from that rule.
It's going to check and run the rule on every change of temperature is that what your want?

I think you need to limit it abit. Say trigger between X and Y. It's also going to create multiple instances of this rule

1 Like

If the temp is >35 I want the rule to run
do I change changed to something else ?

Yes but I think we need to re think this, I think it's going to cause all kinds of issues currently with the repeat. :thinking:

I would start a dedicated thread as needed to think about it.

If the

  • temp is over 35 &
  • the door is closed &
  • the mode is day/evening/night Then
    notify, speak - phrase
    repeat every 15 mins
    Else
  • stop repeating
    End If

Thats all im after it do to.

would that mean this is wrong also ?

Yes this is also wrong because the repeated is in the wrong place it's not repeating anything. The main issue is temp constantly can be changed, each time it changes it fires the rule so you end up with lots of rules. This is because it will only stop the previous rule IF the temperature DROPS below your value. So how it is wrote now is going to cause errors and problems.

how can i fix it ?
like this ?


*this worked and repeated, but the repeat came through twice.

maybe this ?
sorry just stabbing in the dark

sorry or this?

1 Like

The last one is the only one that would work and it would fire less. But it could still fire more than once on its way up. I have a idea your need to use a private boolen to essentially make it only fire (should say run fully) on truth change. I'm at work at the moment so I'll create a rule later as example.

Use the built in notification app.
That would do it I would think.

As I'm at airport I will give it ago from memory.

Trigger would be "changed" or if possible between 1 and 10 or something which would cut it down alot.

IF ( temperature is >= X AND notification is ON AND private boolean is TRUE) THEN
Set private boolean to FALSE
Repeat every X (stoppable)
Notify X
END-REP
ELSE IF ( temperature is <6.0 AND private boolean is FALSE)
Stop repeating actions
Set private boolean to TRUE
END IF

This should work not sure if it's all needed without testing but it should clear all cases.

1 Like

so dont set the trigger to temp becomes greater than or equal to X ?

*it doesnt work as above, still get double notifications after the 5min repeat
will try your way @BorrisTheCat

Also I turned the notification switch off, and the repeat still fired.
does it need the notification to be in trigger events also ?

No because it now needs to fire from something like between 1 and 10. The actions and private boolean stops it creating more than one rule.

That's because you haven't done my rule yet you need the boolean

No

1 Like

hey @bravenel can you please help.
When should I be using "changed" and when should i be using "temp > than" in my trigger events ?

It all depends on when you want it to fire. In a if else end you want it to fire for two state changes. In this you want to do the same but a temperature has multiple states and that means it will fire on each change, this can cause issues if your rule can't handle this (what you had before). But once you have a run once on up and once on down your be good. So that's what the private boolean is doing here.

Hey Borris,
Here was your rule written out. Is the boolean not just a virtual switch ?

You need to set boolean to false before the repeat as per my rule.

Yes and no. It's baked into every rule, more efficient than a switch, can do other things too.

There is a post somewhere, but I can't find it and @bravenel explains the reasons behind a private boolean and what it is.

1 Like

apologies, here was that revised

1 Like

Great this should work. Turn on logs and check if you can.

1 Like