Welcome to Smart Home Forum by FIBARO
Search the Community
Showing results for tags 'boolean logic'.
A bit embarrassed to ask for advice on this, but I seem not to be able to understand the structure of simple IF-tests in HC2 Scenes, regardless whether these are created in the Block editor or LUA. I need an IF test with the following structure: ....IF ((a AND b) OR (a AND c)) THEN.... Due to the lack of parantheses, I am not able to understand the logical structure of the resulting statement, which in my mind seems confusing ...IF ((a AND b OR c AND b), I use this code to save electricity on my snow melting mats by twice a day testing whether weather conditions has recently set the variable SNOW to YES in which case mats are turned on for two hours (morning and afternoon) and the variable set back to NO. Seems now my mats turn on twice a day (at times "a" and "c") regardless of the the variable ("b"). Are there any "paranthesis" conventions in LUA I have not understood ?