I'm working on moving from Reactor to MSR, but I'm having a hard time converting this expression.
(For context, this expression is a part of my thermostat automation, and is designed to convert the outdoor temperature into a standard value from 1-6, which in turn tells the thermostat if we should be heating or cooling and to what degree)
Within Vera, this is my expression that's working perfectly:
if(TodayAvg<=33, 1, if(TodayAvg>33 and TodayAvg<=55, 2, if(TodayAvg>55 and TodayAvg<=65, 3, if(TodayAvg>65 and TodayAvg<=74, 4, if(TodayAvg>74 and TodayAvg<=80, 5, if(TodayAvg>80, 6, null))))))
I've successfully converted the first piece of that expression within MSR, with both of these configurations running successfully:
if TodayAvg <= 33 then 1 endif
TodayAvg <= 33 ? 1 : null
But as soon as I try to nest the logic, it breaks. (This code is not successful)
if TodayAvg <= 33 then 1 else if TodayAvg > 33 and TodayAvg <= 55 then 2 endif
Would love some advice on how to successfully convert this into a format that MSR accepts.
Thanks all!