0 votes

Hi!

I have a sequence where targetHomeTempChange should be updated based on todaysLowTempForecast and tomorrowsLowTempForecast. The sequence fires correctly, but it seems to skip the nested if statements. I set tomorrowsLowTempForecast to 0 and todaysLowTempForecast to 4 and I would expect the targetHomeTempChange to be set to +1, but instead it gets set to 0, which is the last else statement.

Do I have something set up incorrectly or is there a bug here?

Best Regards,

Fredrik

in Sequence help by

1 Answer

0 votes
Hi Fredrik, it looks like you're trying to perform a calculation in the sequence - ie to calculate (todaysLowTempForecast - 3) and then do a comparison on the calculated value.

Unfortunately SEQUEmatic doesn't perform calculations, it just takes a value or variable and compares the values. I could look into adding basic calculations though if that would be useful for you?
by (11.1k points)
Hi Derek, thanks for the quick reply!

Sorry, I've worked as a developer previously and I just assumed you could do that :)

I can just as well add some helper variables to get the correct values to compare to. The reason for my calculation is to simulate a kind of hysteresis, so that something would only happen if there is a significant difference between two values. I have the same kind of formula in another sequence so I'll have to update that one as well.

Of course, basic calculation could be helpful, or then just a quick check that notices that you're trying to do a comparison between a number and something else and warn you it won't work.

Regards,

Fredrik
Quite a reasonable assumption!

Let me take a look at it over the long weekend - it shouldn't be too difficult to implement. A good suggestion to at least have it alert that it wont work.  I'll post back here once it's ready.

PS: Thanks a lot for the donation!

So for anyone reading this post, instead of having this (which won't work):

If tomorrowsLowTempForecast is below [todaysLowTempForecast - 3], then...

I added a new variable: todaysLowTempForecastMinus, and then did this:

  • Set todaysLowTempForecastMinus to [todaysLowTempForecast]
  • Decrease todaysLowTempForecastMinus by 3
  • If tomorrowsLowTempForecast is below [todaysLowTempForecastMinus]
Do you need help using SEQUEmatic? Search here or post a question, and one of our experts will respond to you as soon as possible.
95 questions
100 answers
257 comments
25 users